<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/13583">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">test_config.py: Use faster method for checking IPv6 support in pjsua<br><br>When running `pjsua --help` there is a long delay after the command<br>completes while pjsua_destroy2() is executing. There does not seem to be<br>a combination of command line flags that will prevent that from occurring.<br><br>Instead, we grep the pjsua binary for the '--ipv6' command line flag<br>which would not be present if pjsua was not built with IPv6 support.<br><br>This shaves about 1 second off of a ./run-tests -l<br><br>Change-Id: I59071a363611dff192ef3df80ecd262184d1bbf2<br>---<br>M lib/python/asterisk/test_config.py<br>1 file changed, 3 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/83/13583/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/lib/python/asterisk/test_config.py b/lib/python/asterisk/test_config.py</span><br><span>index b395e63..12e150a 100644</span><br><span>--- a/lib/python/asterisk/test_config.py</span><br><span>+++ b/lib/python/asterisk/test_config.py</span><br><span>@@ -220,14 +220,11 @@</span><br><span>         To do this, we run pjsua --help and parse the output to determine if</span><br><span>         --ipv6 is a valid option</span><br><span>         """</span><br><span style="color: hsl(0, 100%, 40%);">-        if test_suite_utils.which('pjsua') is None:</span><br><span style="color: hsl(120, 100%, 40%);">+        pjsua_bin = test_suite_utils.which('pjsua')</span><br><span style="color: hsl(120, 100%, 40%);">+        if pjsua_bin is None:</span><br><span>             return False</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        help_output = subprocess.Popen(['pjsua', '--help'],</span><br><span style="color: hsl(0, 100%, 40%);">-                                       stdout=subprocess.PIPE).communicate()[0]</span><br><span style="color: hsl(0, 100%, 40%);">-        if help_output.find('--ipv6') == -1:</span><br><span style="color: hsl(0, 100%, 40%);">-            return False</span><br><span style="color: hsl(0, 100%, 40%);">-        return True</span><br><span style="color: hsl(120, 100%, 40%);">+        return subprocess.call(['grep', pjsua_bin, '-qe', '--ipv6']) == 0</span><br><span> </span><br><span>     def depend_fax(self):</span><br><span>         """Checks if Asterisk contains the necessary modules for fax tests"""</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/13583">change 13583</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/+/13583"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: I59071a363611dff192ef3df80ecd262184d1bbf2 </div>
<div style="display:none"> Gerrit-Change-Number: 13583 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>