More pjsua-test work: print full log to help investigating any failed test, and other minor updates. (#2322)
* pjsua-test print full test log if test failed * Update subscription check condition in pjsua presence test * Update ccpp.yml
This commit is contained in:
parent
848ce29fa5
commit
fedc629c4a
|
@ -10,9 +10,16 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: sudo apt-get install -y sip-tester
|
run: |
|
||||||
|
sudo apt-get install -y sip-tester
|
||||||
|
sudo apt-get install -y libopencore-amrnb-dev
|
||||||
- name: config site
|
- name: config site
|
||||||
run: echo "#define PJMEDIA_SRTP_HAS_DTLS 1" > pjlib/include/pj/config_site.h
|
run: |
|
||||||
|
echo "#define PJMEDIA_SRTP_HAS_DTLS 1" > pjlib/include/pj/config_site.h
|
||||||
|
echo "#define PJMEDIA_HAS_G722_CODEC 1" >> pjlib/include/pj/config_site.h
|
||||||
|
echo "#define PJMEDIA_HAS_G7221_CODEC 1" >> pjlib/include/pj/config_site.h
|
||||||
|
echo "#define PJ_EXCLUDE_BENCHMARK_TESTS 1" >> pjlib/include/pj/config_site.h
|
||||||
|
echo "#define PJ_CLI_MAX_CHOICE_VAL 64" >> pjlib/include/pj/config_site.h
|
||||||
- name: configure
|
- name: configure
|
||||||
run: ./configure
|
run: ./configure
|
||||||
- name: make
|
- name: make
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
*
|
|
@ -52,7 +52,10 @@ def test_func(t):
|
||||||
u2.send("+b")
|
u2.send("+b")
|
||||||
u2.send(uri1)
|
u2.send(uri1)
|
||||||
u2.expect("Subscription state changed NULL --> SENT")
|
u2.expect("Subscription state changed NULL --> SENT")
|
||||||
u2.expect("Presence subscription.*is ACCEPTED")
|
# sometime it is NULL->SENT->ACCEPTED->ACTIVE
|
||||||
|
# some othertime NULL->SENT->ACTIVE
|
||||||
|
#u2.expect("Presence subscription.*is ACCEPTED")
|
||||||
|
u2.expect("Presence subscription.*is ACTIVE")
|
||||||
if not u1.inst_param.have_publish:
|
if not u1.inst_param.have_publish:
|
||||||
# Process incoming SUBSCRIBE in U1
|
# Process incoming SUBSCRIBE in U1
|
||||||
# Finds out which account gets the subscription in U1
|
# Finds out which account gets the subscription in U1
|
||||||
|
|
|
@ -143,7 +143,7 @@ class Expect(threading.Thread):
|
||||||
|
|
||||||
# start telnet-ing to pjsua, raise exception if telnet fails after 5s
|
# start telnet-ing to pjsua, raise exception if telnet fails after 5s
|
||||||
t0 = time.time()
|
t0 = time.time()
|
||||||
while self.proc.poll() == None and self.telnet is None:
|
while self.proc.poll() is None and self.telnet is None:
|
||||||
try:
|
try:
|
||||||
time.sleep(0.01)
|
time.sleep(0.01)
|
||||||
self.telnet = telnetlib.Telnet('127.0.0.1', port=self.inst_param.telnet_port, timeout=60)
|
self.telnet = telnetlib.Telnet('127.0.0.1', port=self.inst_param.telnet_port, timeout=60)
|
||||||
|
@ -154,7 +154,7 @@ class Expect(threading.Thread):
|
||||||
raise inc.TestError(self.name + ": Timeout connecting to pjsua: " + repr(e))
|
raise inc.TestError(self.name + ": Timeout connecting to pjsua: " + repr(e))
|
||||||
|
|
||||||
self.running = True
|
self.running = True
|
||||||
while self.proc.poll() == None:
|
while self.proc.poll() is None:
|
||||||
line = self.telnet.read_until('\n', 60)
|
line = self.telnet.read_until('\n', 60)
|
||||||
if line == "" or const.DESTROYED in line:
|
if line == "" or const.DESTROYED in line:
|
||||||
break;
|
break;
|
||||||
|
@ -174,7 +174,7 @@ class Expect(threading.Thread):
|
||||||
self.trace("Popen " + fullcmd)
|
self.trace("Popen " + fullcmd)
|
||||||
self.proc = subprocess.Popen(fullcmd, shell=G_INUNIX, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=False)
|
self.proc = subprocess.Popen(fullcmd, shell=G_INUNIX, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=False)
|
||||||
self.running = True
|
self.running = True
|
||||||
while self.proc.poll() == None:
|
while self.proc.poll() is None:
|
||||||
line = self.proc.stdout.readline()
|
line = self.proc.stdout.readline()
|
||||||
if line == "":
|
if line == "":
|
||||||
break;
|
break;
|
||||||
|
@ -283,18 +283,18 @@ def handle_error(errmsg, t, close_processes = True):
|
||||||
is_err = False
|
is_err = False
|
||||||
try:
|
try:
|
||||||
ret = p.expect(const.DESTROYED, False)
|
ret = p.expect(const.DESTROYED, False)
|
||||||
if not ret:
|
if ret is None:
|
||||||
is_err = True
|
is_err = True
|
||||||
except:
|
except:
|
||||||
is_err = True
|
is_err = True
|
||||||
if is_err:
|
if is_err and p.proc.poll() is None:
|
||||||
if sys.hexversion >= 0x02060000:
|
if sys.hexversion >= 0x02060000:
|
||||||
p.proc.terminate()
|
p.proc.terminate()
|
||||||
else:
|
else:
|
||||||
p.wait()
|
p.wait()
|
||||||
else:
|
else:
|
||||||
p.wait()
|
p.wait()
|
||||||
|
|
||||||
print "Test completed with error: " + errmsg
|
print "Test completed with error: " + errmsg
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ for f in os.listdir("scripts-sipp"):
|
||||||
|
|
||||||
resume_script=""
|
resume_script=""
|
||||||
shell_cmd=""
|
shell_cmd=""
|
||||||
with_log=False
|
with_log=True
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
sys.argv.pop(0)
|
sys.argv.pop(0)
|
||||||
|
@ -105,8 +105,9 @@ while len(sys.argv):
|
||||||
print " Run the tests with the specified SHELL cmd. This can also be"
|
print " Run the tests with the specified SHELL cmd. This can also be"
|
||||||
print " used to run the test with ccdash. Example:"
|
print " used to run the test with ccdash. Example:"
|
||||||
print " --shell '/bin/sh -c'"
|
print " --shell '/bin/sh -c'"
|
||||||
print " --logs"
|
print " --no-log"
|
||||||
print " Generate log files, the log files will be put in 'logs' dir."
|
print " Do not generate log files. By default log files will be generated"
|
||||||
|
print " and put in 'logs' dir."
|
||||||
print ""
|
print ""
|
||||||
print " run.py-OPTIONS are applicable here"
|
print " run.py-OPTIONS are applicable here"
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
@ -154,9 +155,9 @@ while len(sys.argv):
|
||||||
sys.argv.pop(0)
|
sys.argv.pop(0)
|
||||||
sys.stderr.write("Error: argument value required")
|
sys.stderr.write("Error: argument value required")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif sys.argv[0] == '--logs':
|
elif sys.argv[0] == '--no-log':
|
||||||
sys.argv.pop(0)
|
sys.argv.pop(0)
|
||||||
with_log=True
|
with_log=False
|
||||||
else:
|
else:
|
||||||
# should be run.py options
|
# should be run.py options
|
||||||
break
|
break
|
||||||
|
@ -185,7 +186,7 @@ for t in tests:
|
||||||
if shell_cmd:
|
if shell_cmd:
|
||||||
cmdline = "%s '%s'" % (shell_cmd, cmdline)
|
cmdline = "%s '%s'" % (shell_cmd, cmdline)
|
||||||
t0 = time.time()
|
t0 = time.time()
|
||||||
msg = "Running %d/%d: %s..." % (tests_cnt+1, total_cnt, cmdline)
|
msg = "Running %3d/%d: %s..." % (tests_cnt+1, total_cnt, cmdline)
|
||||||
sys.stdout.write(msg)
|
sys.stdout.write(msg)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
if with_log:
|
if with_log:
|
||||||
|
@ -202,7 +203,9 @@ for t in tests:
|
||||||
dur = int(t1 - t0)
|
dur = int(t1 - t0)
|
||||||
print " failed!! [" + str(dur) + "s]"
|
print " failed!! [" + str(dur) + "s]"
|
||||||
if with_log:
|
if with_log:
|
||||||
print "Please check '" + logname + "' for the test log."
|
lines = open(logname, "r").readlines()
|
||||||
|
print ''.join(lines)
|
||||||
|
print "Log file: '" + logname + "'."
|
||||||
fails_cnt += 1
|
fails_cnt += 1
|
||||||
else:
|
else:
|
||||||
dur = int(t1 - t0)
|
dur = int(t1 - t0)
|
||||||
|
|
Loading…
Reference in New Issue