[Asterisk-code-review] Certify libsrtp2: Changes in Testsuite to certify libsrtp2 (testsuite[16])

Corey Farrell asteriskteam at digium.com
Fri Nov 2 06:33:15 CDT 2018


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/10580 )

Change subject: Certify_libsrtp2: Changes in Testsuite to certify libsrtp2
......................................................................


Patch Set 1: Code-Review-1

> Hi Corey. Changing line 54 from new_PYTHONPATH.append() to
 > .insert() doesn't seem to fix the issue.
 > 
 > The error I encountered was:
 > 
 > File "./runtests.py", line 56, in <module>
 > from asterisk.asterisk import Asterisk
 > ImportError: No module named asterisk
 > 
 > In my case, the error was triggered cause sys.path.append("lib/python")
 > puts lib/python at the end of the list:
 > >>> sys.path
 > ['','/usr/lib64/python2.7/site-packages','lib/python']
 > 
 > whereas sys.path.insert(1,"lib/python") puts it at the front:
 > >>> sys.path
 > ['','lib/python','/usr/lib64/python2.7/site-packages']
 > 
 > Because I also happened to have a python packaged called asterisk
 > at /usr/lib64/python2.7/site-packages, python picked it up first,
 > triggering the complaint. Line 56 is using the path from sys.path
 > for the "import" command, not from new_PYTHONPATH, therefore I
 > thought it better not to touch it.

I'm suggesting that both places should be modified in the same way.  I think my comment only matter if system environment PYTHONPATH is set and an 'asterisk' module is found within it.  Say system environment PYTHONPATH=/usr/local/mypython.  Python prepends this to the built-in sys.path. So your change would cause runtests.py to end up with sys.path:
['','lib/python','/usr/local/mypython','/usr/lib64/python2.7/site-packages']

But the actual test processes would see:
['','/usr/local/mypython','lib/python','/usr/lib64/python2.7/site-packages']


-- 
To view, visit https://gerrit.asterisk.org/10580
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 16
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie7e7f4b1937676f033de8e7f9459594c2a7fcacc
Gerrit-Change-Number: 10580
Gerrit-PatchSet: 1
Gerrit-Owner: Chris Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: Chris Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Comment-Date: Fri, 02 Nov 2018 11:33:15 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181102/9f63d84b/attachment-0001.html>


More information about the asterisk-code-review mailing list