Changeset 4177
- Timestamp:
- Jun 26, 2012 2:28:59 AM (12 years ago)
- Location:
- pjproject/trunk/tests/pjsua
- Files:
-
- 17 added
- 1 deleted
- 21 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/tests/pjsua/inc_const.py
r3710 r4177 22 22 # Call state is CALLING 23 23 STATE_CALLING = "state.*CALLING" 24 # Call state is EARLY 25 STATE_EARLY = "state.*EARLY" 24 26 # Call state is CONFIRMED 25 27 STATE_CONFIRMED = "state.*CONFIRMED" -
pjproject/trunk/tests/pjsua/mod_sipp.py
r4147 r4177 8 8 import subprocess 9 9 from inc_cfg import * 10 import inc_const 10 11 11 12 # SIPp executable path and param … … 13 14 SIPP_PATH = 'sipp' 14 15 SIPP_PARAM = "-i 127.0.0.1 -p 6000 -m 1 127.0.0.1" 15 SIPP_TIMEOUT = 1016 SIPP_TIMEOUT = 60 16 17 # On BG mode, SIPp doesn't require special terminal 17 18 # On non-BG mode, on win, it needs env var: "TERMINFO=c:\cygwin\usr\share\terminfo" 18 19 SIPP_BG_MODE = True 19 20 20 PJSUA_DEF_PARAM = "--null-audio --max-calls=1 --no-tcp" 21 # Will be updated based on configuration file (a .py file whose the same name as SIPp XML file) 21 22 PJSUA_INST_PARAM = [] 22 23 PJSUA_EXPECTS = [] 24 25 # Default PJSUA param if configuration file (the corresponding .py file) is not available: 26 # - no-tcp as SIPp is on UDP only 27 # - id, username, and realm: to allow PJSUA sending re-INVITE with auth after receiving 401/407 response 28 PJSUA_DEF_PARAM = "--null-audio --max-calls=1 --no-tcp --id=sip:a@localhost --username=a --realm=*" 23 29 24 30 # Get SIPp scenario (XML file) … … 58 64 sipp_param = sipp_param + " -bg" 59 65 if SIPP_TIMEOUT: 60 sipp_param = sipp_param + " -timeout "+str(SIPP_TIMEOUT)+"s -timeout_error" 66 sipp_param = sipp_param + " -timeout "+str(SIPP_TIMEOUT)+"s -timeout_error" + " -deadcall_wait "+str(SIPP_TIMEOUT)+"s" 61 67 fullcmd = os.path.normpath(SIPP_PATH) + " " + sipp_param 62 68 print "Running SIPP: " + fullcmd … … 132 138 ua.append(t.process[ua_idx]) 133 139 134 # If there is no PJSUA EXPECT scenario, must keep polling PJSUA stdout135 # otherwise PJSUA process may stuck (due to stdout pipe buffer full?)136 # Ideally the poll should be done contiunously until SIPp process is137 # terminated.138 if len(PJSUA_EXPECTS)==0:139 import inc_const140 ua[0].expect(inc_const.STDOUT_REFRESH, raise_on_error = False)141 return ""142 143 140 ua_err_st = "" 144 141 while len(PJSUA_EXPECTS): … … 159 156 ua_err_st = "Unknown error" 160 157 break; 158 159 # Need to poll here for handling these cases: 160 # - If there is no PJSUA EXPECT scenario, we must keep polling the stdout, 161 # otherwise PJSUA process may stuck (due to stdout pipe buffer full?). 162 # - last PJSUA_EXPECT contains a pjsua command that needs time to 163 # finish, for example "v" (re-INVITE), the SIPp XML scenario may expect 164 # that re-INVITE transaction to be completed and without stdout poll 165 # PJSUA process may stuck. 166 # Ideally the poll should be done contiunously until SIPp process is 167 # terminated. 168 ua[0].expect(inc_const.STDOUT_REFRESH, raise_on_error = False) 161 169 162 170 return ua_err_st -
pjproject/trunk/tests/pjsua/runall.py
r3717 r4177 56 56 tests.append("mod_recvfrom.py scripts-recvfrom/" + f) 57 57 58 # Add sipp tests 59 for f in os.listdir("scripts-sipp"): 60 if f.endswith(".xml"): 61 tests.append("mod_sipp.py scripts-sipp/" + f) 62 58 63 # Filter-out excluded tests 59 64 for pat in excluded_tests: … … 104 109 (mod,param) = t.split(None,2) 105 110 tname = mod[4:mod.find(".py")] + "_" + \ 106 param[param.find("/")+1:param. find(".py")]111 param[param.find("/")+1:param.rfind(".")] 107 112 c = "" 108 113 if len(sys.argv): … … 163 168 logname = re.sub("[\\\/]", "_", logname) 164 169 logname = re.sub("\.py$", ".log", logname) 170 logname = re.sub("\.xml$", ".log", logname) 165 171 logname = "logs/" + logname 166 172 shutil.move("output.log", logname) -
pjproject/trunk/tests/pjsua/scripts-sipp/strict-route.xml
r2575 r4177 89 89 [last_Call-ID:] 90 90 [last_CSeq:] 91 Contact: <sip:target@ 192.168.0.13>92 Record-route: <sip:proxy@ 192.168.0.13>91 Contact: <sip:target@[local_ip]> 92 Record-route: <sip:proxy@[local_ip]:[local_port]> 93 93 Content-Type: application/sdp 94 94 95 95 v=0 96 o=- 3442013205 3442013205 IN IP4 192.168.0.1396 o=- 3442013205 3442013205 IN IP4 [local_ip] 97 97 s=pjsip 98 c=IN IP4 192.168.0.1398 c=IN IP4 [local_ip] 99 99 t=0 0 100 100 m=audio 4002 RTP/AVP 0 … … 112 112 [last_Call-ID:] 113 113 [last_CSeq:] 114 Contact: <sip:target@ 192.168.0.13>115 Record-route: <sip:proxy@ 192.168.0.13;maddr=192.168.0.13>114 Contact: <sip:target@[local_ip]> 115 Record-route: <sip:proxy@[local_ip]:[local_port];maddr=[local_ip]> 116 116 Content-Type: application/sdp 117 117 118 118 v=0 119 o=- 3442013205 3442013205 IN IP4 192.168.0.13119 o=- 3442013205 3442013205 IN IP4 [local_ip] 120 120 s=pjsip 121 c=IN IP4 192.168.0.13 122 t=0 0 123 m=audio 4002 RTP/AVP 0 124 a=rtpmap:0 PCMU/8000 125 ]]> 126 </send> 127 128 <recv request="ACK" 129 optional="false" 130 rtd="true" 131 crlf="true"> 132 </recv> 133 134 <send> 135 <![CDATA[ 136 137 SIP/2.0 200 OK 138 [last_Via:] 139 [last_From:] 140 [last_To:];tag=[call_number] 141 [last_Call-ID:] 142 [last_CSeq:] 143 Contact: <sip:target@192.168.0.13> 144 Record-route: <sip:proxy@192.168.0.13;maddr=192.168.0.13> 145 Content-Type: application/sdp 146 147 v=0 148 o=- 3442013205 3442013205 IN IP4 192.168.0.13 149 s=pjsip 150 c=IN IP4 192.168.0.13 121 c=IN IP4 [local_ip] 151 122 t=0 0 152 123 m=audio 4002 RTP/AVP 0 … … 178 149 <!-- Keep the call open for a while in case the 200 is lost to be --> 179 150 <!-- able to retransmit it if we receive the BYE again. --> 180 <pause milliseconds=" 4000"/>151 <pause milliseconds="1000"/> 181 152 182 153 -
pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml
r2985 r4177 37 37 </recv> 38 38 39 <recv response="180" optional="true"> 40 </recv> 41 42 <recv response="200" rtd="true"> 39 <recv response="420" rtd="true"> 43 40 </recv> 44 41 … … 60 57 </send> 61 58 62 <pause/>63 64 <send retrans="500">65 <![CDATA[66 67 BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.068 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK-169 From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]70 To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]71 Call-ID: [call_id]72 CSeq: 2 BYE73 Contact: sip:sipp@[local_ip]:[local_port]74 Max-Forwards: 7075 Subject: Performance Test76 Content-Length: 077 78 ]]>79 </send>80 81 <recv response="200" crlf="true">82 </recv>83 59 84 60 <!-- definition of the response time repartition table (unit is ms) --> -
pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.xml
r3192 r4177 88 88 </recv> 89 89 90 <pause milliseconds="4000"/>91 92 90 <!-- definition of the response time repartition table (unit is ms) --> 93 91 <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> -
pjproject/trunk/tests/pjsua/scripts-sipp/uac-ticket-1148.xml
r3347 r4177 89 89 </recv> 90 90 91 <pause milliseconds="4000"/>92 93 91 <!-- definition of the response time repartition table (unit is ms) --> 94 92 <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts-support-update.xml
r3206 r4177 156 156 </send> 157 157 158 <!-- Keep the call open for a while in case the 200 is lost to be --> 159 <!-- able to retransmit it if we receive the BYE again. --> 160 <pause milliseconds="4000"/> 161 158 <recv response="200"> 159 </recv> 162 160 163 161 <!-- definition of the response time repartition table (unit is ms) --> -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts.xml
r3206 r4177 158 158 </send> 159 159 160 <!-- Keep the call open for a while in case the 200 is lost to be --> 161 <!-- able to retransmit it if we receive the BYE again. --> 162 <pause milliseconds="4000"/> 160 <recv response="200"> 161 </recv> 163 162 164 163 -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts-support-update.xml
r3206 r4177 125 125 </send> 126 126 127 <!-- Keep the call open for a while in case the 200 is lost to be --> 128 <!-- able to retransmit it if we receive the BYE again. --> 129 <pause milliseconds="4000"/> 127 <recv response="200"> 128 </recv> 130 129 131 130 -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts.xml
r3206 r4177 126 126 </send> 127 127 128 <!-- Keep the call open for a while in case the 200 is lost to be --> 129 <!-- able to retransmit it if we receive the BYE again. --> 130 <pause milliseconds="4000"/> 131 128 <recv response="200"> 129 </recv> 132 130 133 131 <!-- definition of the response time repartition table (unit is ms) --> -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml
r3208 r4177 76 76 </recv> 77 77 78 <!-- Keep the call open for a while in case the 200 is lost to be -->79 <!-- able to retransmit it if we receive the BYE again. -->80 <pause milliseconds="4000"/>81 82 78 83 79 <!-- definition of the response time repartition table (unit is ms) --> -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml
r3208 r4177 73 73 </send> 74 74 75 <!-- Keep the call open for a while in case the 200 is lost to be -->76 <!-- able to retransmit it if we receive the BYE again. -->77 <pause milliseconds="4000"/>78 79 75 80 76 <!-- definition of the response time repartition table (unit is ms) --> -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-auth.xml
r2988 r4177 55 55 56 56 57 <pause milliseconds="1000"/>58 59 60 57 <!-- definition of the response time repartition table (unit is ms) --> 61 58 <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-forked-200.xml
r2650 r4177 118 118 </recv> 119 119 120 <!-- Receive BYE -->121 <recv request="BYE" crlf="true">122 </recv>123 124 <!-- Send 200/OK to BYE -->125 <send>126 <![CDATA[127 SIP/2.0 200 OK128 [last_Via:]129 [last_From:]130 [last_To:]131 [last_Call-ID:]132 [last_CSeq:]133 ]]>134 </send>135 120 136 121 <!-- definition of the response time repartition table (unit is ms) --> -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-invite.xml
r2575 r4177 47 47 [last_Call-ID:] 48 48 [last_CSeq:] 49 Contact: <sip: 192.168.0.15>49 Contact: <sip:sipp@[local_ip]:[local_port]> 50 50 Content-Type: application/sdp 51 51 … … 67 67 </recv> 68 68 69 <!-- Keep the call open for a while in case the 200 is lost to be -->70 <!-- able to retransmit it if we receive the BYE again. -->71 <pause milliseconds="4000"/>72 73 69 74 70 <!-- definition of the response time repartition table (unit is ms) --> -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi-0.xml
r2968 r4177 16 16 <!-- Free Software Foundation, Inc., --> 17 17 <!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> 18 <!-- -->19 <!-- Late NOTIFY scenario: -->20 <!-- - UAC sends SUBSCRIBE, we reply with 200 -->21 <!-- - we send NOTIFY, expect 200 -->22 <!-- - UAC sends SUBSCRIBE, we ignore -->23 <!-- - we send NOTIFY -->24 <!-- See http://trac.pjsip.org/repos/ticket/911 -->25 18 <!-- --> 26 19 -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi.xml
r2968 r4177 16 16 <!-- Free Software Foundation, Inc., --> 17 17 <!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> 18 <!-- -->19 <!-- Late NOTIFY scenario: -->20 <!-- - UAC sends SUBSCRIBE, we reply with 200 -->21 <!-- - we send NOTIFY, expect 200 -->22 <!-- - UAC sends SUBSCRIBE, we ignore -->23 <!-- - we send NOTIFY -->24 <!-- See http://trac.pjsip.org/repos/ticket/911 -->25 18 <!-- --> 26 19 … … 75 68 </recv> 76 69 77 <pause milliseconds=" 10000"/>70 <pause milliseconds="2000"/> 78 71 79 72 -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-prack_fork.xml
r4175 r4177 119 119 </recv> 120 120 121 <!-- Receive BYE -->122 <recv request="BYE" crlf="true">123 </recv>124 125 <!-- Send 200/OK to BYE -->126 <send>127 <![CDATA[128 SIP/2.0 200 OK129 [last_Via:]130 [last_From:]131 [last_To:]132 [last_Call-ID:]133 [last_CSeq:]134 ]]>135 </send>136 137 138 139 <!-- Keep the call open for a while in case the 200 is lost to be -->140 <!-- able to retransmit it if we receive the BYE again. -->141 <pause milliseconds="4000"/>142 143 121 144 122 <!-- definition of the response time repartition table (unit is ms) --> -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.xml
r2822 r4177 75 75 Max-Forwards: 70 76 76 Event: presence 77 Subscription-State: active;expires= 5077 Subscription-State: active;expires=10 78 78 Content-Type: application/pidf+xml 79 79 -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.xml
r3338 r4177 56 56 Max-Forwards: 70 57 57 Event: presence 58 Subscription-State: active;expires= 5058 Subscription-State: active;expires=10 59 59 Content-Type: multipart/mixed;boundary=abcd 60 60 -
pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml
r2959 r4177 16 16 <!-- Free Software Foundation, Inc., --> 17 17 <!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> 18 <!-- -->19 <!-- Late NOTIFY scenario: -->20 <!-- - UAC sends SUBSCRIBE, we reply with 200 -->21 <!-- - we send NOTIFY, expect 200 -->22 <!-- - UAC sends SUBSCRIBE, we ignore -->23 <!-- - we send NOTIFY -->24 <!-- See http://trac.pjsip.org/repos/ticket/911 -->25 18 <!-- --> 26 19 … … 61 54 Max-Forwards: 70 62 55 Event: presence 63 Subscription-State: active;expires= 5056 Subscription-State: active;expires=10 64 57 Content-Type: application/pidf+xml 65 58
Note: See TracChangeset
for help on using the changeset viewer.