diff --git a/pkg/machine/e2e/machine_test.go b/pkg/machine/e2e/machine_test.go index 866b23b878..f7af93ad17 100644 --- a/pkg/machine/e2e/machine_test.go +++ b/pkg/machine/e2e/machine_test.go @@ -147,6 +147,11 @@ func setup() (string, *machineTestBuilder) { if err := os.Setenv("HOME", homeDir); err != nil { Fail("failed to set home dir") } + if runtime.GOOS == "windows" { + if err := os.Setenv("USERPROFILE", homeDir); err != nil { + Fail("unable to set home dir on windows") + } + } if err := os.Setenv("XDG_RUNTIME_DIR", homeDir); err != nil { Fail("failed to set xdg_runtime dir") } @@ -203,4 +208,9 @@ func teardown(origHomeDir string, testDir string, mb *machineTestBuilder) { if err := os.Setenv("HOME", origHomeDir); err != nil { Fail("failed to set home dir") } + if runtime.GOOS == "windows" { + if err := os.Setenv("USERPROFILE", origHomeDir); err != nil { + Fail("failed to set windows home dir back to original") + } + } }