1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/ctdb/tests/cunit/porting_tests_001.sh
Martin Schwenke 198ca88391 ctdb-tests: Update porting test to be more flexible about line numbers
This way the test doesn't need to be changed every time the code is
moved around.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12157

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-08-17 23:00:25 +02:00

27 lines
464 B
Bash
Executable File

#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
socket="${TEST_VAR_DIR}/test_sock.$$"
remove_socket ()
{
rm -f "$socket"
}
test_cleanup remove_socket
result_filter ()
{
sed -e 's|^\(\.\./common/system_linux\.c\):[0-9][0-9]*|\1:LINE|'
}
uid=$(id -u)
if [ "$uid" -eq 0 ] ; then
ok "../common/system_linux.c:LINE interface 'fake' not found"
else
ok "../common/system_linux.c:LINE failed to open raw socket"
fi
unit_test porting_tests --socket=${socket}