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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 8 16:48:28 CST 2010


Author: pabelanger
Date: Wed Dec  8 16:48:24 2010
New Revision: 1117

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1117
Log:
Merged revisions 1112 via svnmerge from 
https://origsvn.digium.com/svn/testsuite/asterisk/trunk

........
  r1112 | pabelanger | 2010-12-08 16:41:11 -0500 (Wed, 08 Dec 2010) | 2 lines
  
  Optimize udptl test
........

Modified:
    asterisk/team/pabelanger/testClass/   (props changed)
    asterisk/team/pabelanger/testClass/tests/agi/exit_status/   (props changed)
    asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/badinterpreter.agi   (props changed)
    asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/badinterpreter2.agi   (props changed)
    asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/badinterpreter3.agi   (props changed)
    asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/donothing.agi   (props changed)
    asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/executing.agi   (props changed)
    asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/waiting.agi   (props changed)
    asterisk/team/pabelanger/testClass/tests/udptl/run-test

Propchange: asterisk/team/pabelanger/testClass/
------------------------------------------------------------------------------
    svn:mergeinfo = /asterisk/trunk:1112

Propchange: asterisk/team/pabelanger/testClass/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Dec  8 16:48:24 2010
@@ -1,1 +1,1 @@
-/asterisk/trunk:1-1106
+/asterisk/trunk:1-1106,1112

Propchange: asterisk/team/pabelanger/testClass/tests/agi/exit_status/
            ('svn:mergeinfo' removed)

Propchange: asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/badinterpreter.agi
            ('svn:mergeinfo' removed)

Propchange: asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/badinterpreter2.agi
            ('svn:mergeinfo' removed)

Propchange: asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/badinterpreter3.agi
            ('svn:mergeinfo' removed)

Propchange: asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/donothing.agi
            ('svn:mergeinfo' removed)

Propchange: asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/executing.agi
            ('svn:mergeinfo' removed)

Propchange: asterisk/team/pabelanger/testClass/tests/agi/exit_status/userA/agi-bin/waiting.agi
            ('svn:mergeinfo' removed)

Modified: asterisk/team/pabelanger/testClass/tests/udptl/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/testClass/tests/udptl/run-test?view=diff&rev=1117&r1=1116&r2=1117
==============================================================================
--- asterisk/team/pabelanger/testClass/tests/udptl/run-test (original)
+++ asterisk/team/pabelanger/testClass/tests/udptl/run-test Wed Dec  8 16:48:24 2010
@@ -48,6 +48,10 @@
         self.ast2.start()
         self.ast2.cli_exec("fax set debug on")
 
+    def stop_asterisk(self):
+        self.ast1.stop()
+        self.ast2.stop()
+
     def ami_on_connect1(self, ami):
         self.log_last_step("Connected to AMI 1")
         self.ami1 = ami
@@ -59,16 +63,16 @@
         self.log_last_step("Checking Userevent")
         if event.get("userevent").lower() != "recvstatus":
             return
+        self.stop_reactor()
 
         status = event.get("status")
         print ("Status of FAX is %s" % (status))
         if status == "SUCCESS":
             self.passed = True
+            print "UDPTL test passed!"
         else:
             self.passed = False
-
-        if self.shutdowncall.active():
-            self.shutdowncall.reset(1)
+            print "UDPTL test failed!"
 
     def ami_on_connect2(self, ami):
         self.log_last_step("Connected to AMI 2")
@@ -77,7 +81,7 @@
 
     def ami_login_error(self, ami):
         self.log_last_step("AMI login failed")
-        reactor.callLater(1, self.shut_down)
+        reactor.callLater(1, self.stop_reactor)
 
     def ami_login(self):
         self.log_last_step("Logging in to the AMI")
@@ -90,23 +94,14 @@
         print step
         self.lastStep = step
 
-    def shut_down(self):
-        self.ast1.stop()
-        self.ast2.stop()
-
-        if self.passed:
-            print "UDPTL test passed!"
-        else:
-            print "UDPTL test failed!"
-
+    def stop_reactor(self):
+        print "Stopping reactor"
         if reactor.running:
-            print "Stopping reactor"
             reactor.stop()
 
     def run(self):
-        self.start_asterisk()
         self.ami_login()
-        self.shutdowncall = reactor.callLater(90, self.shut_down)
+        self.shutdowncall = reactor.callLater(60, self.stop_reactor)
 
 
 def main(argv=None):
@@ -114,9 +109,11 @@
         argv = sys.argv
 
     # Run UDPTL test
-    udptl_test = UdptlTest(argv)
+    test = UdptlTest(argv)
+    test.start_asterisk()
     reactor.run()
-    if not udptl_test.passed:
+    test.stop_asterisk()
+    if not test.passed:
         return 1
     return 0
 




More information about the asterisk-commits mailing list