Browse Source

- fix tests after renaming (mostly database related)
- introduce parameter for rc file and control tools


git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4633 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt 17 years ago
parent
commit
fc42fdd5a4

+ 11 - 9
test/unit/10.sh

@@ -19,31 +19,33 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
+
 cd ../scripts
 
 # setup config file
-cp kamailioctlrc kamailioctlrc.bak
-cp kamailioctl kamailioctl.bak
-sed -i "s/# DBENGINE=MYSQL/DBENGINE=DBTEXT/g" kamailioctlrc
-sed -i "s/TEST=\"false\"/TEST=\"true\"/g" kamailioctl
+cp $CTLRC $CTLRC.bak
+cp $CTL $CTL.bak
+sed -i "s/# DBENGINE=MYSQL/DBENGINE=DBTEXT/g" $CTLRC
+sed -i "s/TEST=\"false\"/TEST=\"true\"/g" $CTL
 
-./kamailioctl avp list > /dev/null
+./$CTL avp list > /dev/null
 
 ret=$?
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl domain showdb > /dev/null
+	./$CTL domain showdb > /dev/null
 	ret=$?
 fi ;
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl lcr show > /dev/null
+	./$CTL lcr show > /dev/null
 	ret=$?
 fi ;
 
 # cleanup
-mv kamailioctlrc.bak kamailioctlrc
-mv kamailioctl.bak kamailioctl
+mv $CTLRC.bak $CTLRC
+mv $CTL.bak $CTL
 
 cd ../test
 exit $ret

+ 5 - 4
test/unit/11.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 source include/database
 
@@ -43,11 +44,11 @@ cat register.sip | nc -q 1 -u localhost 5060 > /dev/null
 cd ../scripts
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl ul show | grep "AOR:: 1000" > /dev/null
+	./$CTL ul show | grep "AOR:: 1000" > /dev/null
 	ret=$?
 fi ;
 
-TMP=`mysql -B -u kamailioro --password=kamailioro kamailio -e "select COUNT(*) from location where username="1000";" | tail -n 1`
+TMP=`mysql -B -u openserro --password=openserro openser -e "select COUNT(*) from location where username="1000";" | tail -n 1`
 if [ "$TMP" -eq 0 ] ; then
 	ret=1
 fi ;
@@ -56,7 +57,7 @@ fi ;
 cat ../test/unregister.sip | nc -q 1 -u localhost 5060 > /dev/null
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl ul show | grep "AOR:: 1000" > /dev/null
+	./$CTL ul show | grep "AOR:: 1000" > /dev/null
 	ret=$?
 	if [ "$ret" -eq 0 ] ; then
 		ret=1
@@ -65,7 +66,7 @@ if [ "$ret" -eq 0 ] ; then
 	fi ;
 fi ;
 
-ret=`mysql -B -u kamailioro --password=kamailioro kamailio -e "select COUNT(*) from location where username="1000";" | tail -n 1`
+ret=`mysql -B -u openserro --password=openserro openser -e "select COUNT(*) from location where username="1000";" | tail -n 1`
 
 cd ../test
 

+ 3 - 2
test/unit/12.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 
 CFG=12.cfg
@@ -39,7 +40,7 @@ cat register.sip | nc -q 1 -u localhost 5060 > /dev/null
 cd ../scripts
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl ul show | grep "AOR:: 1000" > /dev/null
+	./$CTL ul show | grep "AOR:: 1000" > /dev/null
 	ret=$?
 fi ;
 
@@ -47,7 +48,7 @@ fi ;
 cat ../test/unregister.sip | nc -q 1 -u localhost 5060 > /dev/null
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl ul show | grep "AOR:: 1000" > /dev/null
+	./$CTL ul show | grep "AOR:: 1000" > /dev/null
 	ret=$?
 	if [ "$ret" -eq 0 ] ; then
 		ret=1

+ 2 - 1
test/unit/13.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 source include/database
 
@@ -71,7 +72,7 @@ cd ../scripts
 TMPFILE=`mktemp -t kamailio-test.XXXXXXXXXX`
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl fifo cr_dump_routes > $TMPFILE
+	./$CTL fifo cr_dump_routes > $TMPFILE
 	ret=$?
 fi ;
 

+ 1 - 0
test/unit/14.cfg

@@ -36,3 +36,4 @@ route{
 		return;
 	}
 }
+modparam("carrierroute", "config_file", "/home/henning/projects/openser/trunk/test/../test/carrierroute.cfg")

+ 2 - 1
test/unit/14.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 
 CFG=14.cfg
