You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2019/11/08 21:33:03 UTC

[trafficserver] branch 9.0.x updated (25db8be -> 6088d51)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a change to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


    from 25db8be  thread ready check
     new 61697bb  tests: Cleans up local variable is assigned to but never used warnings
     new 27f0af2  Add AUTest using h2spec
     new 712e1b9  Allow txn handler to be set from ssn on same hook
     new 6088d51  tests: Cleans up imported but unused imports

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 proxy/InkAPIInternal.h                             |   5 +-
 src/traffic_server/InkAPI.cc                       |   9 +-
 tests/gold_tests/autest-site/curl_header.test.ext  |   1 -
 tests/gold_tests/autest-site/init.cli.ext          |   5 +-
 tests/gold_tests/autest-site/microDNS.test.ext     |   4 +-
 tests/gold_tests/autest-site/microserver.test.ext  |  11 +-
 .../gold_tests/autest-site/traffic_replay.test.ext |   4 +-
 .../gold_tests/autest-site/trafficserver.test.ext  |   5 +-
 tests/gold_tests/basic/config.test.py              |   1 -
 tests/gold_tests/basic/copy_config.test.py         |   2 +-
 tests/gold_tests/basic/deny0.test.py               |   1 -
 tests/gold_tests/cache/cache-control.test.py       |   3 +-
 .../chunked_encoding/chunked_encoding.test.py      |   1 -
 tests/gold_tests/continuations/double.test.py      |   4 +-
 tests/gold_tests/continuations/double_h2.test.py   |   4 +-
 tests/gold_tests/continuations/openclose.test.py   |   4 +-
 tests/gold_tests/h2/gold/h2spec_stdout.gold        |   3 +
 tests/gold_tests/h2/h2active_timeout.py            |   1 -
 tests/gold_tests/h2/h2bigclient.py                 |   2 -
 tests/gold_tests/h2/h2chunked.py                   |   2 -
 tests/gold_tests/h2/h2client.py                    |   2 -
 tests/gold_tests/h2/h2disable.test.py              |   1 -
 .../h2/h2disable_no_accept_threads.test.py         |   1 -
 tests/gold_tests/h2/h2enable.test.py               |   1 -
 .../h2/h2enable_no_accept_threads.test.py          |   1 -
 tests/gold_tests/h2/h2spec.test.py                 |  78 ++++++++++++
 tests/gold_tests/h2/http2_priority.test.py         |   6 +-
 .../gold_tests/headers/cache_and_req_body.test.py  |   1 -
 tests/gold_tests/headers/cachedIMSRange.test.py    |   2 -
 tests/gold_tests/headers/forwarded-observer.py     |   1 -
 tests/gold_tests/headers/forwarded.test.py         |   1 -
 tests/gold_tests/headers/hsts.test.py              |   1 -
 tests/gold_tests/headers/http408.test.py           |   1 -
 tests/gold_tests/headers/normalize_ae.test.py      |   1 -
 tests/gold_tests/headers/syntax.test.py            |   1 -
 tests/gold_tests/headers/via.test.py               |   1 -
 tests/gold_tests/logging/all_headers.test.py       |   1 -
 tests/gold_tests/logging/ccid_ctid.test.py         |   1 -
 tests/gold_tests/logging/log-filter.test.py        |   9 +-
 .../client_context_dump.test.py                    |   2 -
 .../pluginTest/compress/compress.test.py           |   2 -
 .../header_rewrite/header_rewrite.test.py          |   1 -
 .../pluginTest/multiplexer/multiplexer.test.py     |   1 -
 tests/gold_tests/pluginTest/slice/slice.test.py    |   2 -
 .../pluginTest/slice/slice_error.test.py           |   2 -
 .../gold_tests/pluginTest/test_hooks/hook_add.gold |   7 ++
 .../{test_hooks.test.py => hook_add.test.py}       |  51 ++------
 .../gold_tests/pluginTest/url_sig/url_sig.test.py  |   3 +-
 tests/gold_tests/redirect/redirect_post.test.py    |   1 -
 tests/gold_tests/remap/remap_http.test.py          |   1 -
 tests/gold_tests/remap/remap_https.test.py         |   1 -
 tests/gold_tests/runroot/runroot_error.test.py     |   2 -
 tests/gold_tests/runroot/runroot_init.test.py      |   2 -
 tests/gold_tests/runroot/runroot_manager.test.py   |   2 -
 tests/gold_tests/runroot/runroot_remove.test.py    |   2 -
 tests/gold_tests/runroot/runroot_use.test.py       |   2 -
 tests/gold_tests/runroot/runroot_verify.test.py    |   2 -
 .../gold_tests/thread_config/thread_100_0.test.py  |   2 -
 .../gold_tests/thread_config/thread_100_1.test.py  |   2 -
 .../gold_tests/thread_config/thread_100_10.test.py |   2 -
 tests/gold_tests/thread_config/thread_1_0.test.py  |   2 -
 tests/gold_tests/thread_config/thread_1_1.test.py  |   2 -
 tests/gold_tests/thread_config/thread_1_10.test.py |   2 -
 tests/gold_tests/thread_config/thread_2_0.test.py  |   2 -
 tests/gold_tests/thread_config/thread_2_1.test.py  |   2 -
 tests/gold_tests/thread_config/thread_2_10.test.py |   2 -
 tests/gold_tests/thread_config/thread_32_0.test.py |   2 -
 tests/gold_tests/thread_config/thread_32_1.test.py |   2 -
 .../gold_tests/thread_config/thread_32_10.test.py  |   2 -
 tests/gold_tests/tls/tls.test.py                   |   1 -
 .../tls/tls_check_cert_selection.test.py           |   1 -
 tests/gold_tests/tls/tls_client_cert.test.py       |   2 -
 tests/gold_tests/tls/tls_client_cert2.test.py      |   3 -
 .../tls/tls_client_cert_override.test.py           |   3 -
 tests/gold_tests/tls/tls_client_verify.test.py     |   3 -
 tests/gold_tests/tls/tls_client_verify2.test.py    |   3 -
 tests/gold_tests/tls/tls_client_versions.test.py   |   1 -
 .../gold_tests/tls/tls_hooks_client_verify.test.py |   1 -
 tests/gold_tests/tls/tls_hooks_verify.test.py      |   1 -
 tests/gold_tests/tls/tls_keepalive.test.py         |   1 -
 tests/gold_tests/tls/tls_session_cache.test.py     |   1 -
 tests/gold_tests/tls/tls_ticket.test.py            |   2 -
 tests/gold_tests/tls/tls_tunnel.test.py            |   1 -
 tests/gold_tests/tls/tls_tunnel_forward.test.py    |   1 -
 tests/gold_tests/tls/tls_verify.test.py            |   1 -
 tests/gold_tests/tls/tls_verify2.test.py           |   1 -
 tests/gold_tests/tls/tls_verify3.test.py           |   1 -
 tests/gold_tests/tls/tls_verify_base.test.py       |   1 -
 .../gold_tests/tls/tls_verify_ca_override.test.py  |   1 -
 .../gold_tests/tls/tls_verify_not_pristine.test.py |   1 -
 tests/gold_tests/tls/tls_verify_override.test.py   |   1 -
 .../tls/tls_verify_override_base.test.py           |   1 -
 tests/gold_tests/tls_hooks/tls_hooks10.test.py     |   1 -
 tests/gold_tests/tls_hooks/tls_hooks12.test.py     |   1 -
 tests/gold_tests/tls_hooks/tls_hooks13.test.py     |   1 -
 tests/gold_tests/tls_hooks/tls_hooks14.test.py     |   1 -
 tests/gold_tests/tls_hooks/tls_hooks15.test.py     |   1 -
 tests/tools/plugins/hook_add_plugin.cc             | 140 +++++++++++++++++++++
 98 files changed, 271 insertions(+), 200 deletions(-)
 create mode 100644 tests/gold_tests/h2/gold/h2spec_stdout.gold
 create mode 100644 tests/gold_tests/h2/h2spec.test.py
 create mode 100644 tests/gold_tests/pluginTest/test_hooks/hook_add.gold
 copy tests/gold_tests/pluginTest/test_hooks/{test_hooks.test.py => hook_add.test.py} (52%)
 create mode 100644 tests/tools/plugins/hook_add_plugin.cc


[trafficserver] 02/04: Add AUTest using h2spec

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 27f0af2b57e399cc7c352ffce7e9c42ca66dbccd
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Fri Jun 14 11:17:09 2019 +0900

    Add AUTest using h2spec
    
    (cherry picked from commit 097017d7122d7b1ba82bfe5ea92f85ab7a17599b)
---
 tests/gold_tests/h2/gold/h2spec_stdout.gold |  3 ++
 tests/gold_tests/h2/h2spec.test.py          | 83 +++++++++++++++++++++++++++++
 2 files changed, 86 insertions(+)

