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/11/21 23:19:29 UTC

[trafficserver] branch master updated: Rename prepare_plugin to PreparePlugin to follow naming convention

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 7524922  Rename prepare_plugin to PreparePlugin to follow naming convention
7524922 is described below

commit 7524922c55c35fcced28c594dbfa4acc3a345c43
Author: Jason Kenny <dr...@live.com>
AuthorDate: Tue Nov 21 16:29:40 2017 -0600

    Rename prepare_plugin to PreparePlugin to follow naming convention
    
    Add test for openssl version
    Add condition test to some tests that need ALPN
---
 tests/gold_tests/autest-site/conditions.test.ext              | 5 +++++
 tests/gold_tests/autest-site/trafficserver_plugins.test.ext   | 3 +++
 tests/gold_tests/body_factory/http204_response_plugin.test.py | 2 +-
 tests/gold_tests/continuations/double.test.py                 | 2 +-
 tests/gold_tests/null_transform/null_transform.test.py        | 2 +-
 tests/gold_tests/tls_hooks/tls_hooks.test.py                  | 2 +-
 tests/gold_tests/tls_hooks/tls_hooks10.test.py                | 7 +++++--
 tests/gold_tests/tls_hooks/tls_hooks11.test.py                | 2 +-
 tests/gold_tests/tls_hooks/tls_hooks12.test.py                | 2 +-
 tests/gold_tests/tls_hooks/tls_hooks2.test.py                 | 2 +-
 tests/gold_tests/tls_hooks/tls_hooks3.test.py                 | 7 +++++--
 tests/gold_tests/tls_hooks/tls_hooks4.test.py                 | 7 +++++--
 tests/gold_tests/tls_hooks/tls_hooks6.test.py                 | 2 +-
 tests/gold_tests/tls_hooks/tls_hooks7.test.py                 | 2 +-
 tests/gold_tests/tls_hooks/tls_hooks8.test.py                 | 7 +++++--
 tests/gold_tests/tls_hooks/tls_hooks9.test.py                 | 2 +-
 tests/gold_tests/transaction/txn.test.py                      | 2 +-
 17 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/tests/gold_tests/autest-site/conditions.test.ext b/tests/gold_tests/autest-site/conditions.test.ext
index 40d4ee4..9cac02f 100644
--- a/tests/gold_tests/autest-site/conditions.test.ext
+++ b/tests/gold_tests/autest-site/conditions.test.ext
@@ -15,6 +15,10 @@
 #  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.
+
+def HasOpenSSLVersion(self, version):
+    return self.EnsureVersion(["openssl","version"],min_version=version)
+
 def HasCurlFeature(self, feature):
 
     def default(output):
@@ -54,6 +58,7 @@ def PluginExists(self, pluginname):
     return self.Condition(lambda: os.path.isfile(path) == True, path + " not found." )
 
 
+ExtendCondition(HasOpenSSLVersion)
 ExtendCondition(HasATSFeature)
 ExtendCondition(HasCurlFeature)
 ExtendCondition(PluginExists)
diff --git a/tests/gold_tests/autest-site/trafficserver_plugins.test.ext b/tests/gold_tests/autest-site/trafficserver_plugins.test.ext
index 3b801d8..0efe6a3 100644
--- a/tests/gold_tests/autest-site/trafficserver_plugins.test.ext
+++ b/tests/gold_tests/autest-site/trafficserver_plugins.test.ext
@@ -49,4 +49,7 @@ def prepare_plugin(self, path, tsproc, plugin_args = ""):
     # Add an entry to plugin.config.
     tsproc.Disk.plugin_config.AddLine("{0} {1}".format(out_basename,plugin_args))
 
+# remove this later
 ExtendTest(prepare_plugin, name="prepare_plugin")
+
+ExtendTest(prepare_plugin, name="PreparePlugin")
diff --git a/tests/gold_tests/body_factory/http204_response_plugin.test.py b/tests/gold_tests/body_factory/http204_response_plugin.test.py
index 7c8036b..820b0eb 100644
--- a/tests/gold_tests/body_factory/http204_response_plugin.test.py
+++ b/tests/gold_tests/body_factory/http204_response_plugin.test.py
@@ -39,7 +39,7 @@ ts.Disk.remap_config.AddLine(
 )
 ts.Disk.MakeConfigFile(regex_remap_conf_file).AddLine('//.*/ http://donotcare.test @status=204')
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'custom204plugin.cc'), ts)
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'custom204plugin.cc'), ts)
 
 Test.Setup.Copy(os.path.join(os.pardir, os.pardir, 'tools', 'tcp_client.py'))
 Test.Setup.Copy('data')
diff --git a/tests/gold_tests/continuations/double.test.py b/tests/gold_tests/continuations/double.test.py
index cde236a..0d5fd0a 100644
--- a/tests/gold_tests/continuations/double.test.py
+++ b/tests/gold_tests/continuations/double.test.py
@@ -35,7 +35,7 @@ request_header = {"headers": "GET / HTTP/1.1\r\n\r\n", "timestamp": "1469733493.
 # expected response from the origin server
 response_header = {"headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n", "timestamp": "1469733493.993", "body": ""}
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'continuations_verify.cc'), ts)
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'continuations_verify.cc'), ts)
 
 # add response to the server dictionary
 server.addResponse("sessionfile.log", request_header, response_header)
diff --git a/tests/gold_tests/null_transform/null_transform.test.py b/tests/gold_tests/null_transform/null_transform.test.py
index 4e1e4e8..6c63149 100644
--- a/tests/gold_tests/null_transform/null_transform.test.py
+++ b/tests/gold_tests/null_transform/null_transform.test.py
@@ -55,7 +55,7 @@ ts.Disk.remap_config.AddLine(
 )
 
 # Load plugin
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'null_transform.c'), ts)
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'null_transform.c'), ts)
 
 # www.example.com Host
 tr = Test.AddTestRun()
diff --git a/tests/gold_tests/tls_hooks/tls_hooks.test.py b/tests/gold_tests/tls_hooks/tls_hooks.test.py
index d56a82c..deb6448 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks.test.py
@@ -56,7 +56,7 @@ ts.Disk.remap_config.AddLine(
     'map https://example.com:4443 http://127.0.0.1:{0}'.format(server.Variables.Port)
 )
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-preaccept=1')
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-preaccept=1')
 
 tr = Test.AddTestRun("Test one preaccept hook")
 tr.Processes.Default.StartBefore(server)
diff --git a/tests/gold_tests/tls_hooks/tls_hooks10.test.py b/tests/gold_tests/tls_hooks/tls_hooks10.test.py
index 4ff930a..59cccf5 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks10.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks10.test.py
@@ -24,7 +24,10 @@ Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.
 '''
 
-Test.SkipUnless(Condition.HasProgram("grep", "grep needs to be installed on system for this test to work"))
+Test.SkipUnless(
+    Condition.HasProgram("grep", "grep needs to be installed on system for this test to work"),
+    Condition.HasOpenSSLVersion("1.0.2")
+    )
 
 ts = Test.MakeATSProcess("ts", select_ports=False)
 server = Test.MakeOriginServer("server")
@@ -56,7 +59,7 @@ ts.Disk.remap_config.AddLine(
     'map https://example.com:4443 http://127.0.0.1:{0}'.format(server.Variables.Port)
 )
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-cert=1 -i=2')
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-cert=1 -i=2')
 
 tr = Test.AddTestRun("Test a combination of delayed and immediate cert hooks")
 tr.Processes.Default.StartBefore(server)
diff --git a/tests/gold_tests/tls_hooks/tls_hooks11.test.py b/tests/gold_tests/tls_hooks/tls_hooks11.test.py
index fd23c66..66d06a1 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks11.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks11.test.py
@@ -56,7 +56,7 @@ ts.Disk.remap_config.AddLine(
     'map https://example.com:4443 http://127.0.0.1:{0}'.format(server.Variables.Port)
 )
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-d=1')
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-d=1')
 
 tr = Test.AddTestRun("Test one delayed preaccept hook")
 tr.Processes.Default.StartBefore(server)
diff --git a/tests/gold_tests/tls_hooks/tls_hooks12.test.py b/tests/gold_tests/tls_hooks/tls_hooks12.test.py
index aff3bc3..252f92d 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks12.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks12.test.py
@@ -56,7 +56,7 @@ ts.Disk.remap_config.AddLine(
     'map https://example.com:4443 http://127.0.0.1:{0}'.format(server.Variables.Port)
 )
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-p=2 -d=1')
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-p=2 -d=1')
 
 tr = Test.AddTestRun("Test combination of delayed and immediate preaccept hook2")
 tr.Processes.Default.StartBefore(server)
diff --git a/tests/gold_tests/tls_hooks/tls_hooks2.test.py b/tests/gold_tests/tls_hooks/tls_hooks2.test.py
index e6dbd50..2b9a5b3 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks2.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks2.test.py
@@ -56,7 +56,7 @@ ts.Disk.remap_config.AddLine(
     'map https://example.com:4443 http://127.0.0.1:{0}'.format(server.Variables.Port)
 )
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-sni=1')
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-sni=1')
 
 tr = Test.AddTestRun("Test one sni hook")
 tr.Processes.Default.StartBefore(server)
diff --git a/tests/gold_tests/tls_hooks/tls_hooks3.test.py b/tests/gold_tests/tls_hooks/tls_hooks3.test.py
index c6ce668..d67b551 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks3.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks3.test.py
@@ -24,7 +24,10 @@ Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.
 '''
 
-Test.SkipUnless(Condition.HasProgram("grep", "grep needs to be installed on system for this test to work"))
+Test.SkipUnless(
+    Condition.HasProgram("grep", "grep needs to be installed on system for this test to work"),
+    Condition.HasOpenSSLVersion("1.0.2")
+    )
 
 ts = Test.MakeATSProcess("ts", select_ports=False)
 server = Test.MakeOriginServer("server")
@@ -56,7 +59,7 @@ ts.Disk.remap_config.AddLine(
     'map https://example.com:4443 http://127.0.0.1:{0}'.format(server.Variables.Port)
 )
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-cert=1')
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-cert=1')
 
 tr = Test.AddTestRun("Test one cert hook")
 tr.Processes.Default.StartBefore(server)
diff --git a/tests/gold_tests/tls_hooks/tls_hooks4.test.py b/tests/gold_tests/tls_hooks/tls_hooks4.test.py
index 8a9fb48..39a669d 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks4.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks4.test.py
@@ -24,7 +24,10 @@ Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.
 '''
 
-Test.SkipUnless(Condition.HasProgram("grep", "grep needs to be installed on system for this test to work"))
+Test.SkipUnless(
+    Condition.HasProgram("grep", "grep needs to be installed on system for this test to work"),
+    Condition.HasOpenSSLVersion("1.0.2")
+    )
 
 ts = Test.MakeATSProcess("ts", select_ports=False)
 server = Test.MakeOriginServer("server")
@@ -56,7 +59,7 @@ ts.Disk.remap_config.AddLine(
     'map https://example.com:4443 http://127.0.0.1:{0}'.format(server.Variables.Port)
 )
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-cert=1 -sni=1 -preaccept=1')
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-cert=1 -sni=1 -preaccept=1')
 
 tr = Test.AddTestRun("Test one sni, one preaccept, and one cert hook")
 tr.Processes.Default.StartBefore(server)
diff --git a/tests/gold_tests/tls_hooks/tls_hooks6.test.py b/tests/gold_tests/tls_hooks/tls_hooks6.test.py
index bfc0800..77fb0f8 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks6.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks6.test.py
@@ -56,7 +56,7 @@ ts.Disk.remap_config.AddLine(
     'map https://example.com:4443 http://127.0.0.1:{0}'.format(server.Variables.Port)
 )
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-preaccept=2')
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-preaccept=2')
 
 tr = Test.AddTestRun("Test two preaccept hooks")
 tr.Processes.Default.StartBefore(server)
diff --git a/tests/gold_tests/tls_hooks/tls_hooks7.test.py b/tests/gold_tests/tls_hooks/tls_hooks7.test.py
index bf93223..fc55856 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks7.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks7.test.py
@@ -56,7 +56,7 @@ ts.Disk.remap_config.AddLine(
     'map https://example.com:4443 http://127.0.0.1:{0}'.format(server.Variables.Port)
 )
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-sni=2')
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-sni=2')
 
 tr = Test.AddTestRun("Test two sni hooks")
 tr.Processes.Default.StartBefore(server)
diff --git a/tests/gold_tests/tls_hooks/tls_hooks8.test.py b/tests/gold_tests/tls_hooks/tls_hooks8.test.py
index 1e201e7..ecee204 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks8.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks8.test.py
@@ -24,7 +24,10 @@ Test.Summary = '''
 Test different combinations of TLS handshake hooks to ensure they are applied consistently.
 '''
 
-Test.SkipUnless(Condition.HasProgram("grep", "grep needs to be installed on system for this test to work"))
+Test.SkipUnless(
+    Condition.HasProgram("grep", "grep needs to be installed on system for this test to work"),
+    Condition.HasOpenSSLVersion("1.0.2")
+    )
 
 ts = Test.MakeATSProcess("ts", select_ports=False)
 server = Test.MakeOriginServer("server")
@@ -56,7 +59,7 @@ ts.Disk.remap_config.AddLine(
     'map https://example.com:4443 http://127.0.0.1:{0}'.format(server.Variables.Port)
 )
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-cert=2')
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-cert=2')
 
 tr = Test.AddTestRun("Test two cert hooks")
 tr.Processes.Default.StartBefore(server)
diff --git a/tests/gold_tests/tls_hooks/tls_hooks9.test.py b/tests/gold_tests/tls_hooks/tls_hooks9.test.py
index a975f0f..7f7cc33 100644
--- a/tests/gold_tests/tls_hooks/tls_hooks9.test.py
+++ b/tests/gold_tests/tls_hooks/tls_hooks9.test.py
@@ -56,7 +56,7 @@ ts.Disk.remap_config.AddLine(
     'map https://example.com:4443 http://127.0.0.1:{0}'.format(server.Variables.Port)
 )
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-i=1')
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_hook_test.cc'), ts, '-i=1')
 
 tr = Test.AddTestRun("Test one immediate cert hooks")
 tr.Processes.Default.StartBefore(server)
diff --git a/tests/gold_tests/transaction/txn.test.py b/tests/gold_tests/transaction/txn.test.py
index 1caa19c..747ee9d 100644
--- a/tests/gold_tests/transaction/txn.test.py
+++ b/tests/gold_tests/transaction/txn.test.py
@@ -35,7 +35,7 @@ request_header = {"headers": "GET / HTTP/1.1\r\n\r\n", "timestamp": "1469733493.
 # expected response from the origin server
 response_header = {"headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n", "timestamp": "1469733493.993", "body": ""}
 
-Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssntxnorder_verify.cc'), ts)
+Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssntxnorder_verify.cc'), ts)
 
 # add response to the server dictionary
 server.addResponse("sessionfile.log", request_header, response_header)

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].