Ignore:
Timestamp:
Jun 26, 2012 7:37:48 AM (12 years ago)
Author:
nanang
Message:

Re #1523: fixed mod_sipp.py problems in executing sipp on unix/mac platforms, i.e: should run on shell and non-background mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/tests/pjsua/mod_sipp.py

    r4177 r4179  
    1010import inc_const 
    1111 
     12# flags that test is running in Unix 
     13G_INUNIX = False 
     14if sys.platform.lower().find("win32")!=-1 or sys.platform.lower().find("microsoft")!=-1: 
     15    G_INUNIX = False 
     16else: 
     17    G_INUNIX = True 
     18 
    1219# SIPp executable path and param 
    1320#SIPP_PATH = '"C:\\Program Files (x86)\\Sipp_3.2\\sipp.exe"' 
     
    1724# On BG mode, SIPp doesn't require special terminal 
    1825# On non-BG mode, on win, it needs env var: "TERMINFO=c:\cygwin\usr\share\terminfo" 
    19 SIPP_BG_MODE = True 
     26# TODO: on unix with BG mode, waitpid() always fails, need to be fixed 
     27#SIPP_BG_MODE = True 
     28SIPP_BG_MODE = not G_INUNIX 
    2029 
    2130# Will be updated based on configuration file (a .py file whose the same name as SIPp XML file) 
     
    3443else: 
    3544    exit(-99) 
     45 
    3646 
    3747# Init PJSUA test instance 
     
    6878    print "Running SIPP: " + fullcmd 
    6979    if SIPP_BG_MODE: 
    70         sipp_proc = subprocess.Popen(fullcmd, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=False) 
    71     else: 
    72         sipp_proc = subprocess.Popen(fullcmd) 
     80        sipp_proc = subprocess.Popen(fullcmd, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=G_INUNIX, universal_newlines=False) 
     81    else: 
     82        sipp_proc = subprocess.Popen(fullcmd, shell=G_INUNIX) 
    7383 
    7484    if not SIPP_BG_MODE: 
Note: See TracChangeset for help on using the changeset viewer.