Skip to content

Commit

Permalink
tests: Make ipc test more portable (#466)
Browse files Browse the repository at this point in the history
fix a couple of errors reported by covscan

1. /usr/lib64/libqb/tests/resources.test:8:34: warning[SC2039]: In POSIX sh, UID is undefined.
1. /usr/lib64/libqb/tests/resources.test:8:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
1. /usr/lib64/libqb/tests/ipc_sock.test:10:34: warning[SC2039]: In POSIX sh, UID is undefined.
1. /usr/lib64/libqb/tests/ipc_sock.test:10:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
  • Loading branch information
chrissie-c authored Jun 8, 2022
1 parent 758044b commit 44a4cb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/ipc_sock.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This creates sockets in /var/run so needs to be root
#
if [ "$(uname -s)" = "Linux" -a "$UID" = "0" ]
if [ "$(uname -s)" = "Linux" ] && [ "`id -u`" = "0" ]
then
if [ -f "$(pwd)/.libs/libstat_wrapper.so" ]
then
Expand Down
2 changes: 1 addition & 1 deletion tests/resources.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EXPECTED_DLOCK=6
EXPECTED_LEFTOVER=2

# Linux also runs filesystem socket tests
if [ "$(uname -s)" = "Linux" -a "$UID" = "0" ]
if [ "$(uname -s)" = "Linux" ] && [ "`id -u`" = "0" ]
then
EXPECTED_DLOCK=12
EXPECTED_LEFTOVER=4
Expand Down

0 comments on commit 44a4cb2

Please sign in to comment.