diff --git a/tests/gold_tests/h2/gold/h2spec_stdout.gold b/tests/gold_tests/h2/gold/h2spec_stdout.gold
new file mode 100644
index 0000000..02732ee
--- /dev/null
+++ b/tests/gold_tests/h2/gold/h2spec_stdout.gold
@@ -0,0 +1,3 @@
+``
+Finished in `` seconds
+`` tests, `` passed, 0 skipped, 0 failed
diff --git a/tests/gold_tests/h2/h2spec.test.py b/tests/gold_tests/h2/h2spec.test.py
new file mode 100644
index 0000000..a188e80
--- /dev/null
+++ b/tests/gold_tests/h2/h2spec.test.py
@@ -0,0 +1,83 @@
+'''
+Test HTTP/2 with h2spec
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+import os
+
+# ----
+# Setup Test
+# ----
+Test.Summary = '''
+Test HTTP/2 with httpspec
+'''
+
+Test.SkipUnless(
+    Condition.HasProgram("h2spec", "h2spec need to be installed on system for this test to work"),
+)
+Test.ContinueOnFail = True
+
+# ----
+# Setup httpbin Origin Server
+# ----
+httpbin = Test.MakeHttpBinServer("httpbin")
+
+# ----
+# Setup ATS
+# ----
+ts = Test.MakeATSProcess("ts", select_ports=False)
+
+# add ssl materials like key, certificates for the server
+ts.addSSLfile("ssl/server.pem")
+ts.addSSLfile("ssl/server.key")
+
+ts.Variables.ssl_port = 4443
+ts.Disk.remap_config.AddLine(
+    'map / http://127.0.0.1:{0}'.format(httpbin.Variables.Port)
+)
+ts.Disk.ssl_multicert_config.AddLine(
+    'dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key'
+)
+ts.Disk.records_config.update({
+    'proxy.config.http.server_ports': '{0} {1}:ssl'.format(ts.Variables.port, ts.Variables.ssl_port),
+    'proxy.config.http.insert_request_via_str': 1,
+    'proxy.config.http.insert_response_via_str': 1,
+    'proxy.config.http.cache.http': 0,
+    'proxy.config.ssl.server.cert.path': '{0}'.format(ts.Variables.SSLDir),
+    'proxy.config.ssl.server.private_key.path': '{0}'.format(ts.Variables.SSLDir),
+    'proxy.config.ssl.client.verify.server':  0,
+    'proxy.config.diags.debug.enabled': 1,
+    'proxy.config.diags.debug.tags': 'http2',
+})
+
+# ----
+# Test Cases
+# ----
+
+# Known broken tests are left out (http2/6.4. and http2/6.9.)
+h2spec_targets = "http2/1 http2/2 http2/3 http2/4 http2/5 http2/6.1 http2/6.2 http2/6.3 http2/6.5 http2/6.6 http2/6.7 http2/6.8 http2/7 http2/8 hpack"
+
+test_run = Test.AddTestRun()
+test_run.Processes.Default.Command = 'h2spec {0} -t -k -p {1}'.format(h2spec_targets, ts.Variables.ssl_port)
+test_run.Processes.Default.ReturnCode = 0
+test_run.Processes.Default.StartBefore(httpbin, ready=When.PortOpen(httpbin.Variables.Port))
+test_run.Processes.Default.StartBefore(Test.Processes.ts, ready=When.PortOpen(ts.Variables.ssl_port))
+test_run.Processes.Default.Streams.stdout = "gold/h2spec_stdout.gold"
+test_run.StillRunningAfter = httpbin
+
+# Over riding the built in ERROR check since we expect some error cases
+ts.Disk.diags_log.Content = Testers.ContainsExpression("ERROR: HTTP/2", "h2spec tests should have error log")


[trafficserver] 01/04: tests: Cleans up local variable is assigned to but never used warnings

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 61697bbc96ce3c57048f93bd5c6f6c46d1814ca1
Author: Randall Meyer <rr...@apache.org>
AuthorDate: Mon Nov 4 18:42:57 2019 -0800

    tests: Cleans up local variable is assigned to but never used warnings
    
    (cherry picked from commit 61cce69983283a9613cafb8867e53b8595465efe)
---
 tests/gold_tests/h2/h2bigclient.py      | 1 -
 tests/gold_tests/h2/h2chunked.py        | 1 -
 tests/gold_tests/h2/h2client.py         | 1 -
 tests/gold_tests/tls/tls_ticket.test.py | 1 -
 4 files changed, 4 deletions(-)

diff --git a/tests/gold_tests/h2/h2bigclient.py b/tests/gold_tests/h2/h2bigclient.py
index 6e0cec8..8bc6a06 100644
--- a/tests/gold_tests/h2/h2bigclient.py
+++ b/tests/gold_tests/h2/h2bigclient.py
@@ -43,7 +43,6 @@ def makerequest(port):
     # Fetch the object twice so we know at least one time comes from cache
     # Exploring timing options
     sites = ['/bigfile', '/bigfile']
-    responses = []
     request_ids = []
     for site in sites:
         request_id = conn.request('GET', url=site)
diff --git a/tests/gold_tests/h2/h2chunked.py b/tests/gold_tests/h2/h2chunked.py
index 8b1d051..e929450 100644
--- a/tests/gold_tests/h2/h2chunked.py
+++ b/tests/gold_tests/h2/h2chunked.py
@@ -41,7 +41,6 @@ def makerequest(port, _url):
     conn = HTTPConnection('localhost:{0}'.format(port), secure=True)
 
     sites = {'/'}
-    responses = []
     request_ids = []
     for site in sites:
         request_id = conn.request('GET', url=_url)
diff --git a/tests/gold_tests/h2/h2client.py b/tests/gold_tests/h2/h2client.py
index df0d19f..5042965 100644
--- a/tests/gold_tests/h2/h2client.py
+++ b/tests/gold_tests/h2/h2client.py
@@ -41,7 +41,6 @@ def makerequest(port):
     conn = HTTPConnection('localhost:{0}'.format(port), secure=True)
 
     sites = {'/'}
-    responses = []
     request_ids = []
     for site in sites:
         request_id = conn.request('GET', url=site)
diff --git a/tests/gold_tests/tls/tls_ticket.test.py b/tests/gold_tests/tls/tls_ticket.test.py
index 4d34ddb..d26e14d 100644
--- a/tests/gold_tests/tls/tls_ticket.test.py
+++ b/tests/gold_tests/tls/tls_ticket.test.py
@@ -95,7 +95,6 @@ def checkSession(ev) :
 
   f1Content = f1.read()
   f2Content = f2.read()
-  sessRegex = re.compile('Session-ID: ([0-9A-F]+)')
   match1 = re.findall('Session-ID: ([0-9A-F]+)', f1Content)
   match2 = re.findall('Session-ID: ([0-9A-F]+)', f2Content)
 


[trafficserver] 03/04: Allow txn handler to be set from ssn on same hook

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 712e1b9a340380e0aab45b6e7033557e37d85b13
Author: Susan Hinrichs <sh...@oath.com>
AuthorDate: Fri Oct 25 20:28:33 2019 +0000

    Allow txn handler to be set from ssn on same hook
    
    (cherry picked from commit be2102e4b2874e69823bee5e14f7f644f65cb501)
---
 proxy/InkAPIInternal.h                             |   5 +-
 src/traffic_server/InkAPI.cc                       |   9 +-
 .../gold_tests/pluginTest/test_hooks/hook_add.gold |   7 ++
 .../pluginTest/test_hooks/hook_add.test.py         |  57 +++++++++
 tests/tools/plugins/hook_add_plugin.cc             | 140 +++++++++++++++++++++
 5 files changed, 214 insertions(+), 4 deletions(-)

diff --git a/proxy/InkAPIInternal.h b/proxy/InkAPIInternal.h
index 25fab38..4a90f35 100644
--- a/proxy/InkAPIInternal.h
+++ b/proxy/InkAPIInternal.h
@@ -357,8 +357,9 @@ public:
 protected:
   /// Track the state of one scope of hooks.
   struct Scope {
-    APIHook const *_c; ///< Current hook (candidate for invocation).
-    APIHook const *_p; ///< Previous hook (already invoked).
+    APIHook const *_c;      ///< Current hook (candidate for invocation).
+    APIHook const *_p;      ///< Previous hook (already invoked).
+    APIHooks const *_hooks; ///< Reference to the real hook list
 
     /// Initialize the scope.
     void init(HttpAPIHooks const *scope, TSHttpHookID id);
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index fb910e0..b508e03 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -1426,16 +1426,21 @@ HttpHookState::is_enabled()
 void
 HttpHookState::Scope::init(HttpAPIHooks const *feature_hooks, TSHttpHookID id)
 {
-  APIHooks const *hooks = (*feature_hooks)[id];
+  _hooks = (*feature_hooks)[id];
 
   _p = nullptr;
-  _c = hooks->head();
+  _c = _hooks->head();
 }
 
 APIHook const *
 HttpHookState::Scope::candidate()
 {
   /// Simply returns _c hook for now. Later will do priority checking here
+
+  // Check to see if a hook has been added since this was initialized empty
+  if (nullptr == _c && nullptr == _p && _hooks != nullptr) {
+    _c = _hooks->head();
+  }
   return _c;
 }
 
diff --git a/tests/gold_tests/pluginTest/test_hooks/hook_add.gold b/tests/gold_tests/pluginTest/test_hooks/hook_add.gold
new file mode 100644
index 0000000..9141bac
--- /dev/null
+++ b/tests/gold_tests/pluginTest/test_hooks/hook_add.gold
@@ -0,0 +1,7 @@
+`` DIAG: (test)  -- globalHandler :: TS_EVENT_HTTP_SSN_START
+`` DIAG: (test) New session, cont is ``
+`` DIAG: (test)  -- sessionHandler :: TS_EVENT_HTTP_PRE_REMAP
+`` DIAG: (test)  -- transactionHandler :: TS_EVENT_HTTP_PRE_REMAP
+`` DIAG: (test)  -- transactionHandler :: TS_EVENT_HTTP_TXN_CLOSE
+`` DIAG: (test)  -- sessionHandler :: TS_EVENT_HTTP_SSN_CLOSE
+``
diff --git a/tests/gold_tests/pluginTest/test_hooks/hook_add.test.py b/tests/gold_tests/pluginTest/test_hooks/hook_add.test.py
new file mode 100644
index 0000000..3ea96bc
--- /dev/null
+++ b/tests/gold_tests/pluginTest/test_hooks/hook_add.test.py
@@ -0,0 +1,57 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.Summary = '''
+Test adding hooks
+'''
+
+Test.ContinueOnFail = True
+
+server = Test.MakeOriginServer("server")
+
+request_header = {
+    "headers": "GET /argh HTTP/1.1\r\nHost: doesnotmatter\r\n\r\n", "timestamp": "1469733493.993", "body": "" }
+response_header = {"headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n", "timestamp": "1469733493.993", "body": "" }
+server.addResponse("sessionlog.json", request_header, response_header)
+
+ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=False)
+
+ts.Disk.records_config.update({
+    'proxy.config.diags.debug.tags': 'test',
+    'proxy.config.diags.debug.enabled': 1,
+    'proxy.config.http.cache.http': 0, 
+    'proxy.config.url_remap.remap_required': 0,
+})
+
+Test.PreparePlugin(Test.Variables.AtsTestToolsDir + '/plugins/hook_add_plugin.cc', ts)
+
+ts.Disk.remap_config.AddLine(
+    "map http://one http://127.0.0.1:{0}".format(server.Variables.Port)
+)
+
+tr = Test.AddTestRun()
+# Probe server port to check if ready.
+tr.Processes.Default.StartBefore(server, ready=When.PortOpen(server.Variables.Port))
+# Probe TS cleartext port to check if ready (probing TLS port causes spurious VCONN hook triggers).
+tr.Processes.Default.StartBefore(Test.Processes.ts, ready=When.PortOpen(ts.Variables.port))
+#
+tr.Processes.Default.Command = (
+    'curl --verbose --ipv4 --header "Host: one" http://localhost:{0}/argh'.format(ts.Variables.port)
+)
+tr.Processes.Default.ReturnCode = 0
+
+# Look at the debug output from the plugin
+ts.Streams.All = "hook_add.gold"
diff --git a/tests/tools/plugins/hook_add_plugin.cc b/tests/tools/plugins/hook_add_plugin.cc
new file mode 100644
index 0000000..f8fcfe4
--- /dev/null
+++ b/tests/tools/plugins/hook_add_plugin.cc
@@ -0,0 +1,140 @@
+/** @file
+
+  Test adding continuation from same hook point
+
+  @section license License
+
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ */
+#include <ts/ts.h>
+
+#define PLUGIN_TAG "test"
+
+int
+transactionHandler(TSCont continuation, TSEvent event, void *d)
+{
+  if (!(event == TS_EVENT_HTTP_PRE_REMAP || event == TS_EVENT_HTTP_TXN_CLOSE)) {
+    TSError("[" PLUGIN_TAG "] unexpected event on transactionHandler: %i\n", event);
+    return 0;
+  }
+
+  TSHttpTxn transaction = static_cast<TSHttpTxn>(d);
+
+  switch (event) {
+  case TS_EVENT_HTTP_PRE_REMAP: {
+    TSDebug(PLUGIN_TAG, " -- transactionHandler :: TS_EVENT_HTTP_PRE_REMAP");
+  } break;
+
+  case TS_EVENT_HTTP_TXN_CLOSE:
+    TSDebug(PLUGIN_TAG, " -- transactionHandler :: TS_EVENT_HTTP_TXN_CLOSE");
+    TSContDataSet(continuation, nullptr);
+    TSContDestroy(continuation);
+    break;
+
+  default:
+    break;
+  }
+
+  TSHttpTxnReenable(transaction, TS_EVENT_HTTP_CONTINUE);
+
+  return 0;
+}
+
+int
+sessionHandler(TSCont continuation, TSEvent event, void *d)
+{
+  TSHttpTxn txnp = (TSHttpTxn)d;
+  TSCont txn_contp;
+
+  switch (event) {
+  case TS_EVENT_HTTP_PRE_REMAP: {
+    TSDebug(PLUGIN_TAG, " -- sessionHandler :: TS_EVENT_HTTP_PRE_REMAP");
+    txn_contp = TSContCreate(transactionHandler, nullptr);
+
+    /* Registers locally to hook PRE_REMAP_HOOK and TXN_CLOSE */
+    TSHttpTxnHookAdd(txnp, TS_HTTP_PRE_REMAP_HOOK, txn_contp);
+    TSHttpTxnHookAdd(txnp, TS_HTTP_TXN_CLOSE_HOOK, txn_contp);
+  } break;
+
+  case TS_EVENT_HTTP_SSN_CLOSE: {
+    TSDebug(PLUGIN_TAG, " -- sessionHandler :: TS_EVENT_HTTP_SSN_CLOSE");
+    const TSHttpSsn session = static_cast<TSHttpSsn>(d);
+
+    TSHttpSsnReenable(session, TS_EVENT_HTTP_CONTINUE);
+    TSContDestroy(continuation);
+    return 0;
+  } break;
+
+  default:
+    TSAssert(!"Unexpected event");
+    break;
+  }
+
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
+  return 0;
+}
+
+int
+globalHandler(TSCont continuation, TSEvent event, void *data)
+{
+  TSHttpSsn session = static_cast<TSHttpSsn>(data);
+
+  switch (event) {
+  case TS_EVENT_HTTP_SSN_START: {
+    TSDebug(PLUGIN_TAG, " -- globalHandler :: TS_EVENT_HTTP_SSN_START");
+    TSCont cont = TSContCreate(sessionHandler, TSMutexCreate());
+
+    TSHttpSsnHookAdd(session, TS_HTTP_PRE_REMAP_HOOK, cont);
+    TSHttpSsnHookAdd(session, TS_HTTP_SSN_CLOSE_HOOK, cont);
+
+    TSDebug(PLUGIN_TAG, "New session, cont is %p", cont);
+  } break;
+
+  default:
+    return 0;
+  }
+
+  TSHttpSsnReenable(session, TS_EVENT_HTTP_CONTINUE);
+
+  return 0;
+}
+
+void
+TSPluginInit(int argc, const char **argv)
+{
+  TSPluginRegistrationInfo info;
+
+  info.plugin_name   = const_cast<char *>(PLUGIN_TAG);
+  info.support_email = const_cast<char *>("shinrich@verizonmedia.com");
+  info.vendor_name   = const_cast<char *>("Verizon Media");
+
+  TSReturnCode ret;
+#if (TS_VERSION_MAJOR >= 7)
+  ret = TSPluginRegister(&info);
+#else
+  ret = TSPluginRegister(TS_SDK_VERSION_3_0, &info);
+#endif
+
+  if (TS_ERROR == ret) {
+    TSError("[" PLUGIN_TAG "] plugin registration failed\n");
+    return;
+  }
+
+  TSCont continuation = TSContCreate(globalHandler, nullptr);
+
+  TSHttpHookAdd(TS_HTTP_SSN_START_HOOK, continuation);
+}


[trafficserver] 04/04: tests: Cleans up imported but unused imports

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 6088d512aee0e259ba0dba1c8d33484972cdcc80
Author: Randall Meyer <rr...@apache.org>
AuthorDate: Mon Nov 4 18:39:49 2019 -0800

    tests: Cleans up imported but unused imports
    
    (cherry picked from commit 6b08479ecfe4f677a0b22b8942f6bbaadd687d92)
---
 tests/gold_tests/autest-site/curl_header.test.ext             |  1 -
 tests/gold_tests/autest-site/init.cli.ext                     |  5 ++---
 tests/gold_tests/autest-site/microDNS.test.ext                |  4 +---
 tests/gold_tests/autest-site/microserver.test.ext             | 11 +++++------
 tests/gold_tests/autest-site/traffic_replay.test.ext          |  4 ++--
 tests/gold_tests/autest-site/trafficserver.test.ext           |  5 +----
 tests/gold_tests/basic/config.test.py                         |  1 -
 tests/gold_tests/basic/copy_config.test.py                    |  2 +-
 tests/gold_tests/basic/deny0.test.py                          |  1 -
 tests/gold_tests/cache/cache-control.test.py                  |  3 +--
 tests/gold_tests/chunked_encoding/chunked_encoding.test.py    |  1 -
 tests/gold_tests/continuations/double.test.py                 |  4 ++--
 tests/gold_tests/continuations/double_h2.test.py              |  4 ++--
 tests/gold_tests/continuations/openclose.test.py              |  4 ++--
 tests/gold_tests/h2/h2active_timeout.py                       |  1 -
 tests/gold_tests/h2/h2bigclient.py                            |  1 -
 tests/gold_tests/h2/h2chunked.py                              |  1 -
 tests/gold_tests/h2/h2client.py                               |  1 -
 tests/gold_tests/h2/h2disable.test.py                         |  1 -
 tests/gold_tests/h2/h2disable_no_accept_threads.test.py       |  1 -
 tests/gold_tests/h2/h2enable.test.py                          |  1 -
 tests/gold_tests/h2/h2enable_no_accept_threads.test.py        |  1 -
 tests/gold_tests/h2/h2spec.test.py                            |  5 -----
 tests/gold_tests/h2/http2_priority.test.py                    |  6 +-----
 tests/gold_tests/headers/cache_and_req_body.test.py           |  1 -
 tests/gold_tests/headers/cachedIMSRange.test.py               |  2 --
 tests/gold_tests/headers/forwarded-observer.py                |  1 -
 tests/gold_tests/headers/forwarded.test.py                    |  1 -
 tests/gold_tests/headers/hsts.test.py                         |  1 -
 tests/gold_tests/headers/http408.test.py                      |  1 -
 tests/gold_tests/headers/normalize_ae.test.py                 |  1 -
 tests/gold_tests/headers/syntax.test.py                       |  1 -
 tests/gold_tests/headers/via.test.py                          |  1 -
 tests/gold_tests/logging/all_headers.test.py                  |  1 -
 tests/gold_tests/logging/ccid_ctid.test.py                    |  1 -
 tests/gold_tests/logging/log-filter.test.py                   |  9 ++++-----
 .../client_context_dump/client_context_dump.test.py           |  2 --
 tests/gold_tests/pluginTest/compress/compress.test.py         |  2 --
 .../pluginTest/header_rewrite/header_rewrite.test.py          |  1 -
 tests/gold_tests/pluginTest/multiplexer/multiplexer.test.py   |  1 -
 tests/gold_tests/pluginTest/slice/slice.test.py               |  2 --
 tests/gold_tests/pluginTest/slice/slice_error.test.py         |  2 --
 tests/gold_tests/pluginTest/test_hooks/hook_add.test.py       |  2 +-
 tests/gold_tests/pluginTest/url_sig/url_sig.test.py           |  3 +--
 tests/gold_tests/redirect/redirect_post.test.py               |  1 -
 tests/gold_tests/remap/remap_http.test.py                     |  1 -
 tests/gold_tests/remap/remap_https.test.py                    |  1 -
 tests/gold_tests/runroot/runroot_error.test.py                |  2 --
 tests/gold_tests/runroot/runroot_init.test.py                 |  2 --
 tests/gold_tests/runroot/runroot_manager.test.py              |  2 --
 tests/gold_tests/runroot/runroot_remove.test.py               |  2 --
 tests/gold_tests/runroot/runroot_use.test.py                  |  2 --
 tests/gold_tests/runroot/runroot_verify.test.py               |  2 --
 tests/gold_tests/thread_config/thread_100_0.test.py           |  2 --
 tests/gold_tests/thread_config/thread_100_1.test.py           |  2 --
 tests/gold_tests/thread_config/thread_100_10.test.py          |  2 --
 tests/gold_tests/thread_config/thread_1_0.test.py             |  2 --
 tests/gold_tests/thread_config/thread_1_1.test.py             |  2 --
 tests/gold_tests/thread_config/thread_1_10.test.py            |  2 --
 tests/gold_tests/thread_config/thread_2_0.test.py             |  2 --
 tests/gold_tests/thread_config/thread_2_1.test.py             |  2 --
 tests/gold_tests/thread_config/thread_2_10.test.py            |  2 --
 tests/gold_tests/thread_config/thread_32_0.test.py            |  2 --
 tests/gold_tests/thread_config/thread_32_1.test.py            |  2 --
 tests/gold_tests/thread_config/thread_32_10.test.py           |  2 --
 tests/gold_tests/tls/tls.test.py                              |  1 -
 tests/gold_tests/tls/tls_check_cert_selection.test.py         |  1 -
 tests/gold_tests/tls/tls_client_cert.test.py                  |  2 --
 tests/gold_tests/tls/tls_client_cert2.test.py                 |  3 ---
 tests/gold_tests/tls/tls_client_cert_override.test.py         |  3 ---
 tests/gold_tests/tls/tls_client_verify.test.py                |  3 ---
 tests/gold_tests/tls/tls_client_verify2.test.py               |  3 ---
 tests/gold_tests/tls/tls_client_versions.test.py              |  1 -
 tests/gold_tests/tls/tls_hooks_client_verify.test.py          |  1 -
 tests/gold_tests/tls/tls_hooks_verify.test.py                 |  1 -
 tests/gold_tests/tls/tls_keepalive.test.py                    |  1 -
 tests/gold_tests/tls/tls_session_cache.test.py                |  1 -
 tests/gold_tests/tls/tls_ticket.test.py                       |  1 -
 tests/gold_tests/tls/tls_tunnel.test.py                       |  1 -
 tests/gold_tests/tls/tls_tunnel_forward.test.py               |  1 -
 tests/gold_tests/tls/tls_verify.test.py                       |  1 -
 tests/gold_tests/tls/tls_verify2.test.py                      |  1 -
 tests/gold_tests/tls/tls_verify3.test.py                      |  1 -
 tests/gold_tests/tls/tls_verify_base.test.py                  |  1 -
 tests/gold_tests/tls/tls_verify_ca_override.test.py           |  1 -
 tests/gold_tests/tls/tls_verify_not_pristine.test.py          |  1 -
 tests/gold_tests/tls/tls_verify_override.test.py              |  1 -
 tests/gold_tests/tls/tls_verify_override_base.test.py         |  1 -
 tests/gold_tests/tls_hooks/tls_hooks10.test.py                |  1 -
 tests/gold_tests/tls_hooks/tls_hooks12.test.py                |  1 -
 tests/gold_tests/tls_hooks/tls_hooks13.test.py                |  1 -
 tests/gold_tests/tls_hooks/tls_hooks14.test.py                |  1 -
 tests/gold_tests/tls_hooks/tls_hooks15.test.py                |  1 -
 93 files changed, 26 insertions(+), 155 deletions(-)

diff --git a/tests/gold_tests/autest-site/curl_header.test.ext b/tests/gold_tests/autest-site/curl_header.test.ext
index b592b45..e0ba992 100644
--- a/tests/gold_tests/autest-site/curl_header.test.ext
+++ b/tests/gold_tests/autest-site/curl_header.test.ext
@@ -140,7 +140,6 @@ class CurlHeader(Tester):
                 p_flag = 0
                 reason += '\n--------------------------------------------------------------------------------\n'
 
-
         if p_flag == 1:
             self.Result = tester.ResultType.Passed
             self.Reason = "Curl headers and values match"
diff --git a/tests/gold_tests/autest-site/init.cli.ext b/tests/gold_tests/autest-site/init.cli.ext
index 6d7e89b..defaf8a 100644
--- a/tests/gold_tests/autest-site/init.cli.ext
+++ b/tests/gold_tests/autest-site/init.cli.ext
@@ -16,14 +16,13 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-
 import sys
+
 if sys.version_info < (3, 5, 0):
     host.WriteError(
         "You need python 3.5 or later to run these tests\n", show_stack=False)
 
-autest_version ="1.7.2"
+autest_version = "1.7.2"
 if AuTestVersion() < autest_version:
     host.WriteError(
         "Tests need AuTest version {ver} or better\n Please update AuTest:\n  pip install --upgrade autest\n".format(ver=autest_version), show_stack=False)
diff --git a/tests/gold_tests/autest-site/microDNS.test.ext b/tests/gold_tests/autest-site/microDNS.test.ext
index fdeffe0..83fbc7b 100644
--- a/tests/gold_tests/autest-site/microDNS.test.ext
+++ b/tests/gold_tests/autest-site/microDNS.test.ext
@@ -18,14 +18,12 @@
 
 import json
 import os
-import sys
 
 import trlib.ipconstants as IPConstants
 from ports import get_port
 
-# AddRecord registers a list of ip address against hostname
-
 
+# AddRecord registers a list of ip address against hostname
 def AddRecord(hostname, list_ip_addr):
 
     record = dict()
diff --git a/tests/gold_tests/autest-site/microserver.test.ext b/tests/gold_tests/autest-site/microserver.test.ext
index bef027f..bde0005 100644
--- a/tests/gold_tests/autest-site/microserver.test.ext
+++ b/tests/gold_tests/autest-site/microserver.test.ext
@@ -19,8 +19,6 @@
 import json
 import socket
 import ssl
-import time
-import sys
 
 from autest.api import AddWhenFunction
 from ports import get_port
@@ -57,6 +55,7 @@ def getHeaderFieldVal(request_header, field):
             val = field_v[0].strip()
     return val
 
+
 # addResponse adds customized response with respect to request_header. request_header and response_header are both dictionaries
 def addResponse(self, filename, request_header, response_header):
     client_request = Request.fromRequestLine(request_header["headers"], request_header["body"], None if "options" not in request_header else request_header["options"])
@@ -69,9 +68,8 @@ def addResponse(self, filename, request_header, response_header):
     addTransactionToSession(txn, absFilepath)
     return
 
-# adds transaction in json format to the specified file
-
 
+# adds transaction in json format to the specified file
 def addTransactionToSession(txn, JFile):
     jsondata = None
     if not os.path.exists(os.path.dirname(JFile)):
@@ -96,6 +94,7 @@ def addTransactionToSession(txn, JFile):
     with open(JFile, 'w+') as jf:
         jf.write(json.dumps(jsondata))
 
+
 def addSessionFromFiles(self, session_dir):
     self.Setup.Copy(session_dir, self.Variables.DataDir)
 
@@ -177,8 +176,8 @@ def MakeOriginServer(obj, name, port=None, s_port=None, ip='INADDR_LOOPBACK', de
         command += " --cert {0}".format(cert)
         command += " --s_port {0}".format(s_port)
 
-    # this might break if user specifies both both and ssl 
-    if not ssl: # in both or HTTP only mode
+    # this might break if user specifies both both and ssl
+    if not ssl:  # in both or HTTP only mode
         if not port:
             port = get_port(p, "Port")
 
diff --git a/tests/gold_tests/autest-site/traffic_replay.test.ext b/tests/gold_tests/autest-site/traffic_replay.test.ext
index 340fae9..0779dd5 100644
--- a/tests/gold_tests/autest-site/traffic_replay.test.ext
+++ b/tests/gold_tests/autest-site/traffic_replay.test.ext
@@ -16,7 +16,7 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-# default 'mixed' for connection type since it doesn't hurt 
+# default 'mixed' for connection type since it doesn't hurt
 def Replay(obj, name, replay_dir, key=None, cert=None, conn_type='mixed', options={}):
     # ATS setup - one line because we leave records and remap config to user
     ts = obj.MakeATSProcess("ts", select_ports=False) # select ports can be disabled once we add ssl port selection in extension
@@ -61,7 +61,7 @@ def Replay(obj, name, replay_dir, key=None, cert=None, conn_type='mixed', option
 
     if not cert:
         cert = os.path.join(obj.Variables["AtsTestToolsDir"], "microserver", "ssl", "server.crt")
-    
+
     command = 'traffic-replay --log_dir {0} --type {1} --verify --host {2} --port {3} --s_port {4} '.format(data_dir, conn_type, hostIP, ts.Variables.port, ts.Variables.ssl_port)
 
     if key:
diff --git a/tests/gold_tests/autest-site/trafficserver.test.ext b/tests/gold_tests/autest-site/trafficserver.test.ext
index 0ca41eb..34af4ff 100755
--- a/tests/gold_tests/autest-site/trafficserver.test.ext
+++ b/tests/gold_tests/autest-site/trafficserver.test.ext
@@ -18,9 +18,7 @@
 
 from __future__ import print_function
 import os
-import socket
 from ports import get_port
-from autest.api import AddWhenFunction
 
 
 def make_id(s):
@@ -275,7 +273,7 @@ def MakeATSProcess(obj, name, command='traffic_server', select_ports=True, enabl
         p.Variables.port = 8080
         p.Variables.portv6 = 8080
         p.Variables.ssl_port = 4443
-        
+
     get_port(p, "manager_port")
     get_port(p, "admin_port")
 
@@ -304,7 +302,6 @@ def MakeATSProcess(obj, name, command='traffic_server', select_ports=True, enabl
     else:
         p.ReturnCode = 0
 
-
     return p
 
 
diff --git a/tests/gold_tests/basic/config.test.py b/tests/gold_tests/basic/config.test.py
index 4045b86..bfe048b 100644
--- a/tests/gold_tests/basic/config.test.py
+++ b/tests/gold_tests/basic/config.test.py
@@ -27,4 +27,3 @@ t.Processes.Default.StartBefore(ts)
 t.Command = "curl 127.0.0.1:{port}".format(port=ts.Variables.port)
 t.ReturnCode = 0
 t.StillRunningAfter = ts
-
diff --git a/tests/gold_tests/basic/copy_config.test.py b/tests/gold_tests/basic/copy_config.test.py
index 8cfea1b..612f653 100644
--- a/tests/gold_tests/basic/copy_config.test.py
+++ b/tests/gold_tests/basic/copy_config.test.py
@@ -43,4 +43,4 @@ t = Test.AddTestRun("Talk to ts2")
 t.Command = "curl 127.0.0.1:{port}".format(port=ts2.Variables.port)
 t.ReturnCode = 0
 t.StillRunningAfter = ts1
-t.StillRunningAfter += ts2
\ No newline at end of file
+t.StillRunningAfter += ts2
diff --git a/tests/gold_tests/basic/deny0.test.py b/tests/gold_tests/basic/deny0.test.py
index 8b45163..54fbe99 100644
--- a/tests/gold_tests/basic/deny0.test.py
+++ b/tests/gold_tests/basic/deny0.test.py
@@ -18,7 +18,6 @@ Test that Trafficserver rejects requests for host 0
 #  limitations under the License.
 
 import os
-import socket
 Test.Summary = '''
 Test that Trafficserver rejects requests for host 0
 '''
diff --git a/tests/gold_tests/cache/cache-control.test.py b/tests/gold_tests/cache/cache-control.test.py
index d66167e..cf3caf6 100644
--- a/tests/gold_tests/cache/cache-control.test.py
+++ b/tests/gold_tests/cache/cache-control.test.py
@@ -17,11 +17,10 @@ Test cached responses and requests with bodies
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test cached responses and requests with bodies
 '''
