wsltestutils

package
v0.0.0-...-4647703 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package wsltestutils implements helper functions for frequently needed functionality in Windows-Agent and End-to-End tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DistroState

func DistroState(t *testing.T, ctx context.Context, distroName string) string

DistroState returns the state of the distro as specified by wsl.exe. Possible states: - Installing - Running - Stopped - Unregistered.

func NonRegisteredDistro

func NonRegisteredDistro(t *testing.T) (distroName string, GUID string)

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

func RandomDistroName(t *testing.T) (name string)

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

func TerminateDistro(t *testing.T, ctx context.Context, distroName string)

TerminateDistro shuts down that distro in particular. Wrapper for `wsl -t distro`.

func UnregisterDistro

func UnregisterDistro(t *testing.T, ctx context.Context, distroName string)

UnregisterDistro unregisters a WSL distro. Errors are ignored.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL