Skip to content

Commit

Permalink
tests: avoid false failure when running as root
Browse files Browse the repository at this point in the history
* tests/misc/sync.sh: Ensure dir is unreadable before
including the permission check.
  • Loading branch information
pixelb committed Jun 25, 2015
1 parent 1d82751 commit cacd9bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/misc/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ returns_ 1 sync file nofile || fail=1
# Ensure inaccessible dirs give an appropriate error
mkdir norw || framework_failure_
chmod 0 norw || framework_failure_
sync norw 2>err
printf "sync: error opening 'norw': Permission denied\n" >exp
compare exp err || fail=1
if ! test -r norw; then
sync norw 2>err
printf "sync: error opening 'norw': Permission denied\n" >exp
compare exp err || fail=1
fi

if test "$fail" != '1'; then
# Ensure a fifo doesn't block
Expand Down

0 comments on commit cacd9bf

Please sign in to comment.