- 
+
 Test.ContinueOnFail = True
 
 # Define default ATS
diff --git a/tests/gold_tests/chunked_encoding/chunked_encoding.test.py b/tests/gold_tests/chunked_encoding/chunked_encoding.test.py
index 8f02a1e..7219221 100644
--- a/tests/gold_tests/chunked_encoding/chunked_encoding.test.py
+++ b/tests/gold_tests/chunked_encoding/chunked_encoding.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test a basic remap of a http connection
 '''
diff --git a/tests/gold_tests/continuations/double.test.py b/tests/gold_tests/continuations/double.test.py
index 400ac9f..ab830cd 100644
--- a/tests/gold_tests/continuations/double.test.py
+++ b/tests/gold_tests/continuations/double.test.py
@@ -98,7 +98,7 @@ tr.StillRunningAfter = ts
 # Parking this as a ready tester on a meaningless process
 # To stall the test runs that check for the stats until the
 # stats have propagated and are ready to read.
-def make_done_stat_ready(tsenv): 
+def make_done_stat_ready(tsenv):
   def done_stat_ready(process, hasRunFor, **kw):
     retval = subprocess.run("traffic_ctl metric get continuations_verify.test.done > done  2> /dev/null", shell=True, env=tsenv)
     if retval.returncode == 0:
@@ -106,7 +106,7 @@ def make_done_stat_ready(tsenv):
     return retval.returncode == 0
 
   return done_stat_ready
-  
+
 # number of sessions/transactions opened and closed are equal
 tr = Test.AddTestRun("Check Ssn")
 server2.StartupTimeout = 60
diff --git a/tests/gold_tests/continuations/double_h2.test.py b/tests/gold_tests/continuations/double_h2.test.py
index 9ab8789..8cf025a 100644
--- a/tests/gold_tests/continuations/double_h2.test.py
+++ b/tests/gold_tests/continuations/double_h2.test.py
@@ -109,7 +109,7 @@ tr.StillRunningAfter = ts
 # Parking this as a ready tester on a meaningless process
 # To stall the test runs that check for the stats until the
 # stats have propagated and are ready to read.
-def make_done_stat_ready(tsenv): 
+def make_done_stat_ready(tsenv):
   def done_stat_ready(process, hasRunFor, **kw):
     retval = subprocess.run("traffic_ctl metric get continuations_verify.test.done > done  2> /dev/null", shell=True, env=tsenv)
     if retval.returncode == 0:
@@ -117,7 +117,7 @@ def make_done_stat_ready(tsenv):
     return retval.returncode == 0
 
   return done_stat_ready
-  
+
 # number of sessions/transactions opened and closed are equal
 tr = Test.AddTestRun("Check Ssn")
 server2.StartupTimeout = 60
diff --git a/tests/gold_tests/continuations/openclose.test.py b/tests/gold_tests/continuations/openclose.test.py
index 11fd15c..b27b018 100644
--- a/tests/gold_tests/continuations/openclose.test.py
+++ b/tests/gold_tests/continuations/openclose.test.py
@@ -82,7 +82,7 @@ tr.StillRunningAfter = ts
 # Parking this as a ready tester on a meaningless process
 # To stall the test runs that check for the stats until the
 # stats have propagated and are ready to read.
-def make_done_stat_ready(tsenv): 
+def make_done_stat_ready(tsenv):
   def done_stat_ready(process, hasRunFor, **kw):
     retval = subprocess.run("traffic_ctl metric get ssntxnorder_verify.test.done > done  2> /dev/null", shell=True, env=tsenv)
     if retval.returncode == 0:
@@ -90,7 +90,7 @@ def make_done_stat_ready(tsenv):
     return retval.returncode == 0
 
   return done_stat_ready
-  
+
 # number of sessions/transactions opened and closed are equal
 tr = Test.AddTestRun("Check Ssn order errors")
 server2.StartupTimeout = 60
diff --git a/tests/gold_tests/h2/h2active_timeout.py b/tests/gold_tests/h2/h2active_timeout.py
index b71608c..0b7d5ac 100644
--- a/tests/gold_tests/h2/h2active_timeout.py
+++ b/tests/gold_tests/h2/h2active_timeout.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import json
 from hyper import HTTPConnection
 import hyper
 import argparse
diff --git a/tests/gold_tests/h2/h2bigclient.py b/tests/gold_tests/h2/h2bigclient.py
index 8bc6a06..2e1d86d 100644
--- a/tests/gold_tests/h2/h2bigclient.py
+++ b/tests/gold_tests/h2/h2bigclient.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import json
 from hyper import HTTPConnection
 import hyper
 import argparse
diff --git a/tests/gold_tests/h2/h2chunked.py b/tests/gold_tests/h2/h2chunked.py
index e929450..97938ec 100644
--- a/tests/gold_tests/h2/h2chunked.py
+++ b/tests/gold_tests/h2/h2chunked.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import json
 from hyper import HTTPConnection
 import hyper
 import argparse
diff --git a/tests/gold_tests/h2/h2client.py b/tests/gold_tests/h2/h2client.py
index 5042965..d8f3ce0 100644
--- a/tests/gold_tests/h2/h2client.py
+++ b/tests/gold_tests/h2/h2client.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import json
 from hyper import HTTPConnection
 import hyper
 import argparse
diff --git a/tests/gold_tests/h2/h2disable.test.py b/tests/gold_tests/h2/h2disable.test.py
index f9347b6..0b0ac8b 100644
--- a/tests/gold_tests/h2/h2disable.test.py
+++ b/tests/gold_tests/h2/h2disable.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test disabling H2 on a per domain basis
 '''
diff --git a/tests/gold_tests/h2/h2disable_no_accept_threads.test.py b/tests/gold_tests/h2/h2disable_no_accept_threads.test.py
index bbf5dd0..8d805af 100644
--- a/tests/gold_tests/h2/h2disable_no_accept_threads.test.py
+++ b/tests/gold_tests/h2/h2disable_no_accept_threads.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test disabling H2 on a per domain basis
 '''
diff --git a/tests/gold_tests/h2/h2enable.test.py b/tests/gold_tests/h2/h2enable.test.py
index 0357e93..a44c271 100644
--- a/tests/gold_tests/h2/h2enable.test.py
+++ b/tests/gold_tests/h2/h2enable.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test enabling H2 on a per domain basis
 '''
diff --git a/tests/gold_tests/h2/h2enable_no_accept_threads.test.py b/tests/gold_tests/h2/h2enable_no_accept_threads.test.py
index 0149e54..7f82c47 100644
--- a/tests/gold_tests/h2/h2enable_no_accept_threads.test.py
+++ b/tests/gold_tests/h2/h2enable_no_accept_threads.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test enabling H2 on a per domain basis
 '''
diff --git a/tests/gold_tests/h2/h2spec.test.py b/tests/gold_tests/h2/h2spec.test.py
index a188e80..7bb7fd4 100644
--- a/tests/gold_tests/h2/h2spec.test.py
+++ b/tests/gold_tests/h2/h2spec.test.py
@@ -17,11 +17,6 @@ Test HTTP/2 with h2spec
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-
-# ----
-# Setup Test
-# ----
 Test.Summary = '''
 Test HTTP/2 with httpspec
 '''
diff --git a/tests/gold_tests/h2/http2_priority.test.py b/tests/gold_tests/h2/http2_priority.test.py
index e0911da..6b30c88 100644
--- a/tests/gold_tests/h2/http2_priority.test.py
+++ b/tests/gold_tests/h2/http2_priority.test.py
@@ -16,14 +16,10 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-
-# ----
-# Setup Test
-# ----
 Test.Summary = '''
 Test a basic remap of a http connection with Stream Priority Feature
 '''
+
 # need Curl
 Test.SkipUnless(
     Condition.HasCurlFeature('http2'),
diff --git a/tests/gold_tests/headers/cache_and_req_body.test.py b/tests/gold_tests/headers/cache_and_req_body.test.py
index a45dc94..f42ec57 100644
--- a/tests/gold_tests/headers/cache_and_req_body.test.py
+++ b/tests/gold_tests/headers/cache_and_req_body.test.py
@@ -17,7 +17,6 @@ Test cached responses and requests with bodies using CurlHeader tester
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test cached responses and requests with bodies using CurlHeader tester
 '''
