mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
plugin: use t.TempDir
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -7,11 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func TestAtomicRemoveAllNormal(t *testing.T) {
|
||||
dir, err := os.MkdirTemp("", "atomic-remove-with-normal")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(dir) // just try to make sure this gets cleaned up
|
||||
dir := t.TempDir()
|
||||
|
||||
if err := atomicRemoveAll(dir); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -26,11 +22,7 @@ func TestAtomicRemoveAllNormal(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAtomicRemoveAllAlreadyExists(t *testing.T) {
|
||||
dir, err := os.MkdirTemp("", "atomic-remove-already-exists")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(dir) // just try to make sure this gets cleaned up
|
||||
dir := t.TempDir()
|
||||
|
||||
if err := os.MkdirAll(dir+"-removing", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -54,11 +46,7 @@ func TestAtomicRemoveAllNotExist(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
dir, err := os.MkdirTemp("", "atomic-remove-already-exists")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(dir) // just try to make sure this gets cleaned up
|
||||
dir := t.TempDir()
|
||||
|
||||
// create the removing dir, but not the "real" one
|
||||
foo := filepath.Join(dir, "foo")
|
||||
|
||||
@@ -23,11 +23,9 @@ import (
|
||||
|
||||
func TestManagerWithPluginMounts(t *testing.T) {
|
||||
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
|
||||
root, err := os.MkdirTemp("", "test-store-with-plugin-mounts")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer containerfs.EnsureRemoveAll(root)
|
||||
|
||||
root := t.TempDir()
|
||||
t.Cleanup(func() { _ = containerfs.EnsureRemoveAll(root) })
|
||||
|
||||
s := NewStore()
|
||||
managerRoot := filepath.Join(root, "manager")
|
||||
|
||||
Reference in New Issue
Block a user