<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9567">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">t38_fast_reject: remove dependency on rtpdump<br><br>removed dependency on rtpdump, added executable permissions to<br>perl script validating response time<br><br>Change-Id: Ia73ef502f72bd75522d4b6656f6070807dbef349<br>---<br>D tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.pl<br>A tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.py<br>M tests/fax/pjsip/t38_fast_reject/run-test<br>M tests/fax/pjsip/t38_fast_reject/test-config.yaml<br>4 files changed, 26 insertions(+), 66 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.pl b/tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.pl</span><br><span>deleted file mode 100644</span><br><span>index 1744aef..0000000</span><br><span>--- a/tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.pl</span><br><span>+++ /dev/null</span><br><span>@@ -1,43 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-#!/usr/bin/perl</span><br><span style="color: hsl(0, 100%, 40%);">-use strict;</span><br><span style="color: hsl(0, 100%, 40%);">-use Text::CSV;</span><br><span style="color: hsl(0, 100%, 40%);">-use Data::Dumper;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-my $filename = $ARGV[0];</span><br><span style="color: hsl(0, 100%, 40%);">-open(my $fh, '<:utf8', $filename)</span><br><span style="color: hsl(0, 100%, 40%);">- or die "Can't open $filename: $!";</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-my $csv = Text::CSV->new({sep_char => ';'})</span><br><span style="color: hsl(0, 100%, 40%);">- or die "Text::CSV error: " . Text::CSV->error_diag;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-my $header = <$fh>; </span><br><span style="color: hsl(0, 100%, 40%);">-# define column names </span><br><span style="color: hsl(0, 100%, 40%);">-$csv->parse($header);</span><br><span style="color: hsl(0, 100%, 40%);">-$csv->column_names([$csv->fields]);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-my $ret = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-# parse the rest</span><br><span style="color: hsl(0, 100%, 40%);">-while (my $row = $csv->getline_hr($fh)) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (!defined $row->{'ResponseTimereinvite(P)'} ) {</span><br><span style="color: hsl(0, 100%, 40%);">- print "column not found! make sure scenario is correct!\n";</span><br><span style="color: hsl(0, 100%, 40%);">- $ret = -1;</span><br><span style="color: hsl(0, 100%, 40%);">- last;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- </span><br><span style="color: hsl(0, 100%, 40%);">- my $pkey = $row->{'ResponseTimereinvite(P)'};</span><br><span style="color: hsl(0, 100%, 40%);">- my ($hour, $minute, $second, $msec) = split(/:/, $pkey);</span><br><span style="color: hsl(0, 100%, 40%);">- $minute += $hour*60;</span><br><span style="color: hsl(0, 100%, 40%);">- $second += $minute*60;</span><br><span style="color: hsl(0, 100%, 40%);">- $msec += $second * 1000;</span><br><span style="color: hsl(0, 100%, 40%);">- </span><br><span style="color: hsl(0, 100%, 40%);">- if ($msec > 500) {</span><br><span style="color: hsl(0, 100%, 40%);">- print "Slow 488 Rejection detected ($msec)!\n";</span><br><span style="color: hsl(0, 100%, 40%);">- $ret = -2;</span><br><span style="color: hsl(0, 100%, 40%);">- last;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-$csv->eof or $csv->error_diag;</span><br><span style="color: hsl(0, 100%, 40%);">-close $fh;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-exit $ret;</span><br><span>diff --git a/tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.py b/tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.py</span><br><span>new file mode 100755</span><br><span>index 0000000..c67da51</span><br><span>--- /dev/null</span><br><span>+++ b/tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.py</span><br><span>@@ -0,0 +1,24 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/usr/bin/python</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+import csv</span><br><span style="color: hsl(120, 100%, 40%);">+import sys</span><br><span style="color: hsl(120, 100%, 40%);">+import re</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+regex = re.compile("([0-9]{2}):([0-9]{2}):([0-9]{2}):([0-9]{3})([0-9]{3})?")</span><br><span style="color: hsl(120, 100%, 40%);">+with open(sys.argv[1]) as csvfile:</span><br><span style="color: hsl(120, 100%, 40%);">+ reader = csv.DictReader(csvfile, delimiter=';')</span><br><span style="color: hsl(120, 100%, 40%);">+ for row in reader:</span><br><span style="color: hsl(120, 100%, 40%);">+ if not row.has_key('ResponseTimereinvite(P)'):</span><br><span style="color: hsl(120, 100%, 40%);">+ print "column not found! make sure scenario is correct!\n"</span><br><span style="color: hsl(120, 100%, 40%);">+ exit(-1);</span><br><span style="color: hsl(120, 100%, 40%);">+ parts = regex.match(row['ResponseTimereinvite(P)'])</span><br><span style="color: hsl(120, 100%, 40%);">+ hours = int(parts.group(1))</span><br><span style="color: hsl(120, 100%, 40%);">+ minutes = (hours * 60) + int(parts.group(2))</span><br><span style="color: hsl(120, 100%, 40%);">+ seconds = (minutes * 60) + int(parts.group(3))</span><br><span style="color: hsl(120, 100%, 40%);">+ milliseconds = (seconds * 1000) + int(parts.group(4))</span><br><span style="color: hsl(120, 100%, 40%);">+ if (milliseconds > 500):</span><br><span style="color: hsl(120, 100%, 40%);">+ print "Slow 488 Rejection detected (" + milliseconds + ")!\n";</span><br><span style="color: hsl(120, 100%, 40%);">+ exit(-2)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+csvfile.close()</span><br><span style="color: hsl(120, 100%, 40%);">+exit(0)</span><br><span>\ No newline at end of file</span><br><span>diff --git a/tests/fax/pjsip/t38_fast_reject/run-test b/tests/fax/pjsip/t38_fast_reject/run-test</span><br><span>index 9d86e01..7db6898 100755</span><br><span>--- a/tests/fax/pjsip/t38_fast_reject/run-test</span><br><span>+++ b/tests/fax/pjsip/t38_fast_reject/run-test</span><br><span>@@ -49,6 +49,7 @@</span><br><span> 'scenario' : 'A_PARTY.xml',</span><br><span> '-i' : '127.0.0.1',</span><br><span> '-p' : '5061',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-m' : '1',</span><br><span> '-s' : e164,</span><br><span> '-message_file' : sippA_logfile,</span><br><span> '-error_file' : sippA_errfile,</span><br><span>@@ -62,33 +63,12 @@</span><br><span> test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)</span><br><span> test.reactor_timeout = 100;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- dump_A = WORKING_DIR + "/carrier_rtp.log"</span><br><span style="color: hsl(0, 100%, 40%);">- dump_B = WORKING_DIR + "/customer_rtp.log"</span><br><span style="color: hsl(0, 100%, 40%);">- rtpdump_A = subprocess.Popen(["rtpdump", "-t","5", "-F","ascii","-d","101","-o",dump_A, "127.0.0.1/9000"])</span><br><span style="color: hsl(0, 100%, 40%);">- rtpdump_B = subprocess.Popen(["rtpdump", "-t","5", "-F","ascii","-d","101","-o",dump_B, "127.0.0.1/8000"])</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- time.sleep(10) #Wait 10 seconds to ensure that all the sockets are open before running the test </span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> reactor.run()</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- # Kill the RTPDUMP, pass it the signal"</span><br><span style="color: hsl(0, 100%, 40%);">- rtpdump_A.send_signal(signal.SIGINT) </span><br><span style="color: hsl(0, 100%, 40%);">- rtpdump_A.wait()</span><br><span style="color: hsl(0, 100%, 40%);">- rtpdump_B.send_signal(signal.SIGINT) </span><br><span style="color: hsl(0, 100%, 40%);">- rtpdump_B.wait()</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- #Verify that audio packets were routed in both directions after G711 fallback</span><br><span style="color: hsl(0, 100%, 40%);">- if (os.path.getsize(dump_B) == 0):</span><br><span style="color: hsl(0, 100%, 40%);">- logger.error("No RTP routed towards customer ...failing the test")</span><br><span style="color: hsl(0, 100%, 40%);">- return 1</span><br><span style="color: hsl(0, 100%, 40%);">- if (os.path.getsize(dump_A) == 0):</span><br><span style="color: hsl(0, 100%, 40%);">- logger.error("No RTP routed towards carrier ...failing the test")</span><br><span style="color: hsl(0, 100%, 40%);">- return 1</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> if not test.passed:</span><br><span> return 1</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ret_A = subprocess.call([WORKING_DIR + "/check_reinvite_rtt.pl", WORKING_DIR+"/A_PARTY_STAT.log"])</span><br><span style="color: hsl(120, 100%, 40%);">+ ret_A = subprocess.call([WORKING_DIR + "/check_reinvite_rtt.py", WORKING_DIR+"/A_PARTY_STAT.log"])</span><br><span> </span><br><span> if (ret_A != 0):</span><br><span> logger.debug("Slow ReInvite Detected!")</span><br><span>diff --git a/tests/fax/pjsip/t38_fast_reject/test-config.yaml b/tests/fax/pjsip/t38_fast_reject/test-config.yaml</span><br><span>index cf74af8..90eddc0 100644</span><br><span>--- a/tests/fax/pjsip/t38_fast_reject/test-config.yaml</span><br><span>+++ b/tests/fax/pjsip/t38_fast_reject/test-config.yaml</span><br><span>@@ -7,7 +7,6 @@</span><br><span> dependencies:</span><br><span> - python : 'twisted'</span><br><span> - python : 'starpy'</span><br><span style="color: hsl(0, 100%, 40%);">- - app : 'rtpdump'</span><br><span> </span><br><span> tags:</span><br><span> - PJSIP</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9567">change 9567</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9567"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia73ef502f72bd75522d4b6656f6070807dbef349 </div>
<div style="display:none"> Gerrit-Change-Number: 9567 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Torrey Searle <tsearle@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>