<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/13270">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjsip/registration/outbound/failover - add test for checking SRV failover<br><br>ASTERISK-28624<br><br>Change-Id: I9e02a9d2e5a7973263939bcfb7fcee43b5af6f1e<br>---<br>A tests/channels/pjsip/registration/outbound/failover/configs/ast1/extensions.conf<br>A tests/channels/pjsip/registration/outbound/failover/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/registration/outbound/failover/configs/ast1/resolver_unbound.conf<br>A tests/channels/pjsip/registration/outbound/failover/dns_zones/example.com<br>A tests/channels/pjsip/registration/outbound/failover/sipp/uas-503.xml<br>A tests/channels/pjsip/registration/outbound/failover/sipp/uas-ignore.xml<br>A tests/channels/pjsip/registration/outbound/failover/test-config.yaml<br>M tests/channels/pjsip/registration/outbound/tests.yaml<br>8 files changed, 156 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/channels/pjsip/registration/outbound/failover/configs/ast1/extensions.conf b/tests/channels/pjsip/registration/outbound/failover/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..ab109a1</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/failover/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span>diff --git a/tests/channels/pjsip/registration/outbound/failover/configs/ast1/pjsip.conf b/tests/channels/pjsip/registration/outbound/failover/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..a614c27</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/failover/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,37 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[global]</span><br><span style="color: hsl(120, 100%, 40%);">+type=global</span><br><span style="color: hsl(120, 100%, 40%);">+debug=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[transport_udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind=0.0.0.0:5060</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[endpoint_t](!)</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[aor_t](!)</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[registration_t](!)</span><br><span style="color: hsl(120, 100%, 40%);">+type=registration</span><br><span style="color: hsl(120, 100%, 40%);">+transport=transport_udp</span><br><span style="color: hsl(120, 100%, 40%);">+server_uri=sip:example.com</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice](registration_t)</span><br><span style="color: hsl(120, 100%, 40%);">+client_uri=sip:alice@example.com</span><br><span style="color: hsl(120, 100%, 40%);">+contact_user=alice</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice](aor_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice](endpoint_t)</span><br><span style="color: hsl(120, 100%, 40%);">+aors=alice</span><br><span style="color: hsl(120, 100%, 40%);">+from_user=alice</span><br><span>diff --git a/tests/channels/pjsip/registration/outbound/failover/configs/ast1/resolver_unbound.conf b/tests/channels/pjsip/registration/outbound/failover/configs/ast1/resolver_unbound.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..38ef153</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/failover/configs/ast1/resolver_unbound.conf</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+nameserver = 127.0.0.1@10053</span><br><span style="color: hsl(120, 100%, 40%);">+resolv =</span><br><span>diff --git a/tests/channels/pjsip/registration/outbound/failover/dns_zones/example.com b/tests/channels/pjsip/registration/outbound/failover/dns_zones/example.com</span><br><span>new file mode 100644</span><br><span>index 0000000..9ac96ee</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/failover/dns_zones/example.com</span><br><span>@@ -0,0 +1,36 @@</span><br><span style="color: hsl(120, 100%, 40%);">+zone = [</span><br><span style="color: hsl(120, 100%, 40%);">+ SOA(</span><br><span style="color: hsl(120, 100%, 40%);">+ # For whom we are the authority</span><br><span style="color: hsl(120, 100%, 40%);">+ 'example.com',</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # This nameserver's name</span><br><span style="color: hsl(120, 100%, 40%);">+ mname = "ns1.example.com",</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Mailbox of individual who handles this</span><br><span style="color: hsl(120, 100%, 40%);">+ rname = "root.example.com",</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Unique serial identifying this SOA data</span><br><span style="color: hsl(120, 100%, 40%);">+ serial = 2003010601,</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Time interval before zone should be refreshed</span><br><span style="color: hsl(120, 100%, 40%);">+ refresh = "1H",</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Interval before failed refresh should be retried</span><br><span style="color: hsl(120, 100%, 40%);">+ retry = "1H",</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Upper limit on time interval before expiry</span><br><span style="color: hsl(120, 100%, 40%);">+ expire = "1H",</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Minimum TTL</span><br><span style="color: hsl(120, 100%, 40%);">+ minimum = "1H"</span><br><span style="color: hsl(120, 100%, 40%);">+ ),</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ SRV('_sip._udp.example.com', 0, 10, 5061, 'fast.pbx.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+ SRV('_sip._udp.example.com', 1, 0, 5062, 'slow.pbx.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ SRV('_sip._tcp.example.com', 0, 0, 5061, 'fast.pbx.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+ SRV('_sip._tcp.example.com', 1, 10, 5062, 'slow.pbx.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ A('fast.pbx.example.com', '127.0.0.1'),</span><br><span style="color: hsl(120, 100%, 40%);">+ A('slow.pbx.example.com', '127.0.0.1'),</span><br><span style="color: hsl(120, 100%, 40%);">+]</span><br><span>diff --git a/tests/channels/pjsip/registration/outbound/failover/sipp/uas-503.xml b/tests/channels/pjsip/registration/outbound/failover/sipp/uas-503.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..2baa1fd</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/failover/sipp/uas-503.xml</span><br><span>@@ -0,0 +1,19 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive REGISTER, immediately reject with a 503"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="REGISTER" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 503 Service Unavailable</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/registration/outbound/failover/sipp/uas-ignore.xml b/tests/channels/pjsip/registration/outbound/failover/sipp/uas-ignore.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..c4d1441</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/failover/sipp/uas-ignore.xml</span><br><span>@@ -0,0 +1,22 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive REGISTER"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="REGISTER" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Expires:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/registration/outbound/failover/test-config.yaml b/tests/channels/pjsip/registration/outbound/failover/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..b8865dd</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/failover/test-config.yaml</span><br><span>@@ -0,0 +1,37 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test SRV failover for outbound registration'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ Using a SIP outbound registration, this test verifies that an SRV</span><br><span style="color: hsl(120, 100%, 40%);">+ record lookup resulting in multiple results will successfully fail</span><br><span style="color: hsl(120, 100%, 40%);">+ over to other records if previous ones do not respond.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: dns-server-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'dns_server.DNSServer'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': {'scenario': 'uas-503.xml', '-i': '127.0.0.1', '-p': '5061'} }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': {'scenario': 'uas-ignore.xml', '-i': '127.0.0.1', '-p': '5062'} }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+dns-server-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ python-zones:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ example.com</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_outbound_registration'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_resolver_unbound'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span>diff --git a/tests/channels/pjsip/registration/outbound/tests.yaml b/tests/channels/pjsip/registration/outbound/tests.yaml</span><br><span>index 07e2fd9..c0e9dd3 100644</span><br><span>--- a/tests/channels/pjsip/registration/outbound/tests.yaml</span><br><span>+++ b/tests/channels/pjsip/registration/outbound/tests.yaml</span><br><span>@@ -2,6 +2,7 @@</span><br><span> tests:</span><br><span> - dir: 'unregister'</span><br><span> - test: 'auth_loop'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'failover'</span><br><span> - test: 'fatal_retry'</span><br><span> - test: 'forbidden_retry'</span><br><span> - test: 'interval_too_brief'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/13270">change 13270</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/c/testsuite/+/13270"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 17 </div>
<div style="display:none"> Gerrit-Change-Id: I9e02a9d2e5a7973263939bcfb7fcee43b5af6f1e </div>
<div style="display:none"> Gerrit-Change-Number: 13270 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>