Changeset 2036 for pjproject


Ignore:
Timestamp:
Jun 20, 2008 5:43:55 PM (16 years ago)
Author:
nanang
Message:

More ticket #543: added SRTP tests on scripts-sendto

Location:
pjproject/trunk/pjsip-apps/src/test-pjsua
Files:
17 added
3 edited

Legend:

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

    r2029 r2036  
    22 
    33# PLAYFILE -> RECFILE: 
    4 # input file is played and is recorded to output, then compare them. 
     4# Input file is played and is recorded to output, then compare them. 
     5# Useful to tes clock rates compatibility and resample quality 
    56#       null-audio 
    67#       port 1: wav file input xxxxxx.clock_rate.wav, e.g: test1.8.wav 
    78#       port 2: wav file ouput xxxxxx.clock_rate.wav, e.g: res1.8.wav 
    8 #       wav input more than 3 seconds 
     9#       wav input must be more than 3 seconds long 
    910 
    1011import time 
     
    7677        endpt.trace("Popen " + fullcmd) 
    7778        cmp_proc = subprocess.Popen(fullcmd, stdout=subprocess.PIPE, universal_newlines=True) 
     79 
     80        # Parse similarity ouput 
    7881        line = cmp_proc.stdout.readline() 
    79         endpt.trace("WAV similarity = " + line) 
     82        mo_sim_val = re.match(".+=\s+(\d+)", line) 
     83        if (mo_sim_val == None): 
     84                raise TestError("Error comparing WAV files") 
     85                return 
     86 
     87        # Evaluate the similarity value 
     88        sim_val = mo_sim_val.group(1) 
     89        if (sim_val > 0): 
     90                endpt.trace("WAV similarity = " + sim_val) 
     91        else: 
     92                raise TestError("Degraded WAV heavily distorted") 
    8093 
    8194 
  • pjproject/trunk/pjsip-apps/src/test-pjsua/run.py

    r2033 r2036  
    110110######################### 
    111111# Error handling 
    112 def handle_error(errmsg, t): 
     112def handle_error(errmsg, t, close_processes = True): 
    113113        print "====== Caught error: " + errmsg + " ======" 
    114         time.sleep(1) 
    115         for p in t.process: 
    116                 p.send("q") 
    117                 p.send("q") 
    118                 p.expect(const.DESTROYED, False) 
    119                 p.wait() 
     114        if (close_processes): 
     115                time.sleep(1) 
     116                for p in t.process: 
     117                        p.send("q") 
     118                        p.send("q") 
     119                        p.expect(const.DESTROYED, False) 
     120                        p.wait() 
    120121        print "Test completed with error: " + errmsg 
    121122        sys.exit(1) 
     
    196197                script.test.post_func(script.test, script.test.user_data) 
    197198        except TestError, e: 
    198                 handle_error(e.desc, script.test) 
     199                handle_error(e.desc, script.test, False) 
    199200 
    200201# Done 
  • pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/100_simplecall.py

    r2034 r2036  
    1 # $Id:$ 
     1# $Id$ 
    22import inc_sip as sip 
    33import inc_sdp as sdp 
     
    1717""" 
    1818 
    19 sendto_cfg = sip.SendtoCfg( "simple call", "--null-audio", sdp, 200) 
     19sendto_cfg = sip.SendtoCfg( "simple call", "--null-audio --auto-answer 200", sdp, 200) 
    2020 
Note: See TracChangeset for help on using the changeset viewer.