diff options
author | Martin Pärtel <martin.partel@gmail.com> | 2017-04-13 17:54:38 +0300 |
---|---|---|
committer | Martin Pärtel <martin.partel@gmail.com> | 2017-04-13 17:54:38 +0300 |
commit | d63afe519c790c3202c99eec7f3903806cad2098 (patch) | |
tree | 6b13da289c047388ac5835190dfe431271919de0 /tests/test_bindfs.rb | |
parent | 3d61a4efc9a011c649bbbad9519abbf749224d8e (diff) | |
download | bindfs-d63afe519c790c3202c99eec7f3903806cad2098.tar.gz |
Document that -o dev is required for device files and test it.
Fixes #52.
Diffstat (limited to 'tests/test_bindfs.rb')
-rwxr-xr-x | tests/test_bindfs.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb index ba30528..d3f54b9 100755 --- a/tests/test_bindfs.rb +++ b/tests/test_bindfs.rb @@ -747,6 +747,17 @@ testenv("", :title => "mntdir with newline", :mntdir_name => "a\nb") do assert { File.exist?("a\nb/f") } end +if `uname`.strip != 'FreeBSD' # -o dev is not supported on FreeBSD + root_testenv("-odev") do + system("mknod mnt/zero c 1 5") + data = File.read("mnt/zero", 3) + assert { data.length == 3 } + assert { data.chars.to_a[0] == "\0" } + assert { data.chars.to_a[1] == "\0" } + assert { data.chars.to_a[2] == "\0" } + end +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. # TODO: support FreeBSD in this test (different group management commands) |