Skip to content

Commit

Permalink
better handling for xattr errors
Browse files Browse the repository at this point in the history
  • Loading branch information
justincormack committed Sep 18, 2015
1 parent b6bb892 commit 18cd829
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/bsd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ test.bsd_extattr = {
assert(S.unlink(tmpfile))
local n, err = fd:extattr_get("user", "myattr", false) -- false does raw call with no buffer to return length
if not n and err.OPNOTSUPP then error "skipped" end -- fs does not support extattr
assert(not n and err.NOATTR)
assert(not n, "expected to fail")
assert(err.NOATTR, err)
assert(fd:close())
end,
test_extattr_getsetdel_fd = function()
Expand All @@ -275,7 +276,8 @@ test.bsd_extattr = {
assert(S.unlink(tmpfile))
local n, err = fd:extattr_get("user", "myattr", false) -- false does raw call with no buffer to return length
if not n and err.OPNOTSUPP then error "skipped" end -- fs does not support extattr
assert(not n and err.NOATTR)
assert(not n, "expected to fail")
assert(err.NOATTR, err)
local n, err = fd:extattr_set("user", "myattr", "myvalue")
if not n and err.OPNOTSUPP then error "skipped" end -- fs does not support setting extattr
assert(n, err)
Expand Down

0 comments on commit 18cd829

Please sign in to comment.