@@ -42,7 +43,7 @@ cd ../scripts
 TMPFILE=`mktemp -t kamailio-test.XXXXXXXXXX`
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl fifo cr_dump_routes > $TMPFILE
+	./$CTL fifo cr_dump_routes > $TMPFILE
 	ret=$?
 fi ;
 

+ 1 - 1
test/unit/16.sh

@@ -32,7 +32,7 @@ CFG=2.cfg
 cp $CFG $CFG.bak
 
 echo "loadmodule \"db_postgres/db_postgres.so\"" >> $CFG
-echo "modparam(\"$DB_ALL_MOD\", \"db_url\", \"postgres://kamailioro:kamailioro@localhost/kamailio\")" >> $CFG
+echo "modparam(\"$DB_ALL_MOD\", \"db_url\", \"postgres://openserro:openserro@localhost/openser\")" >> $CFG
 
 # start
 ../kamailio -w . -f $CFG > /dev/null

+ 10 - 10
test/unit/17.sh

@@ -37,15 +37,15 @@ echo "modparam(\"$DB_ALL_MOD\", \"db_url\", \"berkeley://`pwd`/../scripts/$tmp_n
 cd ../scripts
 
 # setup config file
-cp kamailioctlrc kamailioctlrc.bak
-sed -i "s/# DBENGINE=MYSQL/DBENGINE=DB_BERKELEY/g" kamailioctlrc
-sed -i "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" kamailioctlrc
-sed -i "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" kamailioctlrc
+cp $CTLRC $CTLRC.bak
+sed -i "s/# DBENGINE=MYSQL/DBENGINE=DB_BERKELEY/g" $CTLRC
+sed -i "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" $CTLRC
+sed -i "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" $CTLRC
 
-cp kamailiodbctl kamailiodbctl.bak
-sed -i "s/TEST=\"false\"/TEST=\"true\"/g" kamailiodbctl
+cp $DBCTL $DBCTL.bak
+sed -i "s/TEST=\"false\"/TEST=\"true\"/g" $DBCTL
 
-./kamailiodbctl create $tmp_name > /dev/null
+./$DBCTL create $tmp_name > /dev/null
 ret=$?
 
 if [ "$ret" -eq 0 ] ; then
@@ -57,9 +57,9 @@ sleep 1
 killall -9 kamailio
 
 # cleanup
-./kamailiodbctl drop $tmp_name > /dev/null
-mv kamailioctlrc.bak kamailioctlrc
-mv kamailiodbctl.bak kamailiodbctl
+./$DBCTL drop $tmp_name > /dev/null
+mv $CTLRC.bak $CTLRC
+mv $DBCTL.bak $DBCTL
 
 cd ../test/
 rm $CFG

+ 1 - 1
test/unit/19.cfg

@@ -24,7 +24,7 @@ loadmodule "mi_fifo/mi_fifo.so"
 #-----------------------Module parameters-------------------------------------
 modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
 modparam("usrloc", "db_mode", 3)
