Documentation ¶
Overview ¶
Package wsltestutils implements helper functions for frequently needed functionality in Windows-Agent and End-to-End tests.
Index ¶
- func DistroState(t *testing.T, ctx context.Context, distroName string) string
- func NonRegisteredDistro(t *testing.T) (distroName string, GUID string)
- func PowershellImportDistro(t *testing.T, ctx context.Context, distroName string, rootFsPath string) (GUID string)
- func RandomDistroName(t *testing.T) (name string)
- func RegisterDistro(t *testing.T, ctx context.Context, realDistro bool) (distroName string, GUID string)
- func ReregisterDistro(t *testing.T, ctx context.Context, distroName string, realDistro bool) (GUID string)
- func TerminateDistro(t *testing.T, ctx context.Context, distroName string)
- func UnregisterDistro(t *testing.T, ctx context.Context, distroName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DistroState ¶
DistroState returns the state of the distro as specified by wsl.exe. Possible states: - Installing - Running - Stopped - Unregistered.
func NonRegisteredDistro ¶
NonRegisteredDistro generates a random distroName and GUID but does not register them.
func PowershellImportDistro ¶
func PowershellImportDistro(t *testing.T, ctx context.Context, distroName string, rootFsPath string) (GUID string)
PowershellImportDistro uses powershell.exe to import a distro from a specific rootfs. This implementation is a stub.
func RandomDistroName ¶
RandomDistroName generates a distroName that is not registered.
func RegisterDistro ¶
func RegisterDistro(t *testing.T, ctx context.Context, realDistro bool) (distroName string, GUID string)
RegisterDistro registers a distro and returns its randomly-generated name and its GUID.
func ReregisterDistro ¶
func ReregisterDistro(t *testing.T, ctx context.Context, distroName string, realDistro bool) (GUID string)
ReregisterDistro unregister, then registers the same distro again.
func TerminateDistro ¶
TerminateDistro shuts down that distro in particular. Wrapper for `wsl -t distro`.
Types ¶
This section is empty.