aboutsummaryrefslogtreecommitdiff
path: root/libpod/lock/file/file_lock_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/lock/file/file_lock_test.go')
-rw-r--r--libpod/lock/file/file_lock_test.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/libpod/lock/file/file_lock_test.go b/libpod/lock/file/file_lock_test.go
index 7ac8bf31a..2d7dded23 100644
--- a/libpod/lock/file/file_lock_test.go
+++ b/libpod/lock/file/file_lock_test.go
@@ -2,7 +2,6 @@ package file
import (
"fmt"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -13,11 +12,9 @@ import (
// Test that creating and destroying locks work
func TestCreateAndDeallocate(t *testing.T) {
- d, err := ioutil.TempDir("", "filelock")
- assert.NoError(t, err)
- defer os.RemoveAll(d)
+ d := t.TempDir()
- _, err = OpenFileLock(filepath.Join(d, "locks"))
+ _, err := OpenFileLock(filepath.Join(d, "locks"))
assert.Error(t, err)
l, err := CreateFileLock(filepath.Join(d, "locks"))
@@ -47,9 +44,7 @@ func TestCreateAndDeallocate(t *testing.T) {
// Test that creating and destroying locks work
func TestLockAndUnlock(t *testing.T) {
- d, err := ioutil.TempDir("", "filelock")
- assert.NoError(t, err)
- defer os.RemoveAll(d)
+ d := t.TempDir()
l, err := CreateFileLock(filepath.Join(d, "locks"))
assert.NoError(t, err)