[Asterisk-code-review] sipp, test suite utils: Default media port to an unused port (testsuite[13])

Corey Farrell asteriskteam at digium.com
Fri Mar 30 06:07:11 CDT 2018


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

Change subject: sipp, test_suite_utils: Default media port to an unused port
......................................................................


Patch Set 3: Code-Review-1

(3 comments)

https://gerrit.asterisk.org/#/c/8689/3/lib/python/asterisk/test_suite_utils.py
File lib/python/asterisk/test_suite_utils.py:

https://gerrit.asterisk.org/#/c/8689/3/lib/python/asterisk/test_suite_utils.py@220
PS3, Line 220: RESERVED_PORTS = [ 40000+i for i in range(10000)]
Static exclusion of 40,000-50,000?  Can you add a comment about why?

In addition this list is used for both IPV4 and IPV6.  Not sure that's necessarily a problem it just means that if we return ipv4 port 6000 this will block us from using ipv6 6000.


https://gerrit.asterisk.org/#/c/8689/3/lib/python/asterisk/test_suite_utils.py@286
PS3, Line 286:             ports = [port + i for i in range(step, num + 1, step)]
This tramples over the 'i' variable from 'for i in range(100):' , need to use a variable name that is not 'i'.  Maybe change the main loop to:
for attempt in range(100):


https://gerrit.asterisk.org/#/c/8689/3/lib/python/asterisk/test_suite_utils.py@295
PS3, Line 295:         RESERVED_PORTS.append(port)
I think we need a 'res = True' or similar here (initialized to False with port = 0).  I know it's unlikely but before 'return port' we should throw an exception if we failed to find any port, rather than just returning the last one found.



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

Gerrit-Project: testsuite
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I3da461123afc30e1f5ca12e65d289eaa42d6de00
Gerrit-Change-Number: 8689
Gerrit-PatchSet: 3
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Fri, 30 Mar 2018 11:07:11 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180330/376451a3/attachment-0001.html>


More information about the asterisk-code-review mailing list