diff --git a/test/unit/1.sh b/test/unit/1.sh index 50a1c90f874..b8519032754 100755 --- a/test/unit/1.sh +++ b/test/unit/1.sh @@ -30,7 +30,7 @@ $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG > /dev/null ret=$? sleep 1 -$KILL +kill_kamailio rm -f $CFG diff --git a/test/unit/11.sh b/test/unit/11.sh index 133b68c7f19..c029235f753 100755 --- a/test/unit/11.sh +++ b/test/unit/11.sh @@ -155,7 +155,7 @@ if [ "$ret" -eq 0 ]; then ret=$? fi; -$KILL +kill_kamailio # restart to test preload_udomain functionality $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG -a no> /dev/null @@ -178,6 +178,6 @@ fi; # cleanup $MYSQL "delete from location where username like '49721123456789%';" -$KILL +kill_kamailio exit $ret diff --git a/test/unit/12.sh b/test/unit/12.sh index 918744eb51d..78f808496cc 100755 --- a/test/unit/12.sh +++ b/test/unit/12.sh @@ -84,7 +84,7 @@ if [ "$ret" -eq 0 ] ; then fi ; fi ; cat $TMPFILE -$KILL +kill_kamailio rm $TMPFILE exit $ret diff --git a/test/unit/13.sh b/test/unit/13.sh index bbfec25350e..0d793b6e8c9 100755 --- a/test/unit/13.sh +++ b/test/unit/13.sh @@ -105,7 +105,7 @@ Printing tree for domain 'domain1' (10) fi ; fi ; -$KILL +kill_kamailio # cleanup database $MYSQL "delete from carrier_name where id = 1;" diff --git a/test/unit/14.sh b/test/unit/14.sh index eb9fab261b1..889215c63df 100755 --- a/test/unit/14.sh +++ b/test/unit/14.sh @@ -71,7 +71,7 @@ Printing tree for domain 'other' (3) fi ; fi ; -$KILL +kill_kamailio mv $CFG.bak $CFG rm -f $TMPFILE diff --git a/test/unit/15.sh b/test/unit/15.sh index f5f7033f457..e52f15ddd5c 100755 --- a/test/unit/15.sh +++ b/test/unit/15.sh @@ -37,7 +37,7 @@ $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG -a no > /dev/null ret=$? sleep 1 -$KILL +kill_kamailio rm $CFG diff --git a/test/unit/16.sh b/test/unit/16.sh index 701131498c3..e1e2491dc2a 100755 --- a/test/unit/16.sh +++ b/test/unit/16.sh @@ -40,7 +40,7 @@ $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG > /dev/null ret=$? sleep 1 -$KILL +kill_kamailio rm $CFG diff --git a/test/unit/17.sh b/test/unit/17.sh index 318c18da530..26799d4187a 100755 --- a/test/unit/17.sh +++ b/test/unit/17.sh @@ -58,7 +58,7 @@ if [ "$ret" -eq 0 ] ; then fi ; sleep 1 -$KILL +kill_kamailio # cleanup cd $CTL_DIR diff --git a/test/unit/18.sh b/test/unit/18.sh index 4afaa2fcefb..e29610676ff 100755 --- a/test/unit/18.sh +++ b/test/unit/18.sh @@ -41,7 +41,7 @@ ret=$? sleep 1 # clean up: -$KILL +kill_kamailio rm $CFG rm -f ./pid.out diff --git a/test/unit/19.sh b/test/unit/19.sh index 91143675a42..2cbf18f18e5 100755 --- a/test/unit/19.sh +++ b/test/unit/19.sh @@ -44,7 +44,7 @@ ret=$? # cleanup killall -9 sipp > /dev/null 2>&1 -$KILL > /dev/null 2>&1 +kill_kamailio $MYSQL "DELETE FROM location WHERE ((contact = \"sip:foo@localhost:$UAS\") and (user_agent = \"kamailio_test\"));" exit $ret; diff --git a/test/unit/2.sh b/test/unit/2.sh index b803c5dd2fb..aaa249da5e2 100755 --- a/test/unit/2.sh +++ b/test/unit/2.sh @@ -44,7 +44,7 @@ $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG > /dev/null ret=$? sleep 1 -$KILL +kill_kamailio mv $CFG.bak $CFG rm -f dispatcher.list diff --git a/test/unit/20.sh b/test/unit/20.sh index 17372bb6eac..2e2fec1e69b 100755 --- a/test/unit/20.sh +++ b/test/unit/20.sh @@ -46,7 +46,7 @@ sleep 1 # cleanup killall -9 sipp &> /dev/null -$KILL &> /dev/null +kill_kamailio rm $TMPFILE $MYSQL "DELETE FROM location WHERE ((contact = \"sip:foo@127.0.0.1\") and (user_agent = \"kamailio_test\"));" diff --git a/test/unit/21.sh b/test/unit/21.sh index 0eafdd83f4b..8b6ed16d277 100755 --- a/test/unit/21.sh +++ b/test/unit/21.sh @@ -51,7 +51,7 @@ fi sleep 1 #cleanup -$KILL > /dev/null +kill_kamailio killall -9 sipp > /dev/null 2>&1 $MYSQL "DELETE FROM subscriber WHERE((username = \"alice\") and (domain = \"localhost\"));" diff --git a/test/unit/22.sh b/test/unit/22.sh index 346632136f1..5bd20e68c93 100755 --- a/test/unit/22.sh +++ b/test/unit/22.sh @@ -77,7 +77,7 @@ if [ "$ret" -eq 0 ]; then ret=$? fi; -$KILL +kill_kamailio # restart to test preload_udomain functionality $BIN -w . -f $CFG > /dev/null @@ -97,7 +97,7 @@ if [ "$ret" -eq 0 ]; then ret=$? fi; -$KILL +kill_kamailio $PSQL "delete from location where username like '49721123456789%';" diff --git a/test/unit/23.sh b/test/unit/23.sh index 3a0371959e9..62e50aaa9a2 100755 --- a/test/unit/23.sh +++ b/test/unit/23.sh @@ -87,7 +87,7 @@ Printing tree for domain 'domain1' (10) fi ; fi ; -$KILL +kill_kamailio # cleanup database $PSQL "delete from carrier_name where id = 1; diff --git a/test/unit/25.sh b/test/unit/25.sh index 36841cac483..48ca931c983 100755 --- a/test/unit/25.sh +++ b/test/unit/25.sh @@ -23,9 +23,9 @@ . include/require.sh . include/database.sh -function cleanup() { +cleanup() { killall -9 sipp > /dev/null 2>&1 - $KILL > /dev/null 2>&1 + kill_kamailio $MYSQL "delete from location where (user_agent = \"kamailio_test\");" $MYSQL "delete from userblacklist where username='49721123456786';" diff --git a/test/unit/26.sh b/test/unit/26.sh index 730813935e5..da70f415659 100755 --- a/test/unit/26.sh +++ b/test/unit/26.sh @@ -124,7 +124,7 @@ if [ ! "$ret" -eq 0 ] ; then fi; -$KILL +kill_kamailio killall -9 sipp # cleanup database diff --git a/test/unit/27.sh b/test/unit/27.sh index 97a8ce5c486..8d837b6c5e0 100755 --- a/test/unit/27.sh +++ b/test/unit/27.sh @@ -48,7 +48,7 @@ fi sleep 1 #cleanup: -$KILL >/dev/null +kill_kamailio killall -9 sipp >/dev/null 2>&1 exit $ret diff --git a/test/unit/28.sh b/test/unit/28.sh index 23d08ed11ae..de8f21ee25a 100755 --- a/test/unit/28.sh +++ b/test/unit/28.sh @@ -64,7 +64,7 @@ fi; sleep 1 #cleanup: -$KILL >/dev/null +kill_kamailio killall -9 sipp >/dev/null 2>&1 rm $TMPFILE diff --git a/test/unit/29.sh b/test/unit/29.sh index b12ebfab422..b63d6ae5921 100755 --- a/test/unit/29.sh +++ b/test/unit/29.sh @@ -65,7 +65,7 @@ if [ ! "$ret" -eq 0 ] ; then fi; #cleanup: -$KILL >/dev/null +kill_kamailio killall -9 sipp >/dev/null 2>&1 rm $TMPFILE mv $CFG.tmp $CFG diff --git a/test/unit/30.sh b/test/unit/30.sh index a88519c1aea..dfb0dfeefaf 100755 --- a/test/unit/30.sh +++ b/test/unit/30.sh @@ -62,7 +62,7 @@ if [ "$ret" -eq 0 ] ; then ret=$? fi; -$KILL +kill_kamailio killall -9 sipp mv $CFG.bak $CFG diff --git a/test/unit/31.sh b/test/unit/31.sh index cc15e7a02c3..cccf074f362 100755 --- a/test/unit/31.sh +++ b/test/unit/31.sh @@ -43,7 +43,7 @@ $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG -A FETCHROWS=17 -a no >/de ret=$? sleep 1 -$KILL >/dev/null +kill_kamailio $MYSQL "delete from location where user_agent = '___test___'" diff --git a/test/unit/32.sh b/test/unit/32.sh index 333f8667eb0..6d30899ef38 100755 --- a/test/unit/32.sh +++ b/test/unit/32.sh @@ -50,7 +50,7 @@ $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG > /dev/null ret=$? sleep 1 -$KILL +kill_kamailio $PSQL "delete from location where user_agent = '___test___'" diff --git a/test/unit/33.sh b/test/unit/33.sh index d74de7e71d5..58cc5c3631e 100755 --- a/test/unit/33.sh +++ b/test/unit/33.sh @@ -59,7 +59,7 @@ if [ ! $ret -eq 0 ] ; then fi sleep 1 -$KILL >/dev/null 2>&1 +kill_kamailio ret=$? if [ $ret -eq 0 ] ; then diff --git a/test/unit/34.sh b/test/unit/34.sh index 06a1755b104..8cce1daac75 100755 --- a/test/unit/34.sh +++ b/test/unit/34.sh @@ -47,7 +47,7 @@ $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG > /dev/null ret=$? sleep 1 -$KILL +kill_kamailio mv $CFG.bak $CFG diff --git a/test/unit/35.sh b/test/unit/35.sh index 2bc2c52dd5f..d8d47ba64be 100755 --- a/test/unit/35.sh +++ b/test/unit/35.sh @@ -64,7 +64,7 @@ fi; # cleanup killall -9 sipp > /dev/null 2>&1 -$KILL > /dev/null 2>&1 +kill_kamailio $MYSQL "DELETE FROM location WHERE ((contact = \"sip:foo@localhost:$UAS\") and (user_agent = \"ser_test\"));" $MYSQL "DELETE FROM trusted WHERE (src_ip=\"127.0.0.1\");" diff --git a/test/unit/36.sh b/test/unit/36.sh index 120728c2102..c4da4ed5efd 100755 --- a/test/unit/36.sh +++ b/test/unit/36.sh @@ -72,7 +72,7 @@ if [ $ret -eq 0 ]; then fi; sleep 1 -$KILL +kill_kamailio $MYSQL "delete from location where user_agent = '___test___'" diff --git a/test/unit/37.sh b/test/unit/37.sh index 45c4a7f9112..86cb60cfd10 100755 --- a/test/unit/37.sh +++ b/test/unit/37.sh @@ -76,7 +76,7 @@ if [ $ret -eq 0 ] ; then fi; fi ; -$KILL +kill_kamailio # cleanup database $MYSQL "delete from carrier_name where id = 1;" diff --git a/test/unit/38.sh b/test/unit/38.sh index 408d3843156..aa99a38fdc5 100755 --- a/test/unit/38.sh +++ b/test/unit/38.sh @@ -40,7 +40,7 @@ $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG > /dev/null ret=$? sleep 1 -$KILL +kill_kamailio mv $CFG.bak $CFG rm -f dispatcher.list diff --git a/test/unit/39.sh b/test/unit/39.sh index d98c20941cb..5cb46385275 100755 --- a/test/unit/39.sh +++ b/test/unit/39.sh @@ -53,7 +53,7 @@ $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG > /dev/null ret=$? sleep 2 -$KILL +kill_kamailio printf "delete from location where user_agent = '___test___'" | $ISQL > /dev/null diff --git a/test/unit/4.sh b/test/unit/4.sh index f75349a1281..41e599dc4bd 100755 --- a/test/unit/4.sh +++ b/test/unit/4.sh @@ -44,7 +44,7 @@ if [ "$ret" -eq 0 ] ; then ret=$? fi ; -$KILL +kill_kamailio rm -f $CFG diff --git a/test/unit/40.sh b/test/unit/40.sh index 87d171dfee0..c0f86a081bf 100755 --- a/test/unit/40.sh +++ b/test/unit/40.sh @@ -66,7 +66,7 @@ if [ "$ret" -eq 1 ]; then fi; sleep 1 -$KILL +kill_kamailio killall -9 sipp > /dev/null 2>&1 $MYSQL "DELETE FROM location WHERE ((contact = \"sip:foo@127.0.0.1:$UAS\") and (user_agent = \"ser_test\"));" diff --git a/test/unit/41.sh b/test/unit/41.sh index 5a966d1d965..573e999d847 100755 --- a/test/unit/41.sh +++ b/test/unit/41.sh @@ -54,7 +54,7 @@ if [ "$ret" -eq 0 ]; then fi; sleep 1 -$KILL +kill_kamailio killall -9 sipp > /dev/null 2>&1 $MYSQL "DELETE FROM location WHERE ((contact = \"sip:foo@127.0.0.1:$UAS\") and (user_agent = \"ser_test\"));" diff --git a/test/unit/42.sh b/test/unit/42.sh index 5b0faa08637..e0b5b7bdafc 100755 --- a/test/unit/42.sh +++ b/test/unit/42.sh @@ -122,7 +122,7 @@ if [ ! "$ret" -eq 0 ] ; then fi; -$KILL +kill_kamailio killall -9 sipp # cleanup database diff --git a/test/unit/43.sh b/test/unit/43.sh index a77f7cfd6e2..cc2f3584c9d 100755 --- a/test/unit/43.sh +++ b/test/unit/43.sh @@ -96,6 +96,6 @@ fi; rm $CFG rm $TMPFILE -$KILL +kill_kamailio exit $ret diff --git a/test/unit/44.sh b/test/unit/44.sh index 8ab0fdca7b3..53deed293bd 100755 --- a/test/unit/44.sh +++ b/test/unit/44.sh @@ -80,7 +80,7 @@ if [ "$ret" -eq 0 ]; then ret=$? fi; -$KILL +kill_kamailio # restart to test preload_udomain functionality $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG > /dev/null @@ -100,7 +100,7 @@ if [ "$ret" -eq 0 ]; then ret=$? fi; -$KILL +kill_kamailio echo "delete from location where username like '49721123456789%';" | $ISQL diff --git a/test/unit/45.sh b/test/unit/45.sh index db05ad86147..5a3ec18589f 100755 --- a/test/unit/45.sh +++ b/test/unit/45.sh @@ -45,7 +45,7 @@ ret=$? # cleanup killall -9 sipp > /dev/null 2>&1 -$KILL > /dev/null 2>&1 +kill_kamailio $MYSQL "DELETE FROM location WHERE ((contact = \"sip:foo@127.0.0.1:$UAS\") and (user_agent = \"ser_test\"));" exit $ret; diff --git a/test/unit/46.sh b/test/unit/46.sh index a2e1ea5ee24..d9548d8141f 100755 --- a/test/unit/46.sh +++ b/test/unit/46.sh @@ -32,7 +32,7 @@ SRV=5060 UAS=5070 UAC=5080 -function test_module_int() +test_module_int() { if [ x$# != x3 ] ; then echo "wrong number of params : usage test_module module cfg_param value" @@ -87,7 +87,7 @@ ret=$? # cleanup killall -9 sipp > /dev/null 2>&1 -$KILL > /dev/null 2>&1 +kill_kamailio mv ${CFG}.bak $CFG diff --git a/test/unit/5.sh b/test/unit/5.sh index d7d1c6255cb..cb447387ff8 100755 --- a/test/unit/5.sh +++ b/test/unit/5.sh @@ -36,6 +36,6 @@ $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG -A WITH_SRCPATH -a no > /d ret=$? sleep 1 -$KILL +kill_kamailio exit $ret diff --git a/test/unit/50.sh b/test/unit/50.sh index 14571c327f9..5a1ba6c52c1 100755 --- a/test/unit/50.sh +++ b/test/unit/50.sh @@ -155,7 +155,7 @@ $MYSQL_LOC_A "delete from location where username like '497211234567%';" $MYSQL_LOC_B "delete from location where username like '497211234567%';" -$KILL +kill_kamailio mv $CFG.bak $CFG diff --git a/test/unit/7.sh b/test/unit/7.sh index 33f419f13d8..09db6e50703 100755 --- a/test/unit/7.sh +++ b/test/unit/7.sh @@ -37,6 +37,6 @@ $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -a no -w . -f $CFG > /dev/null ret=$? sleep 1 -$KILL +kill_kamailio exit $ret diff --git a/test/unit/include/common b/test/unit/include/common index 1868ef76347..2e2141ee1b6 100644 --- a/test/unit/include/common +++ b/test/unit/include/common @@ -21,7 +21,6 @@ else echo "WARNING Binary not found!" fi fi -KILL="killall -15 $BNAME" PIDFILE="${RUN_DIR}/kamailio.pid" # test directory relative to root TEST_DIR="test/unit"