[asterisk-commits] pabelanger: branch pabelanger/testClass r1221 - in /asterisk/team/pabelanger/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 16 19:09:43 UTC 2010


Author: pabelanger
Date: Thu Dec 16 13:09:39 2010
New Revision: 1221

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1221
Log:
Use the AMI instance ID to track which instance we are actually using.

Modified:
    asterisk/team/pabelanger/testClass/lib/python/asterisk/TestCase.py
    asterisk/team/pabelanger/testClass/tests/manager/login/run-test

Modified: asterisk/team/pabelanger/testClass/lib/python/asterisk/TestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/testClass/lib/python/asterisk/TestCase.py?view=diff&rev=1221&r1=1220&r2=1221
==============================================================================
--- asterisk/team/pabelanger/testClass/lib/python/asterisk/TestCase.py (original)
+++ asterisk/team/pabelanger/testClass/lib/python/asterisk/TestCase.py Thu Dec 16 13:09:39 2010
@@ -16,6 +16,7 @@
 
 class TestCase(object):
     ast = []
+    ami = []
     reactor_timeout = 30
     passed = False
 
@@ -71,10 +72,10 @@
         """
         for c in range(count):
             host = "127.0.0.%d" % (c + 1)
+            self.ami.append(None)
             print "Creating AMIFactory %d ..." % (c + 1)
-            ami_method = getattr(self, "ami_connect%d" % (c + 1))
-            self.ami_factory = manager.AMIFactory(username, secret)
-            self.ami_factory.login(host).addCallbacks(ami_method,
+            self.ami_factory = manager.AMIFactory(username, secret, c)
+            self.ami_factory.login(host).addCallbacks(self.ami_connect,
                     self.ami_login_error)
 
     def start_asterisk(self):
@@ -111,3 +112,7 @@
         print "Error logging into AMI"
         self.stop_reactor()
 
+    def ami_connect(self, ami):
+        print "AMI Connect instance %s ..." % (ami.id + 1)
+        self.ami[ami.id] = ami
+

Modified: asterisk/team/pabelanger/testClass/tests/manager/login/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/testClass/tests/manager/login/run-test?view=diff&rev=1221&r1=1220&r2=1221
==============================================================================
--- asterisk/team/pabelanger/testClass/tests/manager/login/run-test (original)
+++ asterisk/team/pabelanger/testClass/tests/manager/login/run-test Thu Dec 16 13:09:39 2010
@@ -9,7 +9,6 @@
 
 import sys
 from twisted.internet import reactor
-
 
 sys.path.append("lib/python")
 from asterisk.asterisk import Asterisk
@@ -24,9 +23,9 @@
         self.passed = True
         self.stop_reactor()
 
-    def ami_connect1(self, ami):
-        print "AMI Connect"
-        ami.logoff().addCallbacks(self.ami_logoff, self.ami_login_error)
+    def ami_connect(self, ami):
+        TestCase.ami_connect(self, ami)
+        self.ami[0].logoff().addCallbacks(self.ami_logoff, self.ami_login_error)
 
     def run(self):
         TestCase.run(self)




More information about the asterisk-commits mailing list