[asterisk-commits] mnicholson: testsuite/asterisk/trunk r147 - in /asterisk/trunk/asttest/self-t...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 25 12:36:48 CDT 2010


Author: mnicholson
Date: Thu Mar 25 12:36:45 2010
New Revision: 147

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=147
Log:
Use the new proc.perror function for reporting errors.  Also fixed a bug in manager test.

Modified:
    asterisk/trunk/asttest/self-tests/astlib_manager/test.lua
    asterisk/trunk/asttest/self-tests/spawn_asterisk/test.lua

Modified: asterisk/trunk/asttest/self-tests/astlib_manager/test.lua
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/asttest/self-tests/astlib_manager/test.lua?view=diff&rev=147&r1=146&r2=147
==============================================================================
--- asterisk/trunk/asttest/self-tests/astlib_manager/test.lua (original)
+++ asterisk/trunk/asttest/self-tests/astlib_manager/test.lua Thu Mar 25 12:36:45 2010
@@ -14,9 +14,9 @@
 
 action = ast.manager.action
 
-r = m(action.login())
+r, err = m(action.login())
 if not r then
-	fail("error logging in to the manager: " .. err)
+	error("error logging in to the manager: " .. err)
 end
 
 if r["Response"] ~= "Success" then
@@ -25,9 +25,8 @@
 
 r = m(action.logoff())
 
-status, err = a:term_or_kill()
+status = proc.perror(a:term_or_kill())
 if not status then
-	fail("error terminating asterisk: " .. err)
+	fail("error terminating asterisk")
 end
-print("asterisk exited with status: " .. status)
 

Modified: asterisk/trunk/asttest/self-tests/spawn_asterisk/test.lua
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/asttest/self-tests/spawn_asterisk/test.lua?view=diff&rev=147&r1=146&r2=147
==============================================================================
--- asterisk/trunk/asttest/self-tests/spawn_asterisk/test.lua (original)
+++ asterisk/trunk/asttest/self-tests/spawn_asterisk/test.lua Thu Mar 25 12:36:45 2010
@@ -4,18 +4,12 @@
 
 a = ast.new()
 a:spawn()
-res, err = a:term_or_kill()
+res, err = proc.perror(a:term_or_kill())
 
 if res == nil then
-	if err == "core" then
-		fail("asterisk crashed")
-	elseif type(err) == number then
-		fail("asterisk exited from signal: " .. err)
-	else
-		fail("error running asterisk (err ==  " .. err .. ")")
-	end
+	fail("error running asterisk")
 elseif res ~= 0 then
-	fail("asterisk exited with status " .. res)
+	fail("error, asterisk exited with status " .. res)
 end
 
 pass("asterisk exited with status " .. res)




More information about the asterisk-commits mailing list