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

Corey Farrell asteriskteam at digium.com
Wed Mar 28 16:24:54 CDT 2018


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

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


Patch Set 1:

> > Has this been verified against tests with multiple instances of
 > > sipp?  What would stop test_suite_utils.py from returning the
 > same
 > > point multiple times?  That is if step 1 we find multiple ports,
 > > then step 2 we start multiple instances of sipp.
 > 
 > I tested it against a few different tests including
 > "tests/channels/pjsip/incoming_calls_without_auth" which starts up
 > 28 scenarios. Note, for that test I change all the scenario xml
 > files to use [media_port] instead of the hard coded value before
 > testing.
 > 
 > The OS handles whether or not the port is available, but I think
 > you are saying that there possibly exists a window between us
 > getting the port and from when we bind to it right? Which, I
 > believe you are correct.

My concern was/is that get_available_port binds a socket, gets the port, closes the socket, then returns the port.  What would stop the very next call to get_available_port from returning the same port?  I think this assumes that s.bind('', 0) will not bind the same port twice in a row?

In any case I wonder if maybe the appropriate fix is to patch sipp itself?


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

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3da461123afc30e1f5ca12e65d289eaa42d6de00
Gerrit-Change-Number: 8691
Gerrit-PatchSet: 1
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: Wed, 28 Mar 2018 21:24:54 +0000
Gerrit-HasComments: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180328/e2b44b64/attachment.html>


More information about the asterisk-code-review mailing list