INNER CODE UNIT · Go
configureTestWSL2Distro
ddev/ddev · winpkg/installer_test.go:614
func configureTestWSL2Distro(t *testing.T, distroName string) {
require := require.New(t)
t.Logf("Verifying pre-provisioned test distro: %s", distroName)
out, err := exec.RunHostCommand("wsl.exe", "-l", "-q")
require.NoError(err, "Failed to list WSL distros")
// Convert UTF-16 output to UTF-8 by removing null bytes
cleanOut := strings.ReplaceAll(out, "\x00", "")
if !strings.Contains(cleanOut, distroName) {
t.Fatalf("Test distro %q is not registered on this runner. Provision it once "+
"(wsl --install <base> --name %s) per "+
"docs/content/developers/buildkite-testmachine-setup.md before running installer tests.",
distroName, distroName)
}
t.Logf("Test WSL2 distro %s present", distroName)
}