BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
test_cleanup remove_socket
-uid=$(id -u)
-if [ "$uid" -eq 0 ] ; then
- ok "ctdb_sys_check_iface_exists: Interface 'fake' not found"
+os=$(uname)
+if [ "$os" = "Linux" ] ; then
+ uid=$(id -u)
+ if [ "$uid" -eq 0 ] ; then
+ ok "ctdb_sys_check_iface_exists: Interface 'fake' not found"
+ else
+ ok "ctdb_sys_check_iface_exists: Failed to open raw socket"
+ fi
else
- ok "ctdb_sys_check_iface_exists: Failed to open raw socket"
+ ok_null
fi
unit_test porting_tests --socket=${socket}
fd = socket_server_wait_peer();
ret = ctdb_get_peer_pid(fd, &peer_pid);
- assert(ret == 0);
+ assert(ret == 0 || ret == ENOSYS);
- assert(peer_pid == globals.helper_pid);
+ if (ret == 0) {
+ assert(peer_pid == globals.helper_pid);
- kill(peer_pid, SIGTERM);
+ kill(peer_pid, SIGTERM);
+ } else {
+ kill(globals.helper_pid, SIGTERM);
+ }
close(fd);
return 0;