[asterisk-commits] mnicholson: testsuite/asterisk/trunk r596 - /asterisk/trunk/tests/cdr/blind-t...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 27 10:23:25 CDT 2010


Author: mnicholson
Date: Tue Jul 27 10:23:22 2010
New Revision: 596

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=596
Log:
added troubleshooting info for intermediate failures in the blind-transfer-accouncode test

Modified:
    asterisk/trunk/tests/cdr/blind-transfer-accountcode/test.lua

Modified: asterisk/trunk/tests/cdr/blind-transfer-accountcode/test.lua
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/blind-transfer-accountcode/test.lua?view=diff&rev=596&r1=595&r2=596
==============================================================================
--- asterisk/trunk/tests/cdr/blind-transfer-accountcode/test.lua (original)
+++ asterisk/trunk/tests/cdr/blind-transfer-accountcode/test.lua Tue Jul 27 10:23:22 2010
@@ -1,3 +1,15 @@
+have_error = false
+
+function check_error()
+	if have_error then
+		error()
+	end
+end
+
+function print_error(err)
+	print(err)
+	have_error = true
+end
 
 function sipp_exec(scenario, name, local_port)
 	local inf = "data.csv"
@@ -24,9 +36,12 @@
 function sipp_check_error(p, scenario)
 	local res, err = p:wait()	
 
-	if not res then error(err) end
+	if not res then
+		print_error(err)
+		return res, err
+	end
 	if res ~= 0 then 
-		error("error while executing " .. scenario .. " sipp scenario (sipp exited with status " .. res .. ")\n" .. p.stderr:read("*a"))
+		print_error("error while executing " .. scenario .. " sipp scenario (sipp exited with status " .. res .. ")\n" .. p.stderr:read("*a"))
 	end
 	
 	return res, err
@@ -75,7 +90,8 @@
 	sipp_check_error(t2, "sipp/wait-for-call-do-hangup.xml")
 	sipp_check_error(t1, "sipp/wait-for-call.xml")
 
-	a:term_or_kill()
+	proc.perror(a:term_or_kill())
+	check_error()
 
 	-- examine the CDR records generated to make sure account code is present
 	check_cdr(a, 2, accountcode)




More information about the asterisk-commits mailing list