Skip to content

Commit

Permalink
Eliminate interference from env vars in cmdline test
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Koch <[email protected]>
  • Loading branch information
hugelgupf committed Jan 13, 2024
1 parent d6f6c6f commit 6271fd7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions qemu/devices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ func TestIDAllocator(t *testing.T) {
}

func TestDevices(t *testing.T) {
resetVars := []string{
"VMTEST_QEMU",
"VMTEST_QEMU_ARCH",
"VMTEST_KERNEL",
"VMTEST_INITRAMFS",
"VMTEST_TIMEOUT",
}
for _, key := range resetVars {
t.Setenv(key, "")
}

emptyFilePath := filepath.Join(t.TempDir(), "file")
if err := os.WriteFile(emptyFilePath, []byte{}, 0o777); err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 6271fd7

Please sign in to comment.