From: Martin Schwenke Date: Tue, 10 Mar 2020 06:32:52 +0000 (+1100) Subject: ctdb-tests: Split system socket test X-Git-Url: http://git.samba.org/samba.git/?a=commitdiff_plain;h=602694522f5650ebfa78adec8088002ca979af45;p=bbaumbach%2Fsamba-autobuild%2F.git ctdb-tests: Split system socket test One test for each of types, TCP, ARP. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/UNIT/cunit/system_socket_test_001.sh b/ctdb/tests/UNIT/cunit/system_socket_test_001.sh index 4a74b8c64a0..389cec6ac8c 100755 --- a/ctdb/tests/UNIT/cunit/system_socket_test_001.sh +++ b/ctdb/tests/UNIT/cunit/system_socket_test_001.sh @@ -2,128 +2,5 @@ . "${TEST_SCRIPTS_DIR}/unit.sh" -out_file="${CTDB_TEST_TMP_DIR}/packet.out" - -remove_file () -{ - rm -f "$out_file" -} - -test_cleanup remove_file - -d=$(dirname "$out_file") -mkdir -p "$d" - -######################################## - ok_null unit_test system_socket_test types - -arp_run () -{ - $VALGRIND system_socket_test arp "$@" >"$out_file" || exit $? - od -A x -t x1 "$out_file" -} - -arp_test () -{ - os=$(uname) - if [ "$os" = "Linux" ] ; then - unit_test_notrace arp_run "$@" - else - ok "PACKETSOCKET not supported" - unit_test system_socket_test arp "$@" - fi -} - -ok <"$out_file" || exit $? - od -A x -t x1 "$out_file" -} - -tcp_test () -{ - unit_test_notrace tcp_run "$@" -} - -ok <"$out_file" || exit $? + od -A x -t x1 "$out_file" +} + +tcp_test () +{ + unit_test_notrace tcp_run "$@" +} + +ok <"$out_file" || exit $? + od -A x -t x1 "$out_file" +} + +arp_test () +{ + os=$(uname) + if [ "$os" = "Linux" ] ; then + unit_test_notrace arp_run "$@" + else + ok "PACKETSOCKET not supported" + unit_test system_socket_test arp "$@" + fi +} + +ok <