[svn-commits] russell: testsuite/bamboo/trunk r700 - /bamboo/trunk/bin/build-asterisk.sh

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 4 14:28:32 CDT 2010


Author: russell
Date: Wed Aug  4 14:28:28 2010
New Revision: 700

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=700
Log:
Re-work running unit tests to use astcli instead of asterisk -rx

Modified:
    bamboo/trunk/bin/build-asterisk.sh

Modified: bamboo/trunk/bin/build-asterisk.sh
URL: http://svnview.digium.com/svn/testsuite/bamboo/trunk/bin/build-asterisk.sh?view=diff&rev=700&r1=699&r2=700
==============================================================================
--- bamboo/trunk/bin/build-asterisk.sh (original)
+++ bamboo/trunk/bin/build-asterisk.sh Wed Aug  4 14:28:28 2010
@@ -55,29 +55,29 @@
 }
 
 run_unit_tests() {
+	cat > /etc/asterisk/manager.conf << EOF
+[general]
+enabled=yes
+bindaddr=127.0.0.1
+port=5038
+
+[test]
+secret=test
+read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
+write = system,call,agent,user,config,command,reporting,originate
+EOF
+	start_asterisk
+
 	echo "*** Executing Unit Tests (Results: ${TEST_RESULTS_DIR}/unit-test-results.xml) ***"
-	asterisk -rx "test execute all"
-
-	asterisk -rx "test generate results xml ${TEST_RESULTS_DIR}/unit-test-results.xml"
-
-	# https://issues.asterisk.org/view.php?id=17049
-
-	LOOPCOUNT=0
-	while [ ! -s "${TEST_RESULTS_DIR}/unit-test-results.xml" ] ; do
-		sleep 1
-		LOOPCOUNT=$[${LOOPCOUNT} + 1]
-		if [ ${LOOPCOUNT} == 30 ] ; then
-			echo "*** ERROR: Waited 30 seconds and never got unit test results! ***"
-			stop_asterisk
-			exit 1
-			break
-		fi
-	done
+	contrib/scripts/astcli -u test -s test "test execute all"
+	contrib/scripts/astcli -u test -s test "test generate results xml ${TEST_RESULTS_DIR}/unit-test-results.xml"
 
 	if [ -f core* ] ; then
 		echo "*** Found a core file after running unit tests ***"
 		gdb asterisk core* -x /usr/local/bin/bamboo/bt.txt
 	fi
+
+	stop_asterisk
 }
 
 gen_coverage_report() {
@@ -191,9 +191,7 @@
 
 if [ "${UNIT_TESTS}" = "yes" ] ; then
 	killall_asterisk
-	start_asterisk
 	run_unit_tests
-	stop_asterisk
 fi
 
 if [ "${PLAN}" = "AST-TRUNK" ] || [ "${PLAN}" = "AST-162" ] || [ "${PLAN}" = "AST-161" ] || [ "${PLAN}" = "AST-160" ] || [ "${PLAN}" = "AST-14" ] || [ "${PLAN}" = "AST-18" ] ; then




More information about the svn-commits mailing list