summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-07-27 15:24:58 +1000
committerStefan Metzmacher <metze@samba.org>2016-07-28 05:00:18 +0200
commit2f7096494badbd4453d8a85dd3d56ae5614c543c (patch)
treec9c624feeab212fe7186d6541f9f5c0245efc37c
parent806f54f15dd0ef2375b06c2d19376aae324b8bef (diff)
downloadsamba-2f7096494badbd4453d8a85dd3d56ae5614c543c.tar.gz
ctdb-tests: Avoid portability issue in porting tests
EUID is bash-only, so this condition always fails on other shells. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-rwxr-xr-xctdb/tests/cunit/porting_tests_001.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/ctdb/tests/cunit/porting_tests_001.sh b/ctdb/tests/cunit/porting_tests_001.sh
index 5612c99034f..2b030079da4 100755
--- a/ctdb/tests/cunit/porting_tests_001.sh
+++ b/ctdb/tests/cunit/porting_tests_001.sh
@@ -11,7 +11,8 @@ remove_socket ()
test_cleanup remove_socket
-if [ $EUID -eq 0 ] ; then
+uid=$(id -u)
+if [ "$uid" -eq 0 ] ; then
ok "../common/system_linux.c:607 interface 'fake' not found"
else
ok "../common/system_linux.c:601 failed to open raw socket"