<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/13579">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
  Friendly Automation: Approved for Submit

</div><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, 5 insertions(+), 8 deletions(-)<br><br></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..6a0a13d 100644</span><br><span>--- a/lib/python/asterisk/test_config.py</span><br><span>+++ b/lib/python/asterisk/test_config.py</span><br><span>@@ -217,17 +217,14 @@</span><br><span>     def depend_pjsuav6(self):</span><br><span>         """This tests if pjsua was compiled with IPv6 support.</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        To do this, we run pjsua --help and parse the output to determine if</span><br><span style="color: hsl(0, 100%, 40%);">-        --ipv6 is a valid option</span><br><span style="color: hsl(120, 100%, 40%);">+        To do this, we check if the '--ipv6' command line flag is present</span><br><span style="color: hsl(120, 100%, 40%);">+        in the pjsua binary</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/+/13579">change 13579</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/+/13579"/><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-Change-Id: I59071a363611dff192ef3df80ecd262184d1bbf2 </div>
<div style="display:none"> Gerrit-Change-Number: 13579 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.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: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>