[asterisk-commits] mnicholson: testsuite/asterisk/trunk r426 - /asterisk/trunk/asttest/self-test...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 24 09:59:40 CDT 2010


Author: mnicholson
Date: Thu Jun 24 09:59:36 2010
New Revision: 426

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=426
Log:
Make the spawn_asterisk self test spawn 10 instances of asterisk

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

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=426&r1=425&r2=426
==============================================================================
--- asterisk/trunk/asttest/self-tests/spawn_asterisk/test.lua (original)
+++ asterisk/trunk/asttest/self-tests/spawn_asterisk/test.lua Thu Jun 24 09:59:36 2010
@@ -2,15 +2,23 @@
 
 skip_if(not ast.exists(), "asterisk not found")
 
-a = ast.new()
-a:spawn()
-res, err = proc.perror(a:term_or_kill())
-
-if res == nil then
-	fail("error running asterisk")
-elseif res ~= 0 then
-	fail("error, asterisk exited with status " .. res)
+instances = {}
+for i=1,10 do
+	print("starting asterisk instance " .. i)
+	local a = ast.new()
+	a:spawn()
+	table.insert(instances, a)
 end
 
-pass("asterisk exited with status " .. res)
+for i=1,10 do
+	print("killing asterisk instance " .. i)
+	local a = instances[i]
+	local res, err = proc.perror(a:term_or_kill())
 
+	if res == nil then
+		fail("error running asterisk")
+	elseif res ~= 0 then
+		fail("error, asterisk exited with status " .. res)
+	end
+end
+




More information about the asterisk-commits mailing list