Skip to content

Commit

Permalink
on freebsd/zfs chflags will fail, skip
Browse files Browse the repository at this point in the history
  • Loading branch information
justincormack committed Sep 18, 2015
1 parent d78235c commit 7065b0d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/bsd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ test.filesystem_bsd = {
test_chflags = function()
local fd = assert(S.creat(tmpfile, "RWXU"))
assert(fd:write("append"))
assert(S.chflags(tmpfile, "uf_append"))
local ok, err = S.chflags(tmpfile, "uf_append")
if not ok and err.OPNOTSUPP then error "skipped" end
assert(ok, err)
assert(fd:write("append"))
assert(fd:seek(0, "set"))
local n, err = fd:write("not append")
Expand All @@ -102,7 +104,9 @@ test.filesystem_bsd = {
if not S.lchflags then error "skipped" end
local fd = assert(S.creat(tmpfile, "RWXU"))
assert(fd:write("append"))
assert(S.lchflags(tmpfile, "uf_append"))
local ok, err = S.lchflags(tmpfile, "uf_append")
if not ok and err.OPNOTSUPP then error "skipped" end
assert(ok, err)
assert(fd:write("append"))
assert(fd:seek(0, "set"))
local n, err = fd:write("not append")
Expand All @@ -114,7 +118,9 @@ test.filesystem_bsd = {
test_fchflags = function()
local fd = assert(S.creat(tmpfile, "RWXU"))
assert(fd:write("append"))
assert(fd:chflags("uf_append"))
local ok, err = fd:chflags("uf_append")
if not ok and err.OPNOTSUPP then error "skipped" end
assert(ok, err)
assert(fd:write("append"))
assert(fd:seek(0, "set"))
local n, err = fd:write("not append")
Expand All @@ -127,7 +133,9 @@ test.filesystem_bsd = {
if not S.chflagsat then error "skipped" end
local fd = assert(S.creat(tmpfile, "RWXU"))
assert(fd:write("append"))
assert(S.chflagsat("fdcwd", tmpfile, "uf_append", "symlink_nofollow"))
local ok, err = S.chflagsat("fdcwd", tmpfile, "uf_append", "symlink_nofollow")
if not ok and err.OPNOTSUPP then error "skipped" end
assert(ok, err)
assert(fd:write("append"))
assert(fd:seek(0, "set"))
local n, err = fd:write("not append")
Expand Down

0 comments on commit 7065b0d

Please sign in to comment.