diff --git a/tests/gold_tests/headers/cachedIMSRange.test.py b/tests/gold_tests/headers/cachedIMSRange.test.py
index 496c945..2738aaa 100644
--- a/tests/gold_tests/headers/cachedIMSRange.test.py
+++ b/tests/gold_tests/headers/cachedIMSRange.test.py
@@ -17,8 +17,6 @@ Test cached responses and requests with bodies
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-import time
 Test.Summary = '''
 Test revalidating cached objects
 '''
diff --git a/tests/gold_tests/headers/forwarded-observer.py b/tests/gold_tests/headers/forwarded-observer.py
index f817650..7789c42 100644
--- a/tests/gold_tests/headers/forwarded-observer.py
+++ b/tests/gold_tests/headers/forwarded-observer.py
@@ -18,7 +18,6 @@ Extract the protocol information from the FORWARDED headers and store it in a lo
 #  limitations under the License.
 
 import re
-import subprocess
 
 log = open('forwarded.log', 'w')
 
diff --git a/tests/gold_tests/headers/forwarded.test.py b/tests/gold_tests/headers/forwarded.test.py
index eb95e38..5fed205 100644
--- a/tests/gold_tests/headers/forwarded.test.py
+++ b/tests/gold_tests/headers/forwarded.test.py
@@ -18,7 +18,6 @@ Test the Forwarded header and related configuration..
 #  limitations under the License.
 
 import os
