Bladeren bron

- add directory prefix to openserctl calls, allow them to run without an
installed openser
- add missing 'TEST' mode sed hack to some tests
- remove double 'sipp' test in test 20
- fix postgres ID comparision for 8.3 version


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

Henning Westerholt 17 jaren geleden
bovenliggende
commit
95e0ec8d0f
6 gewijzigde bestanden met toevoegingen van 12 en 16 verwijderingen
  1. 1 0
      test/unit/10.sh
  2. 7 7
      test/unit/20.cfg
  3. 0 6
      test/unit/20.sh
  4. 2 2
      test/unit/22.sh
  5. 1 1
      test/unit/26.sh
  6. 1 0
      test/unit/9.sh

+ 1 - 0
test/unit/10.sh

@@ -24,6 +24,7 @@ cd ../scripts
 # setup config file
 cp openserctlrc openserctlrc.bak
 sed -i "s/# DBENGINE=MYSQL/DBENGINE=DBTEXT/g" openserctlrc
+sed -i "s/TEST=\"false\"/TEST=\"true\"/g" openserctl
 
 ./openserctl avp list > /dev/null
 

+ 7 - 7
test/unit/20.cfg

@@ -20,20 +20,19 @@ loadmodule "maxfwd/maxfwd.so"
 loadmodule "acc/acc.so"
 #for debugging purposes only
 loadmodule "mi_fifo/mi_fifo.so"
+loadmodule "xlog/xlog.so"
 
 
 #-----------------------Module parameters-------------------------------------
 modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
 modparam("usrloc", "db_mode", 3)
 modparam("usrloc", "db_url", "mysql://openser:[email protected]/openser")
-modparam("acc", "log_level", 3)
 modparam("acc", "log_flag", 1)
-modparam("acc", "log_level", 2)
-modparam("acc", "log_facility", "LOG_DAEMON")
 modparam("db_mysql", "timeout_interval", 2)
 
 
 #-----------------------Routing configuration---------------------------------#
+
 route{
 if (!mf_process_maxfwd_header("10")) {
 	sl_send_reply("483","Too Many Hops");
@@ -44,22 +43,23 @@ if(!lookup ("location")){
 	sl_send_reply("404", "Not Found");
 }
 
-if(method==INVITE){
+if(method=="INVITE"){
 	setflag(1);
 	if (!t_relay()) {
 		sl_reply_error();
 	}
 }
-if (method== ACK) {
+
+if (method=="ACK") {
 	if (!t_relay()) {
 		sl_reply_error();
 	}
 }
-if (method==BYE){
+if (method=="BYE") {
 	if (!t_relay()) {
 		sl_reply_error();
 	}
 }
 exit();
-}
 
+}

+ 0 - 6
test/unit/20.sh

@@ -31,12 +31,6 @@ fi ;
 CFG="20.cfg"
 TMPFILE=`mktemp -t openser-test.XXXXXXXXXX`
 
-# insert a test user into log db
-if [ ! -e $SIPP ] ; then 
-	echo "404 - sipp not found"
-	exit 0
-fi;
-
 # add an registrar entry to the db;
 mysql --show-warnings -B -u openser --password=openserrw -D openser -e "INSERT INTO location (username,contact,socket,user_agent,cseq,q) VALUES (\"foo\",\"sip:foo@localhost\",\"udp:127.0.0.1:5060\",\"ser_test\",1,-1);"
 

+ 2 - 2
test/unit/22.sh

@@ -49,7 +49,7 @@ if [ "$ret" -eq 0 ] ; then
 	ret=$?
 fi ;
 
-TMP=`PGPASSWORD='openserro' psql -A -t -n -q -h localhost -U openserro openser -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 ;
@@ -67,7 +67,7 @@ if [ "$ret" -eq 0 ] ; then
 	fi ;
 fi ;
 
-ret=`PGPASSWORD='openserro' psql -A -t -n -q -h localhost -U openserro openser -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 openser
 

+ 1 - 1
test/unit/26.sh

@@ -106,7 +106,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', '', '', '2');"
 
 if [ ! "$ret" -eq 0 ] ; then
-	openserctl fifo cr_reload_routes
+	../scripts/openserctl fifo cr_reload_routes
 	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
 	ret=$?

+ 1 - 0
test/unit/9.sh

@@ -24,6 +24,7 @@ cd ../scripts
 # setup config file
 cp openserctlrc openserctlrc.bak
 sed -i "s/# DBENGINE=MYSQL/DBENGINE=MYSQL/g" openserctlrc
+sed -i "s/TEST=\"false\"/TEST=\"true\"/g" openserctl
 
 ./openserctl avp list > /dev/null