diff --git a/internal/backend/local/local_test.go b/internal/backend/local/local_test.go index 1d15f5ff9..e5b1e2533 100644 --- a/internal/backend/local/local_test.go +++ b/internal/backend/local/local_test.go @@ -104,6 +104,20 @@ func openclose(t testing.TB, dir string) { } } +func mkdir(t testing.TB, dir string) { + err := os.Mkdir(dir, 0700) + if err != nil { + t.Fatal(err) + } +} + +func removeAll(t testing.TB, dir string) { + err := os.RemoveAll(dir) + if err != nil { + t.Fatal(err) + } +} + func TestOpenNotExistingDirectory(t *testing.T) { dir, cleanup := TempDir(t) defer cleanup() @@ -114,4 +128,9 @@ func TestOpenNotExistingDirectory(t *testing.T) { openclose(t, dir) empty(t, dir) + + mkdir(t, filepath.Join(dir, "data")) + openclose(t, dir) + removeAll(t, filepath.Join(dir, "data")) + empty(t, dir) }