-import subprocess
 
 Test.Summary = '''
 Test FORWARDED header.
diff --git a/tests/gold_tests/headers/hsts.test.py b/tests/gold_tests/headers/hsts.test.py
index 434ff4b..67ed89c 100644
--- a/tests/gold_tests/headers/hsts.test.py
+++ b/tests/gold_tests/headers/hsts.test.py
@@ -17,7 +17,6 @@ Test the hsts response header.
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 heck hsts header is set correctly
 '''
diff --git a/tests/gold_tests/headers/http408.test.py b/tests/gold_tests/headers/http408.test.py
index 8e2c37b..a56ffa9 100644
--- a/tests/gold_tests/headers/http408.test.py
+++ b/tests/gold_tests/headers/http408.test.py
@@ -18,7 +18,6 @@ Test the 408 response header.
 #  limitations under the License.
 
 import os
-import subprocess
 
 Test.Summary = '''
 Check 408 response header for protocol stack data.
diff --git a/tests/gold_tests/headers/normalize_ae.test.py b/tests/gold_tests/headers/normalize_ae.test.py
index 23ef42f..d9779a2 100644
--- a/tests/gold_tests/headers/normalize_ae.test.py
+++ b/tests/gold_tests/headers/normalize_ae.test.py
@@ -18,7 +18,6 @@ Test normalizations of the Accept-Encoding header field.
 #  limitations under the License.
 
 import os
-import subprocess
 
 Test.Summary = '''
 Test normalizations of the Accept-Encoding header field.
diff --git a/tests/gold_tests/headers/syntax.test.py b/tests/gold_tests/headers/syntax.test.py
index dbaacb9..d6a6929 100644
--- a/tests/gold_tests/headers/syntax.test.py
+++ b/tests/gold_tests/headers/syntax.test.py
@@ -17,7 +17,6 @@ Test whitespace between field name and colon in the header
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test whitespace between field name and colon in the header
 '''
diff --git a/tests/gold_tests/headers/via.test.py b/tests/gold_tests/headers/via.test.py
index 1244b48..5e275d1 100644
--- a/tests/gold_tests/headers/via.test.py
+++ b/tests/gold_tests/headers/via.test.py
@@ -19,7 +19,6 @@ Those are then checked against a gold file to verify the protocol stack based ou
 #  limitations under the License.
 
 import os
-import subprocess
 
 Test.Summary = '''
 Check VIA header for protocol stack data.
diff --git a/tests/gold_tests/logging/all_headers.test.py b/tests/gold_tests/logging/all_headers.test.py
index 6ae73d7..b973fa6 100644
--- a/tests/gold_tests/logging/all_headers.test.py
+++ b/tests/gold_tests/logging/all_headers.test.py
@@ -17,7 +17,6 @@
 #  limitations under the License.
 
 import os
-import subprocess
 
 Test.Summary = '''
 Test new "all headers" log fields
diff --git a/tests/gold_tests/logging/ccid_ctid.test.py b/tests/gold_tests/logging/ccid_ctid.test.py
index 26dc659..34f9d75 100644
--- a/tests/gold_tests/logging/ccid_ctid.test.py
+++ b/tests/gold_tests/logging/ccid_ctid.test.py
@@ -17,7 +17,6 @@
 #  limitations under the License.
 
 import os
-import subprocess
 
 Test.Summary = '''
 Test new ccid and ctid log fields
diff --git a/tests/gold_tests/logging/log-filter.test.py b/tests/gold_tests/logging/log-filter.test.py
index 784fee2..97dd8ee 100644
--- a/tests/gold_tests/logging/log-filter.test.py
+++ b/tests/gold_tests/logging/log-filter.test.py
@@ -18,7 +18,7 @@
 
 import os
 
-Test.Summary = ''' 
+Test.Summary = '''
 Test log filter.
 '''
 # Only on Linux (why??)
@@ -31,7 +31,7 @@ ts = Test.MakeATSProcess("ts")
 # Microserver
 server = Test.MakeOriginServer("server")
 
-request_header = {'timestamp': 100, "headers": "GET /test-1 HTTP/1.1\r\nHost: test-1\r\n\r\n", "body": ""} 
+request_header = {'timestamp': 100, "headers": "GET /test-1 HTTP/1.1\r\nHost: test-1\r\n\r\n", "body": ""}
 response_header = {'timestamp': 100,
                    "headers": "HTTP/1.1 200 OK\r\nTest: 1\r\nContent-Type: application/json\r\nConnection: close\r\nContent-Type: application/json\r\n\r\n", "body": "Test 1"}
 server.addResponse("sessionlog.json", request_header, response_header)
@@ -62,7 +62,7 @@ ts.Disk.remap_config.AddLine(
 )
 
 ts.Disk.logging_yaml.AddLines(
-    ''' 
+    '''
 logging:
   filters:
     - name: queryparamescaper_cquuc
@@ -74,7 +74,7 @@ logging:
   logs:
     - filename: filter-test
       format: custom
-      filters: 
+      filters:
       - queryparamescaper_cquuc
 '''.split("\n")
 )
@@ -121,4 +121,3 @@ tr = Test.AddTestRun()
 tr.DelayStart = 10
 tr.Processes.Default.Command = 'echo "Delay for log flush"'
 tr.Processes.Default.ReturnCode = 0
-
diff --git a/tests/gold_tests/pluginTest/client_context_dump/client_context_dump.test.py b/tests/gold_tests/pluginTest/client_context_dump/client_context_dump.test.py
index 9fea371..1afd71e 100644
--- a/tests/gold_tests/pluginTest/client_context_dump/client_context_dump.test.py
+++ b/tests/gold_tests/pluginTest/client_context_dump/client_context_dump.test.py
@@ -17,8 +17,6 @@ Test the client_context_dump plugin.
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-import subprocess
 Test.Summary = '''
 Test client_context_dump plugin
 '''
diff --git a/tests/gold_tests/pluginTest/compress/compress.test.py b/tests/gold_tests/pluginTest/compress/compress.test.py
index 65d2890..626b74b 100644
--- a/tests/gold_tests/pluginTest/compress/compress.test.py
+++ b/tests/gold_tests/pluginTest/compress/compress.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-import subprocess
 Test.Summary = '''
 Test compress plugin
 '''
diff --git a/tests/gold_tests/pluginTest/header_rewrite/header_rewrite.test.py b/tests/gold_tests/pluginTest/header_rewrite/header_rewrite.test.py
index 2341cf0..6e850eb 100644
--- a/tests/gold_tests/pluginTest/header_rewrite/header_rewrite.test.py
+++ b/tests/gold_tests/pluginTest/header_rewrite/header_rewrite.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test a basic remap of a http connection
 '''
diff --git a/tests/gold_tests/pluginTest/multiplexer/multiplexer.test.py b/tests/gold_tests/pluginTest/multiplexer/multiplexer.test.py
index 028ef76..69af2bf 100644
--- a/tests/gold_tests/pluginTest/multiplexer/multiplexer.test.py
+++ b/tests/gold_tests/pluginTest/multiplexer/multiplexer.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test experimental/multiplexer.
 '''
diff --git a/tests/gold_tests/pluginTest/slice/slice.test.py b/tests/gold_tests/pluginTest/slice/slice.test.py
index cec66ed..eafaef8 100644
--- a/tests/gold_tests/pluginTest/slice/slice.test.py
+++ b/tests/gold_tests/pluginTest/slice/slice.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-import time
 Test.Summary = '''
 Basic slice plugin test
 '''
diff --git a/tests/gold_tests/pluginTest/slice/slice_error.test.py b/tests/gold_tests/pluginTest/slice/slice_error.test.py
index 1c42b30..830ecaa 100644
--- a/tests/gold_tests/pluginTest/slice/slice_error.test.py
+++ b/tests/gold_tests/pluginTest/slice/slice_error.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-import time
 Test.Summary = '''
 Slice plugin error.log test
 '''
