aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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