Changeset 2028 for pjproject/trunk/pjsip-apps/src/test-pjsua
- Timestamp:
- Jun 16, 2008 1:04:44 PM (16 years ago)
- Location:
- pjproject/trunk/pjsip-apps/src/test-pjsua
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/test-pjsua/run.py
r2025 r2028 1 # $Id :$1 # $Id$ 2 2 import sys 3 3 import imp 4 4 import re 5 import os 5 6 import subprocess 7 import random 6 8 import time 7 9 8 10 import inc_const as const 9 11 10 # Defaults 11 G_EXE="..\\..\\bin\\pjsua_vc6d.exe" 12 # Get the pjsua executable name 13 if sys.platform.find("win32")!=-1: 14 e = "../../bin/pjsua_vc6d.exe" 15 st1 = os.stat(e) 16 if st1 != None: 17 G_EXE = e 18 e = "../../bin/pjsua_vc6d.exe" 19 st2 = os.stat(e) 20 if st2 != None and st2.st_mtime > st1.st_mtime: 21 G_EXE = e 22 st1 = st2 23 if G_EXE=="": 24 print "Unable to find valid pjsua. Please build pjsip first" 25 sys.exit(1) 26 G_INUNIX = False 27 else: 28 f = open("../../../build.mak", "r") 29 while True: 30 line = f.readline() 31 if not line: 32 break 33 if line.find("TARGET_NAME")!=-1: 34 print line 35 G_EXE="../../bin/pjsua-" + line.split(":= ")[1] 36 break 37 if G_EXE=="": 38 print "Unable to find ../../../build.mak. Please build pjsip first" 39 sys.exit(1) 40 G_INUNIX = True 41 42 43 G_EXE = G_EXE.rstrip("\n\r \t") 12 44 13 45 ################################### … … 36 68 fullcmd = G_EXE + " " + inst_param.arg + " --stdout-refresh=5 --stdout-refresh-text=" + const.STDOUT_REFRESH 37 69 self.trace("Popen " + fullcmd) 38 self.proc = subprocess.Popen(fullcmd, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)70 self.proc = subprocess.Popen(fullcmd, shell=G_INUNIX, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True) 39 71 def send(self, cmd): 40 72 self.trace("send " + cmd) … … 109 141 script = imp.load_source("script", sys.argv[1]) 110 142 143 # Init random seed 144 random.seed() 145 111 146 # Validate 112 147 if script.test == None: … … 120 155 # Instantiate pjsuas 121 156 print "====== Running " + script.test.title + " ======" 157 print "Using " + G_EXE + " as pjsua executable" 158 122 159 for inst_param in script.test.inst_params: 123 160 try: -
pjproject/trunk/pjsip-apps/src/test-pjsua/runall.py
r2025 r2028 2 2 import os 3 3 import sys 4 5 # Usage: 6 # runall.py [test-to-resume] 7 4 8 5 9 # Initialize test list … … 29 33 tests = [t for t in tests if t.find(pat)==-1] 30 34 35 # Resume test? 36 resume_script="" 37 if len(sys.argv) > 1: 38 if sys.argv[1][0]=='-' or sys.argv[1][0]=='/': 39 print "Usage:" 40 print " runall.py [RESUME]" 41 print "where" 42 print " RESUME is string/substring to specify where to resume tests." 43 print " If this argument is omited, tests will start from the beginning." 44 sys.exit(0) 45 resume_script=sys.argv[1] 46 47 31 48 # Now run the tests 32 49 for t in tests: 50 if resume_script!="" and t.find(resume_script)==-1: 51 print "Skipping " + t +".." 52 continue 53 resume_script="" 33 54 cmdline = "python run.py " + t 34 55 print "Running " + cmdline -
pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-call/200_tcp.py
r2025 r2028 7 7 "TCP transport", 8 8 [ 9 InstanceParam("callee", "--null-audio --no-udp ", uri_param=";transport=tcp --max-calls=1"),9 InstanceParam("callee", "--null-audio --no-udp --max-calls=1", uri_param=";transport=tcp"), 10 10 InstanceParam("caller", "--null-audio --no-udp --max-calls=1") 11 11 ] -
pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-pres
-
Property
svn:ignore
set to
*.pyc
-
Property
svn:ignore
set to
-
pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-pres/200_publish.py
r2025 r2028 1 # $Id :$1 # $Id$ 2 2 # 3 3 from inc_cfg import * … … 9 9 InstanceParam( "ua1", 10 10 "--null-audio"+ 11 " --id= <sip:test1@pjsip.org>"+11 " --id=\"<sip:test1@pjsip.org>\""+ 12 12 " --registrar=sip:sip.pjsip.org" + 13 13 " --username=test1" + 14 14 " --password=test1" + 15 15 " --realm=*" + 16 " --proxy= sip:sip.pjsip.org;lr" +16 " --proxy=\"sip:sip.pjsip.org;lr\"" + 17 17 " --publish", 18 18 uri="<sip:test1@pjsip.org>", … … 21 21 InstanceParam( "ua2", 22 22 "--null-audio"+ 23 " --id= <sip:test2@pjsip.org>"+23 " --id=\"<sip:test2@pjsip.org>\""+ 24 24 " --registrar=sip:sip.pjsip.org" + 25 25 " --username=test2" + 26 26 " --password=test2" + 27 27 " --realm=*" + 28 " --proxy= sip:sip.pjsip.org;lr" +28 " --proxy=\"sip:sip.pjsip.org;lr\"" + 29 29 " --publish", 30 30 uri="<sip:test2@pjsip.org>", -
pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-run/100_simple.py
r2025 r2028 1 # $Id :$1 # $Id$ 2 2 # 3 3 # Just about the simple pjsua command line parameter, which should … … 8 8 "Basic run", 9 9 [ 10 InstanceParam("pjsua", "--null-audio -- local-port 0 --rtp-port 0")10 InstanceParam("pjsua", "--null-audio --rtp-port 0") 11 11 ] 12 12 ) -
pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-run/200_register.py
r2025 r2028 1 # $Id :$1 # $Id$ 2 2 # 3 3 from inc_cfg import * … … 9 9 InstanceParam( "client", 10 10 "--null-audio"+ 11 " --id= <sip:test1@pjsip.org>"+11 " --id=\"<sip:test1@pjsip.org>\""+ 12 12 " --registrar=sip:sip.pjsip.org" + 13 13 " --username=test1" +
Note: See TracChangeset
for help on using the changeset viewer.