[Asterisk-code-review] tests/hep/pjsip-ipv6: Be tolerant to different IPv6 nomencla... (testsuite[master])

Matt Jordan asteriskteam at digium.com
Mon Oct 5 19:27:46 CDT 2015


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/1378

Change subject: tests/hep/pjsip-ipv6: Be tolerant to different IPv6 nomenclatures
......................................................................

tests/hep/pjsip-ipv6: Be tolerant to different IPv6 nomenclatures

An IPv6 address may include the brackets '['/']' or it may omit them.
It is possible for Asterisk to change (at a minimum) the connection address
in the SDP to use one nomenclature over another depending on whether or not
the address has been cached recently. As a result, the regex handling the
200 OK would sporadically fail.

This patch makes the checking of the IPv6 addresses more tolerant to both
nomenclatures. It does this on values that *may* be produced by Asterisk in
packets received from Asterisk by the SIPp scenario. This should make the test
more reliable in the long run.

Change-Id: I747d45fc6537f9d4f92c62da2c6a44c758a05e9d
---
M tests/hep/pjsip-ipv6/test-config.yaml
1 file changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/78/1378/1

diff --git a/tests/hep/pjsip-ipv6/test-config.yaml b/tests/hep/pjsip-ipv6/test-config.yaml
index f5406ec..89aa7e2 100644
--- a/tests/hep/pjsip-ipv6/test-config.yaml
+++ b/tests/hep/pjsip-ipv6/test-config.yaml
@@ -93,13 +93,13 @@
                 decode: 'SIP'
                 value:
                     - 'SIP/2.0 200 OK'
-                    - 'Via: SIP/2.0/UDP \[::1\]:5067;rport=5067;received=::1;branch=(.*)'
+                    - 'Via: SIP/2.0/UDP [\[]?::1[\]]?:5067;rport=5067;received=[\[]?::1[\]]?;branch=(.*)'
                     - 'Call-ID: (.*?)@::1'
-                    - 'From: "test1" <sip:alice-ipv6-udp@\[::1\]>;tag=(.*)'
-                    - 'To: "test" <sip:test@\[::1\]>;tag=(.*)'
+                    - 'From: "test1" <sip:alice-ipv6-udp@[\[]?::1[\]]?>;tag=(.*)'
+                    - 'To: "test" <sip:test@[\[]?::1[\]]?>;tag=(.*)'
                     - 'CSeq: 1 INVITE'
                     - 'Server: (.*)'
-                    - 'Contact: <sip:\[::1\]:5060>'
+                    - 'Contact: <sip:[\[]?::1[\]]?:5060>'
                     - 'Allow: (.*)'
                     - 'Supported: 100rel, timer, replaces, norefersub'
                     - 'Content-Type: application/sdp'
@@ -107,7 +107,7 @@
                     - '(.*)'
                     - '(.*)'
                     - 's=Asterisk'
-                    - 'c=IN IP6 \[::1\]'
+                    - 'c=IN IP6 [\[]?::1[\]]?'
                     - 't=0 0'
                     - 'm=audio(.*?)RTP/AVP 0 8 101'
                     - 'a=rtpmap:0 PCMU/8000'
@@ -161,13 +161,13 @@
             payload:
                 decode: 'SIP'
                 value:
-                    - 'BYE sip:echo@\[::1\]:5060 SIP/2.0'
-                    - 'Via: SIP/2.0/UDP \[::1\]:5067;branch=(.*)'
-                    - 'From: test1 <sip:alice-ipv6-udp@\[::1\]:5067>;tag=(.*)'
-                    - 'To: test <sip:test@\[::1\]:5060>;tag=(.*)'
+                    - 'BYE sip:echo@[\[]?::1[\]]?:5060 SIP/2.0'
+                    - 'Via: SIP/2.0/UDP [\[]?::1[\]]?:5067;branch=(.*)'
+                    - 'From: test1 <sip:alice-ipv6-udp@[\[]?::1[\]]?:5067>;tag=(.*)'
+                    - 'To: test <sip:test@[\[]?::1[\]]?:5060>;tag=(.*)'
                     - 'Call-ID: (.*?)@::1'
                     - 'CSeq: 2 BYE'
-                    - 'Contact: <sip:test@\[::1\]:5067;transport=UDP>'
+                    - 'Contact: <sip:test@[\[]?::1[\]]?:5067;transport=UDP>'
                     - 'Max-Forwards: 70'
                     - 'Subject: Test'
                     - 'Content-Length: 0'

-- 
To view, visit https://gerrit.asterisk.org/1378
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I747d45fc6537f9d4f92c62da2c6a44c758a05e9d
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list