[asterisk-commits] mmichelson: branch mmichelson/srv_sip_outbound r206 - /asterisk/team/mmichels...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 6 12:09:45 CDT 2010


Author: mmichelson
Date: Tue Apr  6 12:09:44 2010
New Revision: 206

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=206
Log:
Some adjustments to test.lua.


Modified:
    asterisk/team/mmichelson/srv_sip_outbound/tests/sip_outbound_address/test.lua

Modified: asterisk/team/mmichelson/srv_sip_outbound/tests/sip_outbound_address/test.lua
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/srv_sip_outbound/tests/sip_outbound_address/test.lua?view=diff&rev=206&r1=205&r2=206
==============================================================================
--- asterisk/team/mmichelson/srv_sip_outbound/tests/sip_outbound_address/test.lua (original)
+++ asterisk/team/mmichelson/srv_sip_outbound/tests/sip_outbound_address/test.lua Tue Apr  6 12:09:44 2010
@@ -28,7 +28,7 @@
 function varset_event_one(event)
 	if (event["Variable"] == "READRESULT") then
 		if (event["Value"] ~= "1") then
-			fail("DTMF not detected properly. Expected '1' but received " .. event["Value"])
+			fail("Wrong UAS answered. Expected DTMF '1' but received " .. event["Value"])
 		end
 	end
 end
@@ -36,7 +36,7 @@
 function varset_event_two(event)
 	if (event["Variable"] == "READRESULT") then
 		if (event["Value"] ~= "2") then
-			fail("DTMF not detected properly. Expected '2' but received " .. event["Value"])
+			fail("Wrong UAS answered. Expected DTMF '2' but received " .. event["Value"])
 		end
 	end
 end
@@ -61,9 +61,21 @@
 	end
 end
 
-function test_call(uac_scenario, handler, name, local_port)
+function setup_uas()
+	local t1 = sipp_exec("uas1.xml", "5061")
+	local t2 = sipp_exec("uas2.xml", "5062")
+	return t1, t2
+end
+
+function kill_uas(t1, t2)
+	t1:term_or_kill()
+	t2:term_or_kill()
+end
+
+function test_call(uac_scenario, handler, local_port)
 	m:register_event("VarSet", handler)
-	local t1 = sipp_exec(scenario, name, local_port)
+	local uas1, uas2 = setup_uas()
+	local t1 = sipp_exec(scenario, local_port)
 
 	--wait for everything to finish
 	sipp_check_error(t1, scenario)
@@ -74,4 +86,12 @@
 	end
 	m:process_events()
 	m:unregister_event("VarSet", handler)
+	kill_uas(uas1, uas2)
 end
+
+test_call("uac1.xml", varset_event_one, "6000")
+test_call("uac2.xml", varset_event_two, "6000")
+test_call("uac3.xml", varset_event_two, "6000")
+test_call("uac4.xml", varset_event_two, "6000")
+test_call("uac5.xml", varset_event_two, "6000")
+test_call("uac6.xml", varset_event_one, "6000")




More information about the asterisk-commits mailing list