-modparam("usrloc", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("usrloc", "db_url", "mysql://openser:openserrw@localhost/openser")
 
 #-----------------------Routing configuration---------------------------------#
 route{

+ 1 - 1
test/unit/20.cfg

@@ -26,7 +26,7 @@ loadmodule "xlog/xlog.so"
 #-----------------------Module parameters-------------------------------------
 modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
 modparam("usrloc", "db_mode", 3)
-modparam("usrloc", "db_url", "mysql://kamailio:kamaili[email protected]/kamailio")
+modparam("usrloc", "db_url", "mysql://openser:openser[email protected]/openser")
 modparam("acc", "log_flag", 1)
 modparam("db_mysql", "timeout_interval", 2)
 

+ 1 - 1
test/unit/21.cfg

@@ -44,7 +44,7 @@ loadmodule "xlog/xlog.so"
 # Uncomment this if you want to use SQL database 
 # for persistent storage and comment the previous line
 modparam("usrloc", "db_mode", 3)
-modparam("usrloc", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("usrloc", "db_url", "mysql://openser:openserrw@localhost/openser")
 
 # -- auth params --
 # Uncomment if you are using auth module

+ 6 - 5
test/unit/22.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 
 if ! (check_netcat && check_kamailio && check_module "db_postgres"); then
@@ -29,7 +30,7 @@ CFG=11.cfg
 
 cp $CFG $CFG.tmp
 echo "loadmodule \"db_postgres/db_postgres.so\"" >> $CFG
-echo "modparam(\"usrloc\", \"db_url\", \"postgres://kamailio:kamailiorw@localhost/kamailio\")" >> $CFG
+echo "modparam(\"usrloc\", \"db_url\", \"postgres://openser:openserrw@localhost/openser\")" >> $CFG
 
 ../kamailio -w . -f $CFG > /dev/null
 ret=$?
@@ -41,11 +42,11 @@ cat register.sip | nc -q 1 -u localhost 5060 > /dev/null
 cd ../scripts
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl ul show | grep "AOR:: 1000" > /dev/null
+	./$CTL ul show | grep "AOR:: 1000" > /dev/null
 	ret=$?
 fi ;
 
-TMP=`PGPASSWORD='kamailioro' psql -A -t -n -q -h localhost -U kamailioro kamailio -c "select COUNT(*) from location where username='1000';" | tail -n 1`
+TMP=`PGPASSWORD='openserro' psql -A -t -n -q -h localhost -U openserro openser -c "select COUNT(*) from location where username='1000';" | tail -n 1`
 if [ "$TMP" -eq 0 ] ; then
 	ret=1
 fi ;
@@ -54,7 +55,7 @@ fi ;
 cat ../test/unregister.sip | nc -q 1 -u localhost 5060 > /dev/null
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl ul show | grep "AOR:: 1000" > /dev/null
+	./$CTL ul show | grep "AOR:: 1000" > /dev/null
 	ret=$?
 	if [ "$ret" -eq 0 ] ; then
 		ret=1
@@ -63,7 +64,7 @@ if [ "$ret" -eq 0 ] ; then
 	fi ;
 fi ;
 
-ret=`PGPASSWORD='kamailioro' psql -A -t -n -q -h localhost -U kamailioro kamailio -c "select COUNT(*) from location where username='1000';" | tail -n 1`
+ret=`PGPASSWORD='openserro' psql -A -t -n -q -h localhost -U openserro openser -c "select COUNT(*) from location where username='1000';" | tail -n 1`
 
 killall -9 kamailio
 

+ 5 - 4
test/unit/23.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 
 if ! (check_kamailio && check_module "carrierroute" && check_module "db_postgres"); then
@@ -32,10 +33,10 @@ cp $CFG $CFG.bak
 # setup config
 echo "loadmodule \"db_postgres/db_postgres.so\"" >> $CFG
 echo "modparam(\"carrierroute\", \"config_source\", \"db\")" >> $CFG
-echo "modparam(\"carrierroute\", \"db_url\", \"postgres://kamailioro:kamailioro@localhost/kamailio\")" >> $CFG
+echo "modparam(\"carrierroute\", \"db_url\", \"postgres://openserro:openserro@localhost/openser\")" >> $CFG
 
 # setup database
-PGPASSWORD='kamailiorw' psql -A -t -n -q -h localhost -U kamailio kamailio -c "insert into route_tree (id, carrier) values ('1', 'carrier1');
+PGPASSWORD='openserrw' psql -A -t -n -q -h localhost -U openser openser -c "insert into route_tree (id, carrier) values ('1', 'carrier1');
 insert into route_tree (id, carrier) values ('2', 'default');
 insert into route_tree (id, carrier) values ('3', 'premium');
 insert into carrierroute (id, carrier, scan_prefix, domain, prob, strip, rewrite_host) values ('1','1','49','0','0.5','0','host1.local.domain');
@@ -58,7 +59,7 @@ cd ../scripts
 TMPFILE=`mktemp -t kamailio-test.XXXXXXXXXX`
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl fifo cr_dump_routes > $TMPFILE
+	./$CTL fifo cr_dump_routes > $TMPFILE
 	ret=$?
 fi ;
 
@@ -89,7 +90,7 @@ fi ;
 killall -9 kamailio
 
 # cleanup database
-PGPASSWORD='kamailiorw' psql -A -t -n -q -h localhost -U kamailio kamailio -c "delete from route_tree where id = 1;
+PGPASSWORD='openserrw' psql -A -t -n -q -h localhost -U openser openser -c "delete from route_tree where id = 1;
 delete from route_tree where id = 2;
 delete from route_tree where id = 3;
 delete from carrierroute where carrier=1;

+ 12 - 10
test/unit/24.sh

@@ -22,6 +22,8 @@
 # Needs a mysql database, the root user password must be given
 # in the file 'dbrootpw' in the test directory
 
+source include/common
+
 if [ ! -f ~/.pgpass ] ; then
        echo "no .pgpass file, not run"
        exit 0
@@ -32,25 +34,25 @@ tmp_name=""$RANDOM"_kamailiodb_tmp"
 cd ../scripts
 
 # setup config file
-cp kamailioctlrc kamailioctlrc.bak
-sed -i "s/# DBENGINE=MYSQL/DBENGINE=PGSQL/g" kamailioctlrc
-sed -i "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" kamailioctlrc
-sed -i "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" kamailioctlrc
+cp $CTLRC $CTLRC.bak
+sed -i "s/# DBENGINE=MYSQL/DBENGINE=PGSQL/g" $CTLRC
+sed -i "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" $CTLRC
+sed -i "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" $CTLRC
 
-cp kamailiodbctl kamailiodbctl.bak
-sed -i "s/TEST=\"false\"/TEST=\"true\"/g" kamailiodbctl
+cp $DBCTL $DBCTL.bak
+sed -i "s/TEST=\"false\"/TEST=\"true\"/g" $DBCTL
 
-./kamailiodbctl create $tmp_name &> /dev/null
+./$DBCTL create $tmp_name &> /dev/null
 ret=$?
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailiodbctl drop $tmp_name &> /dev/null
+	./$DBCTL drop $tmp_name &> /dev/null
 	ret=$?
 fi ;
 
 # cleanup
-mv kamailioctlrc.bak kamailioctlrc
-mv kamailiodbctl.bak kamailiodbctl
+mv $CTLRC.bak $CTLRC
+mv $DBCTL.bak $DBCTL
 
 cd ../test
 exit $ret

+ 3 - 2
test/unit/25.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 source include/database
 
@@ -80,7 +81,7 @@ if [ "$ret" -eq 1 ] ; then
 fi;
 
 $MYSQL "insert into globalblacklist (prefix, whitelist, description) values ('123456786','1','_test_');"
-../scripts/kamailioctl fifo reload_blacklist
+../scripts/$CTL fifo reload_blacklist
 
 if [ "$ret" -eq 1 ] ; then
 	sipp -sn uac -s 49721123456786 127.0.0.1:5059 -i 127.0.0.1 -m 1 -f 2 -p 5061 &> /dev/null
@@ -100,7 +101,7 @@ if [ "$ret" -eq 1 ] ; then
 fi;
 
 $MYSQL "insert into globalblacklist (prefix, whitelist, description) values ('2','1','_test_');"
-../scripts/kamailioctl fifo reload_blacklist
+../scripts/$CTL fifo reload_blacklist
 
 if [ "$ret" -eq 1 ] ; then
 	sipp -sn uac -s 49721123456785 127.0.0.1:5059 -i 127.0.0.1 -m 1 -f 2 -p 5061 &> /dev/null

+ 2 - 1
test/unit/26.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 source include/database
 
@@ -108,7 +109,7 @@ $MYSQL "insert into carrierfailureroute(id, carrier, domain, scan_prefix, host_n
 flags, mask, next_domain) values ('5', '3', 'fallback', '49', '127.0.0.1:10000', '486', '0', '0', '2');"
 
 if [ ! "$ret" -eq 0 ] ; then
-	../scripts/kamailioctl fifo cr_reload_routes
+	../scripts/$CTL fifo cr_reload_routes
 	killall sipp &> /dev/null
 	sipp -sf failure_route.xml -bg -i localhost -m 10 -p 10000 &> /dev/null
 	sipp -sn uac -s 49721123456785 127.0.0.1:5060 -i 127.0.0.1 -m 10 -p 5061 &> /dev/null

+ 5 - 4
test/unit/28.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 source include/database
 
@@ -35,7 +36,7 @@ TMPFILE=`mktemp -t kamailio-test.XXXXXXXXXX`
 ret=$?
 sleep 1
 
-../scripts/kamailioctl fifo LOAD_CPL sip:[email protected] $CPL
+../scripts/$CTL fifo LOAD_CPL sip:[email protected] $CPL
 
 if [ "$ret" -eq 0 ] ; then
 	sipp -m 1 -f 1 127.0.0.1:5060 -sf cpl_test.xml &> /dev/null;
@@ -43,14 +44,14 @@ if [ "$ret" -eq 0 ] ; then
 fi;
 
 if [ "$ret" -eq 0 ] ; then
-  ../scripts/kamailioctl fifo GET_CPL sip:[email protected] > $TMPFILE 
+  ../scripts/$CTL fifo GET_CPL sip:[email protected] > $TMPFILE 
   diff $TMPFILE $CPL 
   ret=$?
 fi; 
 
 if [ "$ret" -eq 0 ] ; then
-  ../scripts/kamailioctl fifo REMOVE_CPL sip:[email protected]
-  ../scripts/kamailioctl fifo GET_CPL sip:[email protected] > $TMPFILE
+  ../scripts/$CTL fifo REMOVE_CPL sip:[email protected]
+  ../scripts/$CTL fifo GET_CPL sip:[email protected] > $TMPFILE
 fi;
 
 diff $TMPFILE $CPL &> /dev/null;

+ 6 - 5
test/unit/29.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 
 if ! (check_sipp && check_kamailio && check_module "db_postgres" && check_module "cpl-c"); then
@@ -31,14 +32,14 @@ TMPFILE=`mktemp -t kamailio-test.XXXXXXXXXX`
 
 cp $CFG $CFG.tmp
 echo "loadmodule \"db_postgres/db_postgres.so\"" >> $CFG
-echo "modparam(\"cpl-c\", \"db_url\", \"postgres://kamailio:kamailiorw@localhost/kamailio\")" >> $CFG
+echo "modparam(\"cpl-c\", \"db_url\", \"postgres://openser:openserrw@localhost/openser\")" >> $CFG
 
 
 ../kamailio -w . -f $CFG &> /dev/null;
 ret=$?
 sleep 1
 
-../scripts/kamailioctl fifo LOAD_CPL sip:[email protected] $CPL
+../scripts/$CTL fifo LOAD_CPL sip:[email protected] $CPL
 
 if [ "$ret" -eq 0 ] ; then
 	sipp -m 1 -f 1 127.0.0.1:5060 -sf cpl_test.xml &> /dev/null;
@@ -46,14 +47,14 @@ if [ "$ret" -eq 0 ] ; then
 fi;
 
 if [ "$ret" -eq 0 ] ; then
-  ../scripts/kamailioctl fifo GET_CPL sip:[email protected] > $TMPFILE 
+  ../scripts/$CTL fifo GET_CPL sip:[email protected] > $TMPFILE 
   diff $TMPFILE $CPL 
   ret=$?
 fi; 
 
 if [ "$ret" -eq 0 ] ; then
-  ../scripts/kamailioctl fifo REMOVE_CPL sip:[email protected]
-  ../scripts/kamailioctl fifo GET_CPL sip:[email protected] > $TMPFILE
+  ../scripts/$CTL fifo REMOVE_CPL sip:[email protected]
+  ../scripts/$CTL fifo GET_CPL sip:[email protected] > $TMPFILE
 fi;
 
 diff $TMPFILE $CPL &> /dev/null;

+ 15 - 13
test/unit/3.sh

@@ -22,6 +22,8 @@
 # Needs a mysql database, the root user password must be given
 # in the file 'dbrootpw' in the test directory
 
+source include/common
+
 if [ ! -f dbrootpw ] ; then
 	echo "no root password, not run"
 	exit 0
@@ -34,30 +36,30 @@ tmp_name=""$RANDOM"_kamailiodb_tmp"
 cd ../scripts
 
 # setup config file
-cp kamailioctlrc kamailioctlrc.bak
-sed -i "s/# DBENGINE=MYSQL/DBENGINE=MYSQL/g" kamailioctlrc
-sed -i "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" kamailioctlrc
-sed -i "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" kamailioctlrc
+cp $CTLRC $CTLRC.bak
+sed -i "s/# DBENGINE=MYSQL/DBENGINE=MYSQL/g" $CTLRC
+sed -i "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" $CTLRC
+sed -i "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" $CTLRC
 
-cp kamailiodbctl kamailiodbctl.bak
-sed -i "s/TEST=\"false\"/TEST=\"true\"/g" kamailiodbctl
+cp $DBCTL $DBCTL.bak
+sed -i "s/TEST=\"false\"/TEST=\"true\"/g" $DBCTL
 
 # set the mysql root password
-cp kamailiodbctl.mysql kamailiodbctl.mysql.bak
-sed -i "s/#PW=""/PW="$PW"/g" kamailiodbctl.mysql
+cp $DBCTL.mysql $DBCTL.mysql.bak
+sed -i "s/#PW=""/PW="$PW"/g" $DBCTL.mysql
 
-./kamailiodbctl create $tmp_name > /dev/null
+./$DBCTL create $tmp_name > /dev/null
 ret=$?
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailiodbctl drop $tmp_name > /dev/null
+	./$DBCTL drop $tmp_name > /dev/null
 	ret=$?
 fi ;
 
 # cleanup
-mv kamailioctlrc.bak kamailioctlrc
-mv kamailiodbctl.mysql.bak kamailiodbctl.mysql
-mv kamailiodbctl.bak kamailiodbctl
+mv $CTLRC.bak $CTLRC
+mv $DBCTL.mysql.bak $DBCTL.mysql
+mv $DBCTL.bak $DBCTL
 
 cd ../test
 exit $ret

+ 3 - 3
test/unit/32.sh

@@ -30,7 +30,7 @@ CFG=11.cfg
 cp $CFG $CFG.bak
 
 echo "loadmodule \"db_postgres/db_postgres.so\"" >> $CFG
-echo "modparam(\"usrloc\", \"db_url\", \"postgres://kamailio:kamailiorw@localhost/kamailio\")" >> $CFG
+echo "modparam(\"usrloc\", \"db_url\", \"postgres://openser:openserrw@localhost/openser\")" >> $CFG
 echo "modparam(\"usrloc\", \"fetch_rows\", 13)" >> $CFG
 
 DOMAIN="local"
@@ -38,7 +38,7 @@ DOMAIN="local"
 COUNTER=0
 while [  $COUNTER -lt 139 ]; do
 	COUNTER=$(($COUNTER+1))
-	PGPASSWORD='kamailiorw' psql -A -t -n -q -h localhost -U kamailio kamailio -c "insert into location (username, domain, contact, user_agent) values ('foobar-$COUNTER', '$DOMAIN', 'foobar-$COUNTER@$DOMAIN', '___test___');"
+	PGPASSWORD='openserrw' psql -A -t -n -q -h localhost -U openser openser -c "insert into location (username, domain, contact, user_agent) values ('foobar-$COUNTER', '$DOMAIN', 'foobar-$COUNTER@$DOMAIN', '___test___');"
 done
 
 ../kamailio -w . -f $CFG > /dev/null
@@ -47,7 +47,7 @@ ret=$?
 sleep 1
 killall -9 kamailio
 
-PGPASSWORD='kamailiorw' psql -A -t -n -q -h localhost -U kamailio kamailio -c "delete from location where user_agent = '___test___'"
+PGPASSWORD='openserrw' psql -A -t -n -q -h localhost -U openser openser -c "delete from location where user_agent = '___test___'"
 
 mv $CFG.bak $CFG
 

+ 3 - 2
test/unit/33.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 
 if ! (check_netcat && check_kamailio); then
@@ -40,13 +41,13 @@ ret=$?
 sleep 1
 
 if [ $ret -eq 0 ] ; then
-	../scripts/kamailioctl fifo check_config_hash |grep "The actual config file hash is identical to the stored one." > /dev/null
+	../scripts/$CTL fifo check_config_hash |grep "The actual config file hash is identical to the stored one." > /dev/null
 	ret=$?
 fi;
 
 echo " " >> $CFG
 if [ $ret -eq 0 ] ; then
-	../scripts/kamailioctl fifo check_config_hash |grep "The actual config file hash is identical to the stored one." /dev/null
+	../scripts/$CTL fifo check_config_hash |grep "The actual config file hash is identical to the stored one." /dev/null
 	ret=$?
 fi;
 

+ 1 - 1
test/unit/35.cfg

@@ -25,7 +25,7 @@ loadmodule "xlog/xlog.so"
 #-----------------------Module parameters-------------------------------------
 modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
 modparam("usrloc", "db_mode", 3)
-modparam("usrloc|permissions", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("usrloc|permissions", "db_url", "mysql://openser:openserrw@localhost/openser")
 
 #-----------------------Routing configuration---------------------------------#
 route{

+ 3 - 2
test/unit/35.sh

@@ -19,6 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
 source include/require
 source include/database
 
@@ -51,8 +52,8 @@ if [ "$ret" -eq 0 ] ; then
 	MASK=10
 	$MYSQL "INSERT INTO address (ip_addr, mask) VALUES ('$IP', '$MASK');"
 	
-	../scripts/kamailioctl fifo address_reload
-	#../scripts/kamailioctl fifo address_dump
+	../scripts/$CTL fifo address_reload
+	#../scripts/$CTL fifo address_dump
 
 	sipp -sn uas -bg -i localhost -m 10 -f 2 -p $UAS &> /dev/null
 	sipp -sn uac -s foo 127.0.0.1:$SRV -i localhost -m 10 -f 2 -p $UAC &> /dev/null

+ 3 - 1
test/unit/4.sh

@@ -19,6 +19,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
+
 CFG=4.cfg
 
 # setup config
@@ -32,7 +34,7 @@ cd ../scripts
 
 if [ "$ret" -eq 0 ] ; then
 	sleep 1
-	./kamailioctl ps > /dev/null
+	./$CTL ps > /dev/null
 	ret=$?
 fi ;
 

+ 9 - 9
test/unit/7.cfg

@@ -139,7 +139,7 @@ modparam("usrloc", "socket_column", "socket")
 modparam("usrloc", "use_domain", 0)
 modparam("usrloc", "desc_time_order", 0)
 modparam("usrloc", "timer_interval", 60)
-modparam("usrloc", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("usrloc", "db_url", "mysql://openser:openserrw@localhost/openser")
 modparam("usrloc", "db_mode", 1)
 modparam("usrloc", "matching_mode", 0)
 modparam("usrloc", "cseq_delay", 20)
@@ -176,7 +176,7 @@ modparam("mi_fifo", "reply_dir", "/tmp/")
 modparam("mi_fifo", "reply_indent", "\t")
 
 loadmodule "domain/domain.so"
-modparam("domain", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("domain", "db_url", "mysql://openser:openserrw@localhost/openser")
 modparam("domain", "db_mode", 1)
 modparam("domain", "domain_table", "domain")
 modparam("domain", "domain_col", "domain")
@@ -226,7 +226,7 @@ modparam("auth", "rpid_suffix", ";party=calling;id-type=subscriber;screen=yes")
 modparam("auth", "rpid_avp", "$avp(s:rpid)")
 
 loadmodule "auth_db/auth_db.so"
-modparam("auth_db", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("auth_db", "db_url", "mysql://openser:openserrw@localhost/openser")
 modparam("auth_db", "user_column", "username")
 modparam("auth_db", "domain_column", "domain")
 modparam("auth_db", "password_column", "password")
@@ -236,13 +236,13 @@ modparam("auth_db", "use_domain", 0)
 modparam("auth_db", "load_credentials", "$avp(s:caller_uuid)=uuid")
 
 loadmodule "uri_db/uri_db.so"
-modparam("uri_db", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("uri_db", "db_url", "mysql://openser:openserrw@localhost/openser")
 modparam("uri_db", "db_table", "subscriber")
 modparam("uri_db", "use_uri_table", 0)
 modparam("uri_db", "use_domain", 0)
 
 loadmodule "avpops/avpops.so"
-modparam("avpops", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("avpops", "db_url", "mysql://openser:openserrw@localhost/openser")
 modparam("avpops", "avp_table", "usr_preferences")
 modparam("avpops", "use_domain", 0)
 modparam("avpops", "uuid_column", "uuid")
@@ -261,7 +261,7 @@ modparam("permissions", "default_deny_file", "permissions.deny")
 modparam("permissions", "check_all_branches", 1)
 modparam("permissions", "allow_suffix", ".allow")
 modparam("permissions", "deny_suffix", ".deny")
-modparam("permissions", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("permissions", "db_url", "mysql://openser:openserrw@localhost/openser")
 modparam("permissions", "db_mode", 1)
 modparam("permissions", "trusted_table", "trusted")
 modparam("permissions", "source_col", "src_ip")
@@ -271,7 +271,7 @@ modparam("permissions", "tag_col", "tag")
 modparam("permissions", "peer_tag_avp", "$avp(s:peer_uuid)")
 
 loadmodule "lcr/lcr.so"
-modparam("lcr", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("lcr", "db_url", "mysql://openser:openserrw@localhost/openser")
 modparam("lcr", "gw_table", "gw")
 modparam("lcr", "gw_name_column", "gw_name")
 modparam("lcr", "ip_addr_column", "ip_addr")
@@ -299,7 +299,7 @@ modparam("uac_redirect", "acc_function", "acc_log_request")
 modparam("uac_redirect", "acc_db_table", "acc")
 
 loadmodule "alias_db/alias_db.so"
-modparam("alias_db", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("alias_db", "db_url", "mysql://openser:openserrw@localhost/openser")
 modparam("alias_db", "user_column", "username")
 modparam("alias_db", "domain_column", "domain")
 modparam("alias_db", "alias_user_column", "alias_username")
@@ -323,7 +323,7 @@ modparam("acc", "db_flag", 25)
 modparam("acc", "db_missed_flag", 0)
 modparam("acc", "db_table_acc", "acc")
 modparam("acc", "db_table_missed_calls", "missed_calls")
-modparam("acc", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("acc", "db_url", "mysql://openser:openserrw@localhost/openser")
 modparam("acc", "acc_method_column", "method")
 modparam("acc", "acc_callid_column", "callid")
 modparam("acc", "acc_time_column", "time")

+ 12 - 10
test/unit/8.sh

@@ -19,30 +19,32 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
+
 tmp_name=""$RANDOM"_kamailiodb_tmp"
 
 cd ../scripts
 
 # setup config file
-cp kamailioctlrc kamailioctlrc.bak
-sed -i "s/# DBENGINE=MYSQL/DBENGINE=DBTEXT/g" kamailioctlrc
-sed -i "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" kamailioctlrc
-sed -i "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" kamailioctlrc
+cp $CTLRC $CTLRC.bak
+sed -i "s/# DBENGINE=MYSQL/DBENGINE=DBTEXT/g" $CTLRC
+sed -i "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" $CTLRC
+sed -i "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" $CTLRC
 
-cp kamailiodbctl kamailiodbctl.bak
-sed -i "s/TEST=\"false\"/TEST=\"true\"/g" kamailiodbctl
+cp $DBCTL $DBCTL.bak
+sed -i "s/TEST=\"false\"/TEST=\"true\"/g" $DBCTL
 
-./kamailiodbctl create $tmp_name > /dev/null
+./$DBCTL create $tmp_name > /dev/null
 ret=$?
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailiodbctl drop $tmp_name > /dev/null
+	./$DBCTL drop $tmp_name > /dev/null
 	ret=$?
 fi ;
 
 # cleanup
-mv kamailioctlrc.bak kamailioctlrc
-mv kamailiodbctl.bak kamailiodbctl
+mv $CTLRC.bak $CTLRC
+mv $DBCTL.bak $DBCTL
 
 
 cd ../test

+ 11 - 9
test/unit/9.sh

@@ -19,31 +19,33 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+source include/common
+
 cd ../scripts
 
 # setup config file
-cp kamailioctlrc kamailioctlrc.bak
-cp kamailioctl kamailioctl.bak
-sed -i "s/# DBENGINE=MYSQL/DBENGINE=MYSQL/g" kamailioctlrc
-sed -i "s/TEST=\"false\"/TEST=\"true\"/g" kamailioctl
+cp $CTLRC $CTLRC.bak
+cp $CTL $CTL.bak
+sed -i "s/# DBENGINE=MYSQL/DBENGINE=MYSQL/g" $CTLRC
+sed -i "s/TEST=\"false\"/TEST=\"true\"/g" $CTL
 
-./kamailioctl avp list > /dev/null
+./$CTL avp list > /dev/null
 
 ret=$?
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl domain showdb > /dev/null
+	./$CTL domain showdb > /dev/null
 	ret=$?
 fi ;
 
 if [ "$ret" -eq 0 ] ; then
-	./kamailioctl lcr show > /dev/null
+	./$CTL lcr show > /dev/null
 	ret=$?
 fi ;
 
 # cleanup
-mv kamailioctlrc.bak kamailioctlrc
-mv kamailioctl.bak kamailioctl
+mv $CTLRC.bak $CTLRC
+mv $CTL.bak $CTL
 
 cd ../test
 exit $ret

+ 4 - 1
test/unit/include/common

@@ -1 +1,4 @@
-DB_ALL_MOD="acc|alias_db|auth_db|dialog|dialplan|dispatcher|domain|domainpolicy|group|imc|lcr|msilo|siptrace|speeddial|uri_db|usrloc|permissions|pdt|userblacklist"
+DB_ALL_MOD="acc|alias_db|auth_db|dialog|dialplan|dispatcher|domain|domainpolicy|group|imc|lcr|msilo|siptrace|speeddial|uri_db|usrloc|permissions|pdt|userblacklist"
+CTLRC="kamctlrc"
+CTL="kamctl"
+DBCTL="kamdbctl"

+ 1 - 1
test/unit/include/database

@@ -16,7 +16,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
-MYSQL="mysql kamailio --show-warnings --batch --user=kamailio --password=kamailiorw -e"
+MYSQL="mysql openser --show-warnings --batch --user=openser --password=openserrw -e"
 
 function check_mysql() {
 	$MYSQL "select * from location;"

+ 1 - 1
test/unit/presence.cfg

@@ -40,7 +40,7 @@ loadmodule "mi_fifo/mi_fifo.so"
 modparam("rr", "enable_full_lr", 1)
  
 # -- presence params --
-modparam("presence|presence_xml", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
+modparam("presence|presence_xml", "db_url", "mysql://openser:openserrw@localhost/openser")
  
 modparam("presence_xml", "force_active", 1)