aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2016-01-19 22:01:45 +0000
committerMartin Pärtel <martin.partel@gmail.com>2016-01-19 22:01:45 +0000
commitf28bcef652a4f8724acb1d9961902adb85fc55d2 (patch)
treea48113d5cf710050e73d1330845192efe0a9d9b9
parent7d3c41a881d746ea9a18f56910bb7bdb633f00cc (diff)
downloadbindfs-f28bcef652a4f8724acb1d9961902adb85fc55d2.tar.gz
Added a test case for reading the entries of a large directory.
-rwxr-xr-xtests/test_bindfs.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb
index 5da0c10..3e31538 100755
--- a/tests/test_bindfs.rb
+++ b/tests/test_bindfs.rb
@@ -559,6 +559,18 @@ nonroot_testenv("--resolve-symlinks --resolved-symlink-deletion=target-first -p
end
end
+# Issue #28 reproduction attempt.
+testenv("", :title => "many files in a directory") do
+ mkdir('src/dir')
+ expected_entries = ['.', '..']
+ 10000.times do |i|
+ touch("src/dir/#{i}")
+ expected_entries << i.to_s
+ end
+
+ assert { Dir.entries('mnt/dir').sort == expected_entries.sort }
+end
+
# FIXME: this stuff around testenv is a hax, and testenv may also exit(), which defeats the 'ensure' below.
# the test setup ought to be refactored. It might well use MiniTest or something.
if Process.uid == 0