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 2017/07/05 14:14:30 UTC
[trafficserver] branch master updated: Add new logic for copy of
Plugin and Bin directory
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 e7b5a59 Add new logic for copy of Plugin and Bin directory
e7b5a59 is described below
commit e7b5a5988885a86a78b4d48de379f14ec9aea1f4
Author: Unknown <dr...@live.com>
AuthorDate: Fri Jun 30 16:15:50 2017 -0500
Add new logic for copy of Plugin and Bin directory
New copy logic should avoid root permission issue without forcing a copy of dtata
Add sbin path as it missing on some CI setups
---
tests/gold_tests/autest-site/init.cli.ext | 8 +-------
tests/gold_tests/autest-site/ports.py | 11 ++++++++++-
tests/gold_tests/autest-site/trafficserver.test.ext | 17 ++++++++++-------
3 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/tests/gold_tests/autest-site/init.cli.ext b/tests/gold_tests/autest-site/init.cli.ext
index 3774705..24f84cd 100644
--- a/tests/gold_tests/autest-site/init.cli.ext
+++ b/tests/gold_tests/autest-site/init.cli.ext
@@ -23,13 +23,7 @@ if sys.version_info < (3, 5, 0):
host.WriteError(
"You need python 3.5 or later to run these tests\n", show_stack=False)
-try:
- AuTestVersion()
-except:
- host.WriteError(
- "Tests need AuTest version 1.3.4 or better\n Please update AuTest:\n pip install --upgrade autest\n", show_stack=False)
-
-if AuTestVersion() < "1.3.4":
+if AuTestVersion() < "1.3.5":
host.WriteError(
"Tests need AuTest version 1.3.4 or better\n Please update AuTest:\n pip install --upgrade autest\n", show_stack=False)
diff --git a/tests/gold_tests/autest-site/ports.py b/tests/gold_tests/autest-site/ports.py
index d999b2f..1f26e7e 100644
--- a/tests/gold_tests/autest-site/ports.py
+++ b/tests/gold_tests/autest-site/ports.py
@@ -18,6 +18,9 @@
import socket
import subprocess
+import os
+
+import hosts.output as host
try:
import queue as Queue
@@ -55,11 +58,17 @@ def setup_port_queue(amount=1000):
else:
return
try:
+ # 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"]).decode().split("=")[1].split()
+ ["sysctl", "net.ipv4.ip_local_port_range"],
+ env=new_env
+ ).decode().split("=")[1].split()
dmin = int(dmin)
dmax = int(dmax)
except:
+ host.WriteWarning("Unable to call sysctrl!\n Tests may fail because of bad port selection!")
return
rmin = dmin - 2000
diff --git a/tests/gold_tests/autest-site/trafficserver.test.ext b/tests/gold_tests/autest-site/trafficserver.test.ext
index c84736f..b1a4e4f 100755
--- a/tests/gold_tests/autest-site/trafficserver.test.ext
+++ b/tests/gold_tests/autest-site/trafficserver.test.ext
@@ -42,19 +42,19 @@ def MakeATSProcess(obj, name, command='traffic_server', select_ports=True):
# configuration directory
config_dir = os.path.join(ts_dir, 'config')
-
+
# directory contains the html response templates
template_dir = os.path.join(config_dir, 'body_factory')
-
+
# contains plugins
plugin_dir = os.path.join(ts_dir, 'plugin')
-
+
# the log directory
log_dir = os.path.join(ts_dir, 'log')
-
+
# runtime dir
runtime_dir = os.path.join(ts_dir, 'runtime')
-
+
#ssl, storage & cache
ssl_dir = os.path.join(ts_dir, 'ssl')
storage_dir = os.path.join(ts_dir, 'storage')
@@ -62,6 +62,9 @@ def MakeATSProcess(obj, name, command='traffic_server', select_ports=True):
# create process
p = obj.Processes.Process(name, command)
+ #p_debug = obj.Processes.Process("port-debug", "ss --listen --tcp --process")
+ #p_debug.Env['PATH'] = "/usr/sbin" + os.pathsep + p.ComposeEnv()['PATH']
+ #p.StartBefore(p_debug)
# we want to have a few directories more fixed
# this helps with debugging as location are common
# we do this by overiding locations from the "layout"
@@ -79,7 +82,7 @@ def MakeATSProcess(obj, name, command='traffic_server', select_ports=True):
p.Env['PROXY_CONFIG_BIN_PATH'] = bin_dir
bin_path = os.path.join(ts_dir, bin_dir)
p.Env['PATH'] = bin_path + os.pathsep + p.ComposeEnv()['PATH']
- p.Setup.Copy(p.Variables.BINDIR, bin_path, True)
+ p.Setup.Copy(p.Variables.BINDIR, bin_path, CopyLogic.SoftFiles)
# setup config directory
@@ -112,7 +115,7 @@ def MakeATSProcess(obj, name, command='traffic_server', select_ports=True):
# setup read-only data directory for plugins
p.Env['PROXY_CONFIG_PLUGIN_PLUGIN_DIR'] = plugin_dir
- p.Setup.Copy(p.Variables.PLUGINDIR, plugin_dir, True)
+ p.Setup.Copy(p.Variables.PLUGINDIR, plugin_dir, CopyLogic.SoftFiles)
#########################################################
# create subdirectories that need to exist (but are empty)
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].