Changeset 2013


Ignore:
Timestamp:
Jun 12, 2008 7:13:51 PM (16 years ago)
Author:
bennylp
Message:

Ticket #543: added TCP call in pjsua unit test

Location:
pjproject/trunk/pjsip-apps/src/test-pjsua
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/test-pjsua/inc_cfg.py

    r2009 r2013  
    1919# Call config class 
    2020class CallConfig: 
     21        # additional parameter to be added to target URI 
     22        uri_param = "" 
    2123        def __init__(self, title, callee_cfg, caller_cfg): 
    2224                self.title = title 
  • pjproject/trunk/pjsip-apps/src/test-pjsua/inc_param.py

    r2009 r2013  
    3232class Test: 
    3333        title = "" 
    34         # params is list containing PjsuaParam objects 
     34        # params is list containing Pjsua objects 
    3535        run = [] 
    3636        # list of Expect instances, to be filled at run-time by 
  • pjproject/trunk/pjsip-apps/src/test-pjsua/mod_call.py

    r2012 r2013  
    3636        # Caller making call 
    3737        caller.send("m") 
    38         caller.send("sip:localhost:" + port1) 
     38        caller.send("sip:localhost:" + port1 + cfg_file.config.uri_param) 
    3939        caller.expect(const.STATE_CALLING) 
    4040         
  • pjproject/trunk/pjsip-apps/src/test-pjsua/run.py

    r2009 r2013  
    4848                        line = self.proc.stdout.readline() 
    4949                        if line == "": 
    50                                 raise TestError("Premature EOF") 
     50                                raise TestError(self.name + ": Premature EOF") 
    5151                        # Print the line if echo is ON 
    5252                        if self.echo: 
     
    5454                        # Trap assertion error 
    5555                        if self.ra.search(line) != None: 
    56                                 raise TestError(line) 
     56                                if raise_on_error: 
     57                                        raise TestError(self.name + ": " + line) 
     58                                else: 
     59                                        return None 
    5760                        # Count stdout refresh text.  
    5861                        if self.rr.search(line) != None: 
     
    6164                                        self.trace("Timed-out!") 
    6265                                        if raise_on_error: 
    63                                                 raise TestError("Timeout expecting pattern: " + pattern) 
     66                                                raise TestError(self.name + ": Timeout expecting pattern: " + pattern) 
    6467                                        else: 
    6568                                                return None             # timeout 
     
    8184        for p in t.process: 
    8285                p.send("q") 
    83                 p.expect(const.DESTROYED) 
     86                p.expect(const.DESTROYED, False) 
    8487                p.wait() 
    8588        print "Test completed with error: " + errmsg 
     
    118121                p.send("echo 1") 
    119122                p.send("echo 1") 
     123                p.expect("echo 1") 
    120124                # add running instance 
    121125                script.test.process.append(p) 
     
    144148        p.send("q") 
    145149        time.sleep(0.5) 
    146         p.expect(const.DESTROYED) 
     150        p.expect(const.DESTROYED, False) 
    147151        p.wait() 
    148152 
Note: See TracChangeset for help on using the changeset viewer.