diff options
Diffstat (limited to 'pkg/machine/qemu/config_test.go')
-rw-r--r-- | pkg/machine/qemu/config_test.go | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/pkg/machine/qemu/config_test.go b/pkg/machine/qemu/config_test.go index 3f92881fa..4d96ec6e7 100644 --- a/pkg/machine/qemu/config_test.go +++ b/pkg/machine/qemu/config_test.go @@ -52,23 +52,15 @@ func TestMachineFile_GetPath(t *testing.T) { func TestNewMachineFile(t *testing.T) { empty := "" - homedir, err := os.MkdirTemp("/tmp", "homedir") - if err != nil { - panic(err) - } - defer os.RemoveAll(homedir) - longTemp, err := os.MkdirTemp("/tmp", "tmpdir") - if err != nil { - panic(err) - } - defer os.RemoveAll(longTemp) + homedir := t.TempDir() + longTemp := t.TempDir() oldhome := os.Getenv("HOME") os.Setenv("HOME", homedir) //nolint: tenv defer os.Setenv("HOME", oldhome) p := "/var/tmp/podman/my.sock" longp := filepath.Join(longTemp, utils.RandomString(100), "my.sock") - err = os.MkdirAll(filepath.Dir(longp), 0755) + err := os.MkdirAll(filepath.Dir(longp), 0755) if err != nil { panic(err) } |