[Asterisk-code-review] sipp.py: Disable retransmissions (testsuite[13])

Jenkins2 asteriskteam at digium.com
Mon Apr 2 10:19:13 CDT 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/8686 )

Change subject: sipp.py: Disable retransmissions
......................................................................

sipp.py: Disable retransmissions

The majority of SIPp based tests do not need re-transmissions enabled. In these
cases if a re-transmission occurred and there was no packet loss then Asterisk
would respond twice, thus usually failing the test (this was the cause of
several sporadic test failures).

This patch disables re-transmissions for all SIPp based tests by default. If a
test does need SIPp to send re-transmissions then the test needs to specify the
something like the following ordered argument in the scenario's configuration:

  'ordered-args': ['-enable-retrans']

Two tests appear to fail unless re-transmissions are enabled. This patch
modifies the configuration for those two tests in order to allow 'retrans':

tests/channels/pjsip/qualify/qualify_timeout/
tests/channels/pjsip/basic_calls/outgoing/off-nominal/bob_does_not_exist/

Change-Id: I9bc9fec227c9f11015e87d46abca91e926af3ffd
---
M lib/python/asterisk/sipp.py
M tests/channels/pjsip/basic_calls/outgoing/off-nominal/bob_does_not_exist/test-config.yaml
M tests/channels/pjsip/qualify/qualify_timeout/test-config.yaml
3 files changed, 14 insertions(+), 4 deletions(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/lib/python/asterisk/sipp.py b/lib/python/asterisk/sipp.py
index acdb20d..6da3108 100644
--- a/lib/python/asterisk/sipp.py
+++ b/lib/python/asterisk/sipp.py
@@ -673,7 +673,17 @@
 
         for (key, val) in default_args.items():
             sipp_args.extend([key, val])
-        sipp_args.extend(self.positional_args)
+
+        # The majority of tests do no need re-transmissions enabled. As a
+        # matter of fact most tests will fail if sipp re-transmits a message.
+        # By default disable all re-transmissions in a scenario unless
+        # explicitly told to allow them.
+        if '-enable-retrans' in self.positional_args:
+            sipp_args.extend(
+                [i for i in self.positional_args if i != '-enable-retrans'])
+        else:
+            sipp_args.append('-nr')
+            sipp_args.extend(self.positional_args)
 
         LOGGER.info("Executing SIPp scenario: %s" % self.scenario['scenario'])
         LOGGER.debug(sipp_args)
diff --git a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/bob_does_not_exist/test-config.yaml b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/bob_does_not_exist/test-config.yaml
index b6909c6..72720c0 100644
--- a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/bob_does_not_exist/test-config.yaml
+++ b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/bob_does_not_exist/test-config.yaml
@@ -33,9 +33,9 @@
    test-iterations:
        -
            scenarios:
-               - { 'key-args': {'scenario': 'receive.xml', '-i': '127.0.0.1', '-p': '5062', '-s': 'bob-ipv4-udp'} }
+               - { 'key-args': {'scenario': 'receive.xml', '-i': '127.0.0.1', '-p': '5062', '-s': 'bob-ipv4-udp'}, 'ordered-args': ['-enable-retrans'] }
                - { 'key-args': {'scenario': 'receive.xml', '-i': '127.0.0.1', '-p': '5063', '-t': 't1', '-s': 'bob-ipv4-tcp'} }
-               - { 'target': '[::1]', 'key-args': {'scenario': 'receive.xml', '-i': '[::1]', '-p': '5064', '-s': 'bob-ipv6-udp'} }
+               - { 'target': '[::1]', 'key-args': {'scenario': 'receive.xml', '-i': '[::1]', '-p': '5064', '-s': 'bob-ipv6-udp'}, 'ordered-args': ['-enable-retrans'] }
                - { 'target': '[::1]', 'key-args': {'scenario': 'receive.xml', '-i': '[::1]', '-p': '5065', '-t': 't1', '-s': 'bob-ipv6-tcp'} }
 
 originator-config-ipv4-udp:
diff --git a/tests/channels/pjsip/qualify/qualify_timeout/test-config.yaml b/tests/channels/pjsip/qualify/qualify_timeout/test-config.yaml
index 1252ce6..ad4fb55 100644
--- a/tests/channels/pjsip/qualify/qualify_timeout/test-config.yaml
+++ b/tests/channels/pjsip/qualify/qualify_timeout/test-config.yaml
@@ -19,7 +19,7 @@
     test-iterations:
         -
             scenarios:
-                - { 'key-args': {'scenario': 'options.xml', '-i': '127.0.0.1', '-d': '10000', '-p': '5061'} }
+                - { 'key-args': {'scenario': 'options.xml', '-i': '127.0.0.1', '-d': '10000', '-p': '5061'}, 'ordered-args': ['-enable-retrans'] }
 
 ami-config-13.5:
     -

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

Gerrit-Project: testsuite
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I9bc9fec227c9f11015e87d46abca91e926af3ffd
Gerrit-Change-Number: 8686
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180402/e8df22e4/attachment-0001.html>


More information about the asterisk-code-review mailing list