trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [trafficserver] branch master updated: Test for proxy.config.http.connect_attempts_timeout
Date Fri, 03 Aug 2018 22:14:00 GMT
This is an automated email from the ASF dual-hosted git repository.

dagit 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 d378b6b  Test for proxy.config.http.connect_attempts_timeout
d378b6b is described below

commit d378b6b022df6902d8d0af6cac6fd0e93cd867d0
Author: Jesse Zhang <macisasandwich@gmail.com>
AuthorDate: Fri Aug 3 15:30:57 2018 -0500

    Test for proxy.config.http.connect_attempts_timeout
---
 tests/gold_tests/timeout/timeout.gold    |  3 +++
 tests/gold_tests/timeout/timeout.test.py | 46 ++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)

diff --git a/tests/gold_tests/timeout/timeout.gold b/tests/gold_tests/timeout/timeout.gold
new file mode 100644
index 0000000..8f26808
--- /dev/null
+++ b/tests/gold_tests/timeout/timeout.gold
@@ -0,0 +1,3 @@
+``
+HTTP/1.1 200 OK
+``
diff --git a/tests/gold_tests/timeout/timeout.test.py b/tests/gold_tests/timeout/timeout.test.py
new file mode 100644
index 0000000..e7f75d3
--- /dev/null
+++ b/tests/gold_tests/timeout/timeout.test.py
@@ -0,0 +1,46 @@
+'''
+'''
+#  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 = 'Testing ATS TCP handshake timeout'
+
+Test.SkipUnless(
+    Condition.HasProgram("curl", "Curl need to be installed on system for this test to work")
+)
+
+ts = Test.MakeATSProcess("ts")
+server = Test.MakeOriginServer("server", delay=15)
+dns = Test.MakeDNServer("dns", ip='127.0.0.1', default=['127.0.0.1'])
+
+request_header = {"headers": "GET /file HTTP/1.1\r\nHost: *\r\n\r\n", "timestamp": "5678",
"body": ""}
+response_header = {"headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n", "timestamp":
"5678", "body": ""}
+
+server.addResponse("sessionfile.log", request_header, response_header)
+
+ts.Disk.records_config.update({
+    'proxy.config.dns.nameservers': '127.0.0.1:{0}'.format(dns.Variables.Port),
+    'proxy.config.dns.resolv_conf': 'NULL', 
+    'proxy.config.url_remap.remap_required': 0,
+    'proxy.config.http.connect_attempts_timeout': 5
+})
+
+tr = Test.AddTestRun("tr")
+tr.Processes.Default.StartBefore(server)
+tr.Processes.Default.StartBefore(ts, ready=When.PortOpen(ts.Variables.port))
+tr.Processes.Default.StartBefore(dns)
+tr.Processes.Default.Command = 'curl -i -x http://127.0.0.1:{0} http://127.0.0.1:{1}/file'.format(ts.Variables.port,
server.Variables.Port)
+tr.Processes.Default.Streams.stdout = "timeout.gold"


Mime
View raw message