You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by dr...@apache.org on 2018/01/05 15:37:42 UTC
[trafficserver] branch master updated: Add fix to select ports
better on the Mac based on PR 2832
This is an automated email from the ASF dual-hosted git repository.
dragon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new b90e119 Add fix to select ports better on the Mac based on PR 2832
b90e119 is described below
commit b90e119f25075bf2a4f2ca402570604ca0b131fe
Author: Jason Kenny <dr...@live.com>
AuthorDate: Thu Dec 21 15:34:52 2017 -0600
Add fix to select ports better on the Mac based on PR 2832
---
tests/gold_tests/autest-site/ports.py | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/tests/gold_tests/autest-site/ports.py b/tests/gold_tests/autest-site/ports.py
index b8cf8bf..7932be8 100644
--- a/tests/gold_tests/autest-site/ports.py
+++ b/tests/gold_tests/autest-site/ports.py
@@ -19,6 +19,7 @@
import socket
import subprocess
import os
+import platform
import hosts.output as host
@@ -61,10 +62,20 @@ def setup_port_queue(amount=1000):
# some docker setups don't have sbin setup correctly
new_env = os.environ.copy()
new_env['PATH'] = "/sbin:/usr/sbin:" + new_env['PATH']
- dmin, dmax = subprocess.check_output(
- ["sysctl", "net.ipv4.ip_local_port_range"],
- env=new_env
- ).decode().split("=")[1].split()
+ if 'Darwin' == platform.system():
+ dmin = subprocess.check_output(
+ ["sysctl", "net.inet.ip.portrange.first"],
+ env=new_env
+ ).decode().split(":")[1].split()[0]
+ dmax = subprocess.check_output(
+ ["sysctl", "net.inet.ip.portrange.last"],
+ env=new_env
+ ).decode().split(":")[1].split()[0]
+ else:
+ dmin, dmax = subprocess.check_output(
+ ["sysctl", "net.ipv4.ip_local_port_range"],
+ env=new_env
+ ).decode().split("=")[1].split()
dmin = int(dmin)
dmax = int(dmax)
except:
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].