aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2019-04-29 13:26:39 +0300
committerMartin Pärtel <martin.partel@gmail.com>2019-04-29 13:26:39 +0300
commit7c43dd75380dcfbd18336aa017dd3e7d93a4acdd (patch)
treee2767b34928857c24337783357f1847ce629b803 /tests
parentc5c1b80926b871ced62a13253093abe528b529c7 (diff)
downloadbindfs-7c43dd75380dcfbd18336aa017dd3e7d93a4acdd.tar.gz
Added --forward-odirect. bindfs now won't forward O_DIRECT by default.
Follow-up to #74.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_bindfs.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb
index a6ecf2c..bfc6d64 100755
--- a/tests/test_bindfs.rb
+++ b/tests/test_bindfs.rb
@@ -782,14 +782,29 @@ if `uname`.strip == 'Linux'
('abc' * 10000)[0...8192]
end
- testenv("", :title => "O_DIRECT reads") do
+ testenv("", :title => "O_DIRECT reads with O_DIRECT ignored") do
File.write("src/f", odirect_data)
read_data = `#{$tests_dir}/odirect_read mnt/f`
assert { $?.success? }
assert { read_data == odirect_data }
end
- testenv("", :title => "O_DIRECT writes") do
+ testenv("", :title => "O_DIRECT writes with O_DIRECT ignored") do
+ IO.popen("#{$tests_dir}/odirect_write mnt/f", "w") do |pipe|
+ pipe.write(odirect_data)
+ end
+ assert { $?.success? }
+ assert { File.read("src/f") == odirect_data }
+ end
+
+ testenv("--forward-odirect=512", :title => "O_DIRECT reads with O_DIRECT forwarded") do
+ File.write("src/f", odirect_data)
+ read_data = `#{$tests_dir}/odirect_read mnt/f`
+ assert { $?.success? }
+ assert { read_data == odirect_data }
+ end
+
+ testenv("--forward-odirect=512", :title => "O_DIRECT writes with O_DIRECT forwarded") do
IO.popen("#{$tests_dir}/odirect_write mnt/f", "w") do |pipe|
pipe.write(odirect_data)
end