summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/openbackingdir_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fusefrontend/openbackingdir_test.go')
-rw-r--r--internal/fusefrontend/openbackingdir_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/fusefrontend/openbackingdir_test.go b/internal/fusefrontend/openbackingdir_test.go
index f784989..266e265 100644
--- a/internal/fusefrontend/openbackingdir_test.go
+++ b/internal/fusefrontend/openbackingdir_test.go
@@ -37,6 +37,18 @@ func TestOpenBackingDir(t *testing.T) {
if cName != "." {
t.Fatal("cName should be .")
}
+ syscall.Close(dirfd)
+
+ // Again, but populate the cache for "" by looking up a non-existing file
+ fs.GetAttr("xyz1234", nil)
+ dirfd, cName, err = fs.openBackingDir("")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if cName != "." {
+ t.Fatal("cName should be .")
+ }
+
err = syscallcompat.Faccessat(dirfd, cName, unix.R_OK)
if err != nil {
t.Error(err)