diff options
| author | Marios Titas | 2026-08-15 23:03:54 +0300 |
|---|---|---|
| committer | Jakob Unterwurzacher | 2026-09-01 20:51:36 +0200 |
| commit | 5b2881e7cbc347eb379d35c3ae1f491bef8f227f (patch) | |
| tree | 7ba317b34cf943c2c9181597668de8a30a0e039c /tests/cli | |
| parent | 9c2130d6c2e54c45c6787fbc49a896a8544a5e47 (diff) | |
cli: use READDIR by default
Avoid eager per-entry metadata work for names-only listings, and
add -readdirplus for workloads that benefit from eager attributes.
Co-authored-by: Cursor <cursoragent@cursor.com>
Diffstat (limited to 'tests/cli')
| -rw-r--r-- | tests/cli/cli_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go index 01cc3b7..472941d 100644 --- a/tests/cli/cli_test.go +++ b/tests/cli/cli_test.go @@ -991,6 +991,25 @@ func TestInitNotEmpty(t *testing.T) { } } +// TestReaddirplus checks that mounting and listing work with -readdirplus. +func TestReaddirplus(t *testing.T) { + dir := test_helpers.InitFS(t) + mnt := dir + ".mnt" + test_helpers.MountOrFatal(t, dir, mnt, "-extpass=echo test", "-readdirplus") + defer test_helpers.UnmountPanic(mnt) + + if err := os.WriteFile(mnt+"/file", nil, 0600); err != nil { + t.Fatal(err) + } + entries, err := os.ReadDir(mnt) + if err != nil { + t.Fatal(err) + } + if len(entries) != 1 || entries[0].Name() != "file" { + t.Fatalf("unexpected directory entries: %v", entries) + } +} + // TestSharedstorage checks that `-sharedstorage` shows stable inode numbers to // userspace despite having hard link tracking disabled func TestSharedstorage(t *testing.T) { |