diff --git a/tests/gold_tests/pluginTest/test_hooks/hook_add.test.py b/tests/gold_tests/pluginTest/test_hooks/hook_add.test.py
index 3ea96bc..c5caace 100644
--- a/tests/gold_tests/pluginTest/test_hooks/hook_add.test.py
+++ b/tests/gold_tests/pluginTest/test_hooks/hook_add.test.py
@@ -32,7 +32,7 @@ ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=False)
 ts.Disk.records_config.update({
     'proxy.config.diags.debug.tags': 'test',
     'proxy.config.diags.debug.enabled': 1,
-    'proxy.config.http.cache.http': 0, 
+    'proxy.config.http.cache.http': 0,
     'proxy.config.url_remap.remap_required': 0,
 })
 
diff --git a/tests/gold_tests/pluginTest/url_sig/url_sig.test.py b/tests/gold_tests/pluginTest/url_sig/url_sig.test.py
index 3c96e89..588f6d6 100644
--- a/tests/gold_tests/pluginTest/url_sig/url_sig.test.py
+++ b/tests/gold_tests/pluginTest/url_sig/url_sig.test.py
@@ -18,8 +18,7 @@
 
 import hashlib
 import hmac
-import os
-import subprocess
+
 Test.Summary = '''
 Test url_sig plugin
 '''
diff --git a/tests/gold_tests/redirect/redirect_post.test.py b/tests/gold_tests/redirect/redirect_post.test.py
index 23b7212..ce5f5bf 100644
--- a/tests/gold_tests/redirect/redirect_post.test.py
+++ b/tests/gold_tests/redirect/redirect_post.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test basic post redirection
 '''
diff --git a/tests/gold_tests/remap/remap_http.test.py b/tests/gold_tests/remap/remap_http.test.py
index 1417fea..b51ae76 100644
--- a/tests/gold_tests/remap/remap_http.test.py
+++ b/tests/gold_tests/remap/remap_http.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test a basic remap of a http connection
 '''
diff --git a/tests/gold_tests/remap/remap_https.test.py b/tests/gold_tests/remap/remap_https.test.py
index f94768d..a47dcbf 100644
--- a/tests/gold_tests/remap/remap_https.test.py
+++ b/tests/gold_tests/remap/remap_https.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test a basic remap of a http connection
 '''
diff --git a/tests/gold_tests/runroot/runroot_error.test.py b/tests/gold_tests/runroot/runroot_error.test.py
index 1fc7ca7..dc0a26b 100644
--- a/tests/gold_tests/runroot/runroot_error.test.py
+++ b/tests/gold_tests/runroot/runroot_error.test.py
@@ -17,8 +17,6 @@
 #  limitations under the License.
 
 import os
-import sys
-import time
 
 Test.Summary = '''
 Test for expected error and failure of runroot from traffic_layout.
diff --git a/tests/gold_tests/runroot/runroot_init.test.py b/tests/gold_tests/runroot/runroot_init.test.py
index 5e8e371..9c68b8e 100644
--- a/tests/gold_tests/runroot/runroot_init.test.py
+++ b/tests/gold_tests/runroot/runroot_init.test.py
@@ -17,8 +17,6 @@
 #  limitations under the License.
 
 import os
-import sys
-import time
 
 Test.Summary = '''
 Test for init of runroot from traffic_layout.
diff --git a/tests/gold_tests/runroot/runroot_manager.test.py b/tests/gold_tests/runroot/runroot_manager.test.py
index 0954cdb..c9ce5f8 100644
--- a/tests/gold_tests/runroot/runroot_manager.test.py
+++ b/tests/gold_tests/runroot/runroot_manager.test.py
@@ -17,8 +17,6 @@
 #  limitations under the License.
 
 import os
-import sys
-import time
 
 Test.Summary = '''
 Test for using of runroot of traffic_manager.
diff --git a/tests/gold_tests/runroot/runroot_remove.test.py b/tests/gold_tests/runroot/runroot_remove.test.py
index c2349eb..987836c 100644
--- a/tests/gold_tests/runroot/runroot_remove.test.py
+++ b/tests/gold_tests/runroot/runroot_remove.test.py
@@ -17,8 +17,6 @@
 #  limitations under the License.
 
 import os
-import sys
-import time
 
 Test.Summary = '''
 Test for remove of runroot from traffic_layout.
diff --git a/tests/gold_tests/runroot/runroot_use.test.py b/tests/gold_tests/runroot/runroot_use.test.py
index 0ef2aef..9e9cbd5 100644
--- a/tests/gold_tests/runroot/runroot_use.test.py
+++ b/tests/gold_tests/runroot/runroot_use.test.py
@@ -17,8 +17,6 @@
 #  limitations under the License.
 
 import os
-import sys
-import time
 
 Test.Summary = '''
 Test for using of runroot from traffic_layout.
diff --git a/tests/gold_tests/runroot/runroot_verify.test.py b/tests/gold_tests/runroot/runroot_verify.test.py
index 961c970..8c316b7 100644
--- a/tests/gold_tests/runroot/runroot_verify.test.py
+++ b/tests/gold_tests/runroot/runroot_verify.test.py
@@ -17,8 +17,6 @@
 #  limitations under the License.
 
 import os
-import sys
-import time
 
 Test.Summary = '''
 Test for verify of runroot from traffic_layout.
diff --git a/tests/gold_tests/thread_config/thread_100_0.test.py b/tests/gold_tests/thread_config/thread_100_0.test.py
index b93f614..955dc7e 100644
--- a/tests/gold_tests/thread_config/thread_100_0.test.py
+++ b/tests/gold_tests/thread_config/thread_100_0.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/thread_config/thread_100_1.test.py b/tests/gold_tests/thread_config/thread_100_1.test.py
index 0230b2a..d2f962d 100644
--- a/tests/gold_tests/thread_config/thread_100_1.test.py
+++ b/tests/gold_tests/thread_config/thread_100_1.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/thread_config/thread_100_10.test.py b/tests/gold_tests/thread_config/thread_100_10.test.py
index f324b60..2ec2204 100644
--- a/tests/gold_tests/thread_config/thread_100_10.test.py
+++ b/tests/gold_tests/thread_config/thread_100_10.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/thread_config/thread_1_0.test.py b/tests/gold_tests/thread_config/thread_1_0.test.py
index a51ca5e..e394ab0 100644
--- a/tests/gold_tests/thread_config/thread_1_0.test.py
+++ b/tests/gold_tests/thread_config/thread_1_0.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/thread_config/thread_1_1.test.py b/tests/gold_tests/thread_config/thread_1_1.test.py
index b0b0db4..a3f7608 100644
--- a/tests/gold_tests/thread_config/thread_1_1.test.py
+++ b/tests/gold_tests/thread_config/thread_1_1.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/thread_config/thread_1_10.test.py b/tests/gold_tests/thread_config/thread_1_10.test.py
index 1eae1a2..07252f3 100644
--- a/tests/gold_tests/thread_config/thread_1_10.test.py
+++ b/tests/gold_tests/thread_config/thread_1_10.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/thread_config/thread_2_0.test.py b/tests/gold_tests/thread_config/thread_2_0.test.py
index 286b376..9935e6c 100644
--- a/tests/gold_tests/thread_config/thread_2_0.test.py
+++ b/tests/gold_tests/thread_config/thread_2_0.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/thread_config/thread_2_1.test.py b/tests/gold_tests/thread_config/thread_2_1.test.py
index 0c3fd6f..641e7e8 100644
--- a/tests/gold_tests/thread_config/thread_2_1.test.py
+++ b/tests/gold_tests/thread_config/thread_2_1.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/thread_config/thread_2_10.test.py b/tests/gold_tests/thread_config/thread_2_10.test.py
index aa674e3..fd725ce 100644
--- a/tests/gold_tests/thread_config/thread_2_10.test.py
+++ b/tests/gold_tests/thread_config/thread_2_10.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/thread_config/thread_32_0.test.py b/tests/gold_tests/thread_config/thread_32_0.test.py
index 7b2c70c..2e62129 100644
--- a/tests/gold_tests/thread_config/thread_32_0.test.py
+++ b/tests/gold_tests/thread_config/thread_32_0.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/thread_config/thread_32_1.test.py b/tests/gold_tests/thread_config/thread_32_1.test.py
index d658360..b44fd8e 100644
--- a/tests/gold_tests/thread_config/thread_32_1.test.py
+++ b/tests/gold_tests/thread_config/thread_32_1.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/thread_config/thread_32_10.test.py b/tests/gold_tests/thread_config/thread_32_10.test.py
index a794738..be20467 100644
--- a/tests/gold_tests/thread_config/thread_32_10.test.py
+++ b/tests/gold_tests/thread_config/thread_32_10.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import sys
-
 
 Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
 Test.ContinueOnFail = True
diff --git a/tests/gold_tests/tls/tls.test.py b/tests/gold_tests/tls/tls.test.py
index ad3fcb7..d204445 100644
--- a/tests/gold_tests/tls/tls.test.py
+++ b/tests/gold_tests/tls/tls.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test tls
 '''
