[asterisk-commits] russell: branch russell/messaging r1067 - in /asterisk/team/russell/messaging...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 3 16:43:25 CST 2010


Author: russell
Date: Fri Dec  3 16:43:21 2010
New Revision: 1067

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1067
Log:
Convert message_from_call test to SIPpTest method

Added:
    asterisk/team/russell/messaging/tests/sip/message_from_call/configs/ast1/sip.conf   (with props)
Modified:
    asterisk/team/russell/messaging/tests/sip/message_from_call/run-test

Added: asterisk/team/russell/messaging/tests/sip/message_from_call/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/sip/message_from_call/configs/ast1/sip.conf?view=auto&rev=1067
==============================================================================
--- asterisk/team/russell/messaging/tests/sip/message_from_call/configs/ast1/sip.conf (added)
+++ asterisk/team/russell/messaging/tests/sip/message_from_call/configs/ast1/sip.conf Fri Dec  3 16:43:21 2010
@@ -1,0 +1,3 @@
+[general]
+
+allowguest=yes

Propchange: asterisk/team/russell/messaging/tests/sip/message_from_call/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/russell/messaging/tests/sip/message_from_call/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/russell/messaging/tests/sip/message_from_call/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/team/russell/messaging/tests/sip/message_from_call/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/russell/messaging/tests/sip/message_from_call/run-test?view=diff&rev=1067&r1=1066&r2=1067
==============================================================================
--- asterisk/team/russell/messaging/tests/sip/message_from_call/run-test (original)
+++ asterisk/team/russell/messaging/tests/sip/message_from_call/run-test Fri Dec  3 16:43:21 2010
@@ -9,57 +9,32 @@
 
 import sys
 import os
-import subprocess
 
 sys.path.append("lib/python")
-sys.path.append("testsuite/lib/python")
-from asterisk.asterisk import Asterisk
+from asterisk.sipp import SIPpTest
 
 
 WORKING_DIR = "/tmp/asterisk-testsuite/sip/message_from_call"
 TEST_DIR = os.path.dirname(os.path.realpath(__file__))
 
-
-def sipp(scenario, port):
-    return subprocess.Popen(['sipp', '127.0.0.1',
-                             '-sf', '%s/sipp/%s' % (TEST_DIR, scenario),
-                             '-p', port, '-m', '1', '-i', '127.0.0.1',
-                             '-timeout', '20s'],
-                            stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+SIPP_SCENARIOS = [
+    {
+        'scenario' : 'message_recv.xml',
+        '-p' : '5062'
+    },
+    {
+        'scenario' : 'call.xml',
+        '-p' : '5061'
+    }
+]
 
 
 def main(argv=None):
     if argv is None:
         argv = sys.argv
 
-    ast1 = Asterisk(base=WORKING_DIR)
-    ast1.install_configs('%s/configs/ast1' % TEST_DIR)
-    ast1.start()
-
-    p1 = sipp('message_recv.xml', '5062')
-    p2 = sipp('call.xml', '5061')
-
-    (p1_stdout, p1_stderr) = p1.communicate()
-    p1_res = p1.wait()
-    (p2_stdout, p2_stderr) = p2.communicate()
-    p2_res = p2.wait()
-
-    ast1.stop()
-
-    if p1_res:
-        print "ERROR: SIPp #1 returned %s" % str(p1_res)
-        print p1_stdout
-        print p1_stderr
-
-    if p2_res:
-        print "ERROR: SIPp #2 returned %s" % str(p2_res)
-        print p2_stdout
-        print p2_stderr
-
-    if not p1_res and not p2_res:
-        print "Test Passed."
-
-    return 1 if p1_res or p2_res else 0
+    test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)
+    return test.run()
 
 
 if __name__ == "__main__":




More information about the asterisk-commits mailing list