ctdb-tests: Update porting test to be more flexible about line numbers
authorMartin Schwenke <martin@meltin.net>
Wed, 10 Aug 2016 07:02:22 +0000 (17:02 +1000)
committerMartin Schwenke <martins@samba.org>
Wed, 17 Aug 2016 21:00:25 +0000 (23:00 +0200)
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>
ctdb/tests/cunit/porting_tests_001.sh

index 2b030079da4164028b65823b2585b0f92176bb74..98a8af2d7f41d40d17b28b4bf1da843e980180f8 100755 (executable)
@@ -11,11 +11,16 @@ remove_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:607 interface 'fake' not found"
+    ok "../common/system_linux.c:LINE interface 'fake' not found"
 else
-    ok "../common/system_linux.c:601 failed to open raw socket"
+    ok "../common/system_linux.c:LINE failed to open raw socket"
 fi
 
 unit_test porting_tests --socket=${socket}