From d63afe519c790c3202c99eec7f3903806cad2098 Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Thu, 13 Apr 2017 17:54:38 +0300 Subject: Document that -o dev is required for device files and test it. Fixes #52. --- tests/test_bindfs.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') 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) -- cgit v1.2.3