diff --git a/tests/gold_tests/tls/tls_check_cert_selection.test.py b/tests/gold_tests/tls/tls_check_cert_selection.test.py
index 67e76f4..aa027ac 100644
--- a/tests/gold_tests/tls/tls_check_cert_selection.test.py
+++ b/tests/gold_tests/tls/tls_check_cert_selection.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test ATS offering different certificates based on SNI
 '''
diff --git a/tests/gold_tests/tls/tls_client_cert.test.py b/tests/gold_tests/tls/tls_client_cert.test.py
index d21bb6b..6732c45 100644
--- a/tests/gold_tests/tls/tls_client_cert.test.py
+++ b/tests/gold_tests/tls/tls_client_cert.test.py
@@ -17,9 +17,7 @@ Test offering client cert to origin
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 import subprocess
-import re
 
 Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.
diff --git a/tests/gold_tests/tls/tls_client_cert2.test.py b/tests/gold_tests/tls/tls_client_cert2.test.py
index 5e252ed..95f2fce 100644
--- a/tests/gold_tests/tls/tls_client_cert2.test.py
+++ b/tests/gold_tests/tls/tls_client_cert2.test.py
@@ -17,9 +17,6 @@ Test offering client cert to origin
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-import re
-
 Test.Summary = '''
 Test client certs to origin selected via wildcard names in sni
 '''
diff --git a/tests/gold_tests/tls/tls_client_cert_override.test.py b/tests/gold_tests/tls/tls_client_cert_override.test.py
index 5bb8959..5df4f5a 100644
--- a/tests/gold_tests/tls/tls_client_cert_override.test.py
+++ b/tests/gold_tests/tls/tls_client_cert_override.test.py
@@ -17,9 +17,6 @@ Test offering client cert to origin
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-import re
-
 Test.Summary = '''
 Test conf_remp to specify different client certificates to offer to the origin
 '''
diff --git a/tests/gold_tests/tls/tls_client_verify.test.py b/tests/gold_tests/tls/tls_client_verify.test.py
index aba3682..e7480a7 100644
--- a/tests/gold_tests/tls/tls_client_verify.test.py
+++ b/tests/gold_tests/tls/tls_client_verify.test.py
@@ -17,9 +17,6 @@ Test requiring certificate from user agent
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-import re
-
 Test.Summary = '''
 Test various options for requiring certificate from client for mutual authentication TLS
 '''
diff --git a/tests/gold_tests/tls/tls_client_verify2.test.py b/tests/gold_tests/tls/tls_client_verify2.test.py
index 78dff33..0083e9f 100644
--- a/tests/gold_tests/tls/tls_client_verify2.test.py
+++ b/tests/gold_tests/tls/tls_client_verify2.test.py
@@ -17,9 +17,6 @@ Test requiring certificate from user agent
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-import re
-
 Test.Summary = '''
 Test various options for requiring certificate from client for mutual authentication TLS
 '''
diff --git a/tests/gold_tests/tls/tls_client_versions.test.py b/tests/gold_tests/tls/tls_client_versions.test.py
index 76cb28d..f351b98 100644
--- a/tests/gold_tests/tls/tls_client_versions.test.py
+++ b/tests/gold_tests/tls/tls_client_versions.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test TLS protocol offering  based on SNI
 '''
diff --git a/tests/gold_tests/tls/tls_hooks_client_verify.test.py b/tests/gold_tests/tls/tls_hooks_client_verify.test.py
index 36092d4..becb6a9 100644
--- a/tests/gold_tests/tls/tls_hooks_client_verify.test.py
+++ b/tests/gold_tests/tls/tls_hooks_client_verify.test.py
@@ -18,7 +18,6 @@ Test SERVER_VERIFY_HOOK
 #  limitations under the License.
 
 import os
-import re
 
 Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.
diff --git a/tests/gold_tests/tls/tls_hooks_verify.test.py b/tests/gold_tests/tls/tls_hooks_verify.test.py
index dae7e9b..33e1f15 100644
--- a/tests/gold_tests/tls/tls_hooks_verify.test.py
+++ b/tests/gold_tests/tls/tls_hooks_verify.test.py
@@ -18,7 +18,6 @@ Test SERVER_VERIFY_HOOK
 #  limitations under the License.
 
 import os
-import re
 
 Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.
diff --git a/tests/gold_tests/tls/tls_keepalive.test.py b/tests/gold_tests/tls/tls_keepalive.test.py
index 72c32f0..11d39aa 100644
--- a/tests/gold_tests/tls/tls_keepalive.test.py
+++ b/tests/gold_tests/tls/tls_keepalive.test.py
@@ -18,7 +18,6 @@ Use pre-accept hook to verify that both requests are made over the same TLS sess
 #  limitations under the License.
 
 import os
-import re
 
 Test.Summary = '''
 Verify that the client-side keep alive is honored for TLS and different versions of HTTP
diff --git a/tests/gold_tests/tls/tls_session_cache.test.py b/tests/gold_tests/tls/tls_session_cache.test.py
index 08d9fd2..0d4d0a9 100644
--- a/tests/gold_tests/tls/tls_session_cache.test.py
+++ b/tests/gold_tests/tls/tls_session_cache.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 import re
 Test.Summary = '''
 Test tls session cache
diff --git a/tests/gold_tests/tls/tls_ticket.test.py b/tests/gold_tests/tls/tls_ticket.test.py
index d26e14d..857217c 100644
--- a/tests/gold_tests/tls/tls_ticket.test.py
+++ b/tests/gold_tests/tls/tls_ticket.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 import re
 Test.Summary = '''
 Test tls tickets
diff --git a/tests/gold_tests/tls/tls_tunnel.test.py b/tests/gold_tests/tls/tls_tunnel.test.py
index c168a20..0a7196f 100644
--- a/tests/gold_tests/tls/tls_tunnel.test.py
+++ b/tests/gold_tests/tls/tls_tunnel.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 import subprocess
 Test.Summary = '''
 Test tunneling based on SNI
diff --git a/tests/gold_tests/tls/tls_tunnel_forward.test.py b/tests/gold_tests/tls/tls_tunnel_forward.test.py
index 105babf..8288f23 100644
--- a/tests/gold_tests/tls/tls_tunnel_forward.test.py
+++ b/tests/gold_tests/tls/tls_tunnel_forward.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test tunneling and forwarding based on SNI
 '''
diff --git a/tests/gold_tests/tls/tls_verify.test.py b/tests/gold_tests/tls/tls_verify.test.py
index b8ac58f..289d1ac 100644
--- a/tests/gold_tests/tls/tls_verify.test.py
+++ b/tests/gold_tests/tls/tls_verify.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test tls server certificate verification options
 '''
diff --git a/tests/gold_tests/tls/tls_verify2.test.py b/tests/gold_tests/tls/tls_verify2.test.py
index e141fd4..368f0c8 100644
--- a/tests/gold_tests/tls/tls_verify2.test.py
+++ b/tests/gold_tests/tls/tls_verify2.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test tls server certificate verification options
 '''
diff --git a/tests/gold_tests/tls/tls_verify3.test.py b/tests/gold_tests/tls/tls_verify3.test.py
index 25d8069..eb54c29 100644
--- a/tests/gold_tests/tls/tls_verify3.test.py
+++ b/tests/gold_tests/tls/tls_verify3.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test tls server certificate verification options
 '''
diff --git a/tests/gold_tests/tls/tls_verify_base.test.py b/tests/gold_tests/tls/tls_verify_base.test.py
index 7195f86..51d41c1 100644
--- a/tests/gold_tests/tls/tls_verify_base.test.py
+++ b/tests/gold_tests/tls/tls_verify_base.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test tls server certificate verification options
 '''
diff --git a/tests/gold_tests/tls/tls_verify_ca_override.test.py b/tests/gold_tests/tls/tls_verify_ca_override.test.py
index 6197de7..b7208fa 100644
--- a/tests/gold_tests/tls/tls_verify_ca_override.test.py
+++ b/tests/gold_tests/tls/tls_verify_ca_override.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test tls server  certificate verification options. Exercise conf_remap for ca bundle
 '''
diff --git a/tests/gold_tests/tls/tls_verify_not_pristine.test.py b/tests/gold_tests/tls/tls_verify_not_pristine.test.py
index b04cd68..6018358 100644
--- a/tests/gold_tests/tls/tls_verify_not_pristine.test.py
+++ b/tests/gold_tests/tls/tls_verify_not_pristine.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test tls server certificate verification without a pristine host header
 '''
diff --git a/tests/gold_tests/tls/tls_verify_override.test.py b/tests/gold_tests/tls/tls_verify_override.test.py
index 0e6a7c5..68104f6 100644
--- a/tests/gold_tests/tls/tls_verify_override.test.py
+++ b/tests/gold_tests/tls/tls_verify_override.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test tls server certificate verification options. Exercise conf_remap
 '''
diff --git a/tests/gold_tests/tls/tls_verify_override_base.test.py b/tests/gold_tests/tls/tls_verify_override_base.test.py
index b84a7cb..ccaaab4 100644
--- a/tests/gold_tests/tls/tls_verify_override_base.test.py
+++ b/tests/gold_tests/tls/tls_verify_override_base.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test tls server certificate verification options. Exercise conf_remap
 '''
diff --git a/tests/gold_tests/tls_hooks/tls_hooks10.test.py b/tests/gold_tests/tls_hooks/tls_hooks10.test.py
index b16fa6c..111280c 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks10.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks10.test.py
@@ -18,7 +18,6 @@ Test one delayed cert callback and two immediate cert callbacks
 #  limitations under the License.
 
 import os
-import re
 
 Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.
diff --git a/tests/gold_tests/tls_hooks/tls_hooks12.test.py b/tests/gold_tests/tls_hooks/tls_hooks12.test.py
index dbc7636..4cb12d2 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks12.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks12.test.py
@@ -18,7 +18,6 @@ Test a combination of delayed and immediate preaccept callbacks
 #  limitations under the License.
 
 import os
-import re
 
 Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.
diff --git a/tests/gold_tests/tls_hooks/tls_hooks13.test.py b/tests/gold_tests/tls_hooks/tls_hooks13.test.py
index 256d8e9..aebe3fd 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks13.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks13.test.py
@@ -18,7 +18,6 @@ Test one outbound start and two outbound close
 #  limitations under the License.
 
 import os
-import re
 
 Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.
diff --git a/tests/gold_tests/tls_hooks/tls_hooks14.test.py b/tests/gold_tests/tls_hooks/tls_hooks14.test.py
index 1c78e8b..180f2a1 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks14.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks14.test.py
@@ -18,7 +18,6 @@ Test two outbound start delayed hooks
 #  limitations under the License.
 
 import os
-import re
 
 Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.
diff --git a/tests/gold_tests/tls_hooks/tls_hooks15.test.py b/tests/gold_tests/tls_hooks/tls_hooks15.test.py
index c844dfd..6220f4c 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks15.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks15.test.py
@@ -18,7 +18,6 @@ Test one delayed preaccept callback
 #  limitations under the License.
 
 import os
-import re
 
 Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.