2
0
Эх сурвалжийг харах

test: adaption of kamailio specific scripts to sr, more generalization

Henning Westerholt 16 жил өмнө
parent
commit
21ac862fd7

+ 10 - 5
test/unit/include/common

@@ -1,6 +1,11 @@
+# all database modules
 DB_ALL_MOD="acc|alias_db|auth_db|avpops|dialog|dialplan|dispatcher|domain|domainpolicy|group|imc|lcr|msilo|siptrace|speeddial|uri_db|usrloc|permissions|pdt|userblacklist"
-CTLRC="kamctlrc"
-CTL="kamctl"
-DBCTL="kamdbctl"
-BIN="kamailio"
-KILL="killall -15 kamailio"
+# root directory relative to tests
+SR_DIR="../.."
+CTLRC="$SR_DIR/scripts/kamctlrc"
+CTL="$SR_DIR/scripts/kamctl"
+DBCTL="$SR_DIR/scripts/kamdbctl"
+BIN="$SR_DIR/ser"
+KILL="killall -15 $BIN"
+# test directory relative to root
+TEST_DIR="test/unit"

+ 8 - 3
test/unit/include/require

@@ -16,8 +16,10 @@
 # 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
+
 function check_kamailio() {
-	if ! (test -e ../kamailio) ; then
+	if ! (test -e $BIN) ; then
 		echo "kamailio not found, not run"
 		return -1
 	fi;
@@ -30,8 +32,11 @@ function check_module() {
 		return -1
 	fi
 
-	if ! (test -e ../modules/$1/$1.so) ; then
-		echo "modules/$1/$1.so not found, not run"
+	if ! (test -e $SR_DIR/modules_k/$1/$1.so) ; then
+		echo "$SR_DIR/modules_k/$1/$1.so not found, try $SR_DIR/modules"
+	fi;
+	if ! (test -e $SR_DIR/modules/$1/$1.so) ; then
+		echo "$SR_DIR/modules/$1/$1.so not found, not run"
 		return -1
 	fi;
 	return 0