trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [trafficserver] branch master updated: Test: Add validation for VIA test to not run if local curl doesn't support HTTP/2.
Date Fri, 21 Apr 2017 00:39:44 GMT
This is an automated email from the ASF dual-hosted git repository.

amc 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  31d1f3e   Test: Add validation for VIA test to not run if local curl doesn't support
HTTP/2.
31d1f3e is described below

commit 31d1f3efa64d4c17234eaebca626ddb87526bf96
Author: Alan M. Carroll <solidwallofcode@yahoo-inc.com>
AuthorDate: Thu Apr 20 13:57:40 2017 -0500

    Test: Add validation for VIA test to not run if local curl doesn't support HTTP/2.
---
 tests/gold_tests/headers/via.test.py | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/tests/gold_tests/headers/via.test.py b/tests/gold_tests/headers/via.test.py
index 8450b8e..8e0b4c5 100644
--- a/tests/gold_tests/headers/via.test.py
+++ b/tests/gold_tests/headers/via.test.py
@@ -25,11 +25,29 @@ Test.Summary = '''
 Check VIA header for protocol stack data.
 '''
 
-# need Curl
+# Check if the local curl has a specific feature.
+# This should be made generally available.
+def RequireCurlFeature(tag):
+  FEATURE_TAG = 'Features:'
+  tag = tag.lower();
+  try:
+    text = subprocess.check_output(['curl', '--version'], universal_newlines = True)
+    for line in text.splitlines():
+      if (line.startswith(FEATURE_TAG)):
+        line = line[len(FEATURE_TAG):].lower()
+        tokens = line.split();
+        for t in tokens:
+          if t == tag:
+            return True
+  except subprocess.CalledProcessError:
+    pass # no curl at all, it clearly doesn't have the required feature.
+  return False
+
 Test.SkipUnless(
-    Condition.HasProgram("curl","curl is required for this test but was not found on the
path. ")
+    Condition.Condition(lambda : RequireCurlFeature('http2'), "Via test requires a curl that
supports HTTP/2")
     )
 Test.ContinueOnFail=True
+
 # Define default ATS
 ts=Test.MakeATSProcess("ts",select_ports=False)
 server=Test.MakeOriginServer("server", options={'--load' : os.path.join(Test.TestDirectory,
'via-observer.py')})

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

Mime
View raw message