Changeset 4177 for pjproject/trunk


Ignore:
Timestamp:
Jun 26, 2012 2:28:59 AM (12 years ago)
Author:
nanang
Message:

Close #1523:

  • updated scenarios to work with mod_sipp.py (adding config .py file, etc)
  • integrated mod_sipp.py to runall.py
  • removed uas.xml, as it is similar to recvfrom\100_simple.py (REGISTER+resp 200)
  • renamed scenarios (to allow running these SIPp scenarios without .py file):
    • prack_fork.xml -> uas-prack_fork.xml
    • inv_401_retry_after_100.xml -> uas-inv_401_retry_after_100.xml
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  
    2222# Call state is CALLING 
    2323STATE_CALLING = "state.*CALLING" 
     24# Call state is EARLY 
     25STATE_EARLY = "state.*EARLY" 
    2426# Call state is CONFIRMED 
    2527STATE_CONFIRMED = "state.*CONFIRMED" 
  • pjproject/trunk/tests/pjsua/mod_sipp.py

    r4147 r4177  
    88import subprocess 
    99from inc_cfg import * 
     10import inc_const 
    1011 
    1112# SIPp executable path and param 
     
    1314SIPP_PATH = 'sipp' 
    1415SIPP_PARAM = "-i 127.0.0.1 -p 6000 -m 1 127.0.0.1" 
    15 SIPP_TIMEOUT = 10 
     16SIPP_TIMEOUT = 60 
    1617# On BG mode, SIPp doesn't require special terminal 
    1718# On non-BG mode, on win, it needs env var: "TERMINFO=c:\cygwin\usr\share\terminfo" 
    1819SIPP_BG_MODE = True 
    1920 
    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) 
    2122PJSUA_INST_PARAM = [] 
    2223PJSUA_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 
     28PJSUA_DEF_PARAM = "--null-audio --max-calls=1 --no-tcp --id=sip:a@localhost --username=a --realm=*" 
    2329 
    2430# Get SIPp scenario (XML file) 
     
    5864        sipp_param = sipp_param + " -bg" 
    5965    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" 
    6167    fullcmd = os.path.normpath(SIPP_PATH) + " " + sipp_param 
    6268    print "Running SIPP: " + fullcmd 
     
    132138        ua.append(t.process[ua_idx]) 
    133139 
    134     # If there is no PJSUA EXPECT scenario, must keep polling PJSUA stdout 
    135     # otherwise PJSUA process may stuck (due to stdout pipe buffer full?) 
    136     # Ideally the poll should be done contiunously until SIPp process is 
    137     # terminated. 
    138     if len(PJSUA_EXPECTS)==0: 
    139         import inc_const 
    140         ua[0].expect(inc_const.STDOUT_REFRESH, raise_on_error = False) 
    141         return "" 
    142  
    143140    ua_err_st = "" 
    144141    while len(PJSUA_EXPECTS): 
     
    159156            ua_err_st = "Unknown error" 
    160157            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) 
    161169 
    162170    return ua_err_st 
  • pjproject/trunk/tests/pjsua/runall.py

    r3717 r4177  
    5656    tests.append("mod_recvfrom.py scripts-recvfrom/" + f) 
    5757 
     58# Add sipp tests 
     59for f in os.listdir("scripts-sipp"): 
     60    if f.endswith(".xml"): 
     61        tests.append("mod_sipp.py scripts-sipp/" + f) 
     62 
    5863# Filter-out excluded tests 
    5964for pat in excluded_tests: 
     
    104109                        (mod,param) = t.split(None,2) 
    105110                        tname = mod[4:mod.find(".py")] + "_" + \ 
    106                                 param[param.find("/")+1:param.find(".py")] 
     111                                param[param.find("/")+1:param.rfind(".")] 
    107112                        c = "" 
    108113                        if len(sys.argv): 
     
    163168                logname = re.sub("[\\\/]", "_", logname) 
    164169                logname = re.sub("\.py$", ".log", logname) 
     170                logname = re.sub("\.xml$", ".log", logname) 
    165171                logname = "logs/" + logname 
    166172                shutil.move("output.log", logname) 
  • pjproject/trunk/tests/pjsua/scripts-sipp/strict-route.xml

    r2575 r4177  
    8989      [last_Call-ID:] 
    9090      [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]> 
    9393      Content-Type: application/sdp 
    9494 
    9595      v=0 
    96       o=- 3442013205 3442013205 IN IP4 192.168.0.13 
     96      o=- 3442013205 3442013205 IN IP4 [local_ip] 
    9797      s=pjsip 
    98       c=IN IP4 192.168.0.13 
     98      c=IN IP4 [local_ip] 
    9999      t=0 0 
    100100      m=audio 4002 RTP/AVP 0 
     
    112112      [last_Call-ID:] 
    113113      [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]> 
    116116      Content-Type: application/sdp 
    117117 
    118118      v=0 
    119       o=- 3442013205 3442013205 IN IP4 192.168.0.13 
     119      o=- 3442013205 3442013205 IN IP4 [local_ip] 
    120120      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] 
    151122      t=0 0 
    152123      m=audio 4002 RTP/AVP 0 
     
    178149  <!-- Keep the call open for a while in case the 200 is lost to be     --> 
    179150  <!-- able to retransmit it if we receive the BYE again.               --> 
    180   <pause milliseconds="4000"/> 
     151  <pause milliseconds="1000"/> 
    181152 
    182153 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml

    r2985 r4177  
    3737  </recv> 
    3838 
    39   <recv response="180" optional="true"> 
    40   </recv> 
    41  
    42   <recv response="200" rtd="true"> 
     39  <recv response="420" rtd="true"> 
    4340  </recv> 
    4441 
     
    6057  </send> 
    6158 
    62   <pause/> 
    63  
    64   <send retrans="500"> 
    65     <![CDATA[ 
    66  
    67       BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 
    68       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK-1 
    69       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 BYE 
    73       Contact: sip:sipp@[local_ip]:[local_port] 
    74       Max-Forwards: 70 
    75       Subject: Performance Test 
    76       Content-Length: 0 
    77  
    78     ]]> 
    79   </send> 
    80  
    81   <recv response="200" crlf="true"> 
    82   </recv> 
    8359 
    8460  <!-- 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  
    8888  </recv> 
    8989 
    90   <pause milliseconds="4000"/> 
    91  
    9290  <!-- definition of the response time repartition table (unit is ms)   --> 
    9391  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uac-ticket-1148.xml

    r3347 r4177  
    8989  </recv> 
    9090 
    91   <pause milliseconds="4000"/> 
    92  
    9391  <!-- definition of the response time repartition table (unit is ms)   --> 
    9492  <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  
    156156  </send> 
    157157 
    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> 
    162160 
    163161  <!-- definition of the response time repartition table (unit is ms)   --> 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts.xml

    r3206 r4177  
    158158  </send> 
    159159 
    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> 
    163162 
    164163 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts-support-update.xml

    r3206 r4177  
    125125  </send> 
    126126 
    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> 
    130129 
    131130 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts.xml

    r3206 r4177  
    126126  </send> 
    127127 
    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> 
    132130 
    133131  <!-- 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  
    7676  </recv> 
    7777 
    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  
    8278 
    8379  <!-- 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  
    7373  </send> 
    7474 
    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  
    7975 
    8076  <!-- definition of the response time repartition table (unit is ms)   --> 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-auth.xml

    r2988 r4177  
    5555 
    5656 
    57   <pause milliseconds="1000"/> 
    58  
    59  
    6057  <!-- definition of the response time repartition table (unit is ms)   --> 
    6158  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-forked-200.xml

    r2650 r4177  
    118118  </recv> 
    119119 
    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 OK 
    128       [last_Via:] 
    129       [last_From:] 
    130       [last_To:] 
    131       [last_Call-ID:] 
    132       [last_CSeq:] 
    133     ]]> 
    134   </send> 
    135120 
    136121  <!-- definition of the response time repartition table (unit is ms)   --> 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-invite.xml

    r2575 r4177  
    4747      [last_Call-ID:] 
    4848      [last_CSeq:] 
    49       Contact: <sip:192.168.0.15> 
     49      Contact: <sip:sipp@[local_ip]:[local_port]> 
    5050      Content-Type: application/sdp 
    5151 
     
    6767  </recv> 
    6868 
    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  
    7369 
    7470  <!-- definition of the response time repartition table (unit is ms)   --> 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi-0.xml

    r2968 r4177  
    1616<!-- Free Software Foundation, Inc.,                                    --> 
    1717<!-- 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                         --> 
    2518<!--                                                                    --> 
    2619 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi.xml

    r2968 r4177  
    1616<!-- Free Software Foundation, Inc.,                                    --> 
    1717<!-- 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                         --> 
    2518<!--                                                                    --> 
    2619 
     
    7568   </recv> 
    7669 
    77   <pause milliseconds="10000"/>  
     70  <pause milliseconds="2000"/>  
    7871 
    7972 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-prack_fork.xml

    r4175 r4177  
    119119  </recv> 
    120120 
    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 OK 
    129       [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  
    143121 
    144122  <!-- definition of the response time repartition table (unit is ms)   --> 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.xml

    r2822 r4177  
    7575      Max-Forwards: 70 
    7676      Event: presence 
    77       Subscription-State: active;expires=50 
     77      Subscription-State: active;expires=10 
    7878      Content-Type: application/pidf+xml 
    7979 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.xml

    r3338 r4177  
    5656      Max-Forwards: 70 
    5757      Event: presence 
    58       Subscription-State: active;expires=50 
     58      Subscription-State: active;expires=10 
    5959      Content-Type: multipart/mixed;boundary=abcd 
    6060 
  • pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml

    r2959 r4177  
    1616<!-- Free Software Foundation, Inc.,                                    --> 
    1717<!-- 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                         --> 
    2518<!--                                                                    --> 
    2619 
     
    6154      Max-Forwards: 70 
    6255      Event: presence 
    63       Subscription-State: active;expires=50 
     56      Subscription-State: active;expires=10 
    6457      Content-Type: application/pidf+xml 
    6558 
Note: See TracChangeset for help on using the changeset viewer.