This is an automated email from the ASF dual-hosted git repository.
rrm 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 4a3c1b0 Au test: HTTP/2 client sends POST, server delays 2 minutes,
sends 200 KB.
4a3c1b0 is described below
commit 4a3c1b062f3cf843fbe3754ea175951a7bf2c2a8
Author: Walter Karas <[email protected]>
AuthorDate: Wed Apr 29 11:34:43 2020 -0500
Au test: HTTP/2 client sends POST, server delays 2 minutes, sends 200 KB.
Test is skipped by default for CI because of long delay.
---
tests/gold_tests/post_slow_server/check.sh | 19 ++++++
.../post_slow_server/post_slow_server.test.py | 75 ++++++++++++++++++++++
tests/gold_tests/post_slow_server/server.sh | 50 +++++++++++++++
tests/gold_tests/post_slow_server/ssl/server.key | 15 +++++
tests/gold_tests/post_slow_server/ssl/server.pem | 32 +++++++++
5 files changed, 191 insertions(+)
diff --git a/tests/gold_tests/post_slow_server/check.sh
b/tests/gold_tests/post_slow_server/check.sh
new file mode 100755
index 0000000..73220b0
--- /dev/null
+++ b/tests/gold_tests/post_slow_server/check.sh
@@ -0,0 +1,19 @@
+# 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.
+
+# Check that curl command received 200 KBytes of data (in 8-byte lines).
+
+(( $( grep '^1234567$' curl.log | wc -l ) == ((200 * 1024) / 8) ))
diff --git a/tests/gold_tests/post_slow_server/post_slow_server.test.py
b/tests/gold_tests/post_slow_server/post_slow_server.test.py
new file mode 100644
index 0000000..8d12ee4
--- /dev/null
+++ b/tests/gold_tests/post_slow_server/post_slow_server.test.py
@@ -0,0 +1,75 @@
+'''
+Server receives POST, sent by client over HTTP/2, waits 2 minutes, then sends
response with 200 KBytes of data
+'''
+# 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 = '''
+Server receives POST, sent by client over HTTP/2, waits 2 minutes, then sends
response with 200 KBytes of data
+'''
+
+# Because of the 2 minute delay, we don't want to run this test in CI checks.
Comment out this line to run it.
+Test.SkipIf(Condition.true("Test takes too long to run it in CI."))
+
+Test.SkipUnless(
+ Condition.HasCurlFeature('http2')
+)
+
+ts = Test.MakeATSProcess("ts", enable_tls=True)
+
+ts.addSSLfile("ssl/server.pem")
+ts.addSSLfile("ssl/server.key")
+
+ts.Disk.records_config.update({
+ 'proxy.config.diags.debug.enabled': 1,
+ 'proxy.config.diags.debug.tags': 'http',
+ 'proxy.config.http.cache.http': 0, # disable caching.
+ 'proxy.config.proxy_name': 'Poxy_Proxy', # This will be the server name.
+ '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.http.transaction_no_activity_timeout_out': 150,
+ 'proxy.config.http2.no_activity_timeout_in': 150,
+})
+
+ts.Disk.ssl_multicert_config.AddLine(
+ 'dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key'
+)
+
+Test.GetTcpPort("server_port")
+
+ts.Disk.remap_config.AddLine(
+ 'map https://localhost
http://localhost:{}'.format(Test.Variables.server_port)
+)
+
+server = Test.Processes.Process(
+ "server", "bash -c '" + Test.TestDirectory + "/server.sh
{}'".format(Test.Variables.server_port)
+)
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = (
+ 'curl --request POST --verbose --ipv4 --http2 --insecure --header
"Content-Length: 0"' +
+ r" --header 'Host: localhost' https://localhost:{}/xyz 2>&1 | tr '\r' '\n'
".format(ts.Variables.ssl_port) +
+ ' > curl.log'
+)
+tr.Processes.Default.ReturnCode = 0
+tr.Processes.Default.StartBefore(server)
+tr.Processes.Default.StartBefore(ts)
+
+# Make sure the curl command received 200 KB of data.
+#
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = "bash -c '" + Test.TestDirectory + "/check.sh'"
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/post_slow_server/server.sh
b/tests/gold_tests/post_slow_server/server.sh
new file mode 100755
index 0000000..7f4e7c3
--- /dev/null
+++ b/tests/gold_tests/post_slow_server/server.sh
@@ -0,0 +1,50 @@
+# 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.
+
+# A very simple cleartext server for one HTTP transaction. Does no validation
of the Request message.
+# Sends a Response message with 200 Kbytes of (filler) data. Waits two
minutes after receiving the full
+# Request before sending the response. One and only parameter is the number
of the TCP port to serve on.
+
+response ()
+{
+ # Wait for end of Request message.
+ #
+ while (( 1 == 1 ))
+ do
+ if tr '\r' '=' < rcv_file | grep '^=$' > /dev/null
+ then
+ break;
+ fi
+ sleep 1
+ done
+
+ sleep 2m
+
+ # Send back 200 KBytes of data
+
+ printf "HTTP/1.1 200 OK\r\n"
+ printf "Content-Length: %d\r\n" $(( 200 * 1024 ))
+ printf "\r\n"
+
+ let I=0
+ while (( I < ((200 * 1024) / 8) ))
+ do
+ printf "1234567\n"
+ let I=I+1
+ done
+}
+
+response | nc -l $1 > rcv_file
diff --git a/tests/gold_tests/post_slow_server/ssl/server.key
b/tests/gold_tests/post_slow_server/ssl/server.key
new file mode 100644
index 0000000..4c7a661
--- /dev/null
+++ b/tests/gold_tests/post_slow_server/ssl/server.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDWMHOiUF+ORmZjAxI8MWE9dblb7gQSJ36WCXlPFiFx6ynF+S1E
+kXAYpIip5X0pzDUaIbLukxJUAAnOtMEO0PCgxJQUrEtRWh8wiJdbdQJF0Zs/9R+u
+SUgb61f+mdTQvhqefBGx+xrpfAcgtcWiZuSA9Q3fvpDj5WOWSPWXBUuxywIDAQAB
+AoGBAJPxRX2gjFAGWmQbU/YVmXfNH6navh8X/nx9sLeqrpE0AFeJI/ZPiqDKzMal
+B43eSfNxwVi+ZxN0L1ICUbL9KKZvHs/QBxWLA1fGVAXrz7sRplEVvakPpTfHoEnv
+sKaMWVKaK/S5WGbDhElb6zb/Lwo19DsIAPjGYqFvzFJBmobJAkEA9iSeTGkR9X26
+GywZoYrIMlRh34htOIRx1UUq88rFzdrCF21kQ4lhBIkX5OZMMy652i2gyak4OZTe
+YewIv8jw9QJBAN7EQNHG8jPwXfVp91/fqxVQEfumuP2i6uiWWYQgZCmla2+0xcLZ
+pMQ6sQEe10hhTrVnzHgAUVp50Ntn2jwBX78CQF09veGAI9d1Cxzj9cmmAvRd1r2Q
+tp8kPOLnUsALXib+6WtqewLCdcf8DtsdClyRJMIraq85tRzK8fryKNZNzkkCQEgA
+yS7FDj5JgCU15hZgFk1iPx3HCt44jZM2HaL+UUHAzRQjKxTLAl3G1rWVAWLMyQML
+lORoveLvotl4HOruSsMCQQCAx9dV9JUSFoyc1CWILp/FgUH/se4cjQCThGO0DoQQ
+vGTYmntY7j9WRJ9esQrjdD6Clw8zM/45GIBNwnXzqo7Z
+-----END RSA PRIVATE KEY-----
diff --git a/tests/gold_tests/post_slow_server/ssl/server.pem
b/tests/gold_tests/post_slow_server/ssl/server.pem
new file mode 100644
index 0000000..58b9b97
--- /dev/null
+++ b/tests/gold_tests/post_slow_server/ssl/server.pem
@@ -0,0 +1,32 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDWMHOiUF+ORmZjAxI8MWE9dblb7gQSJ36WCXlPFiFx6ynF+S1E
+kXAYpIip5X0pzDUaIbLukxJUAAnOtMEO0PCgxJQUrEtRWh8wiJdbdQJF0Zs/9R+u
+SUgb61f+mdTQvhqefBGx+xrpfAcgtcWiZuSA9Q3fvpDj5WOWSPWXBUuxywIDAQAB
+AoGBAJPxRX2gjFAGWmQbU/YVmXfNH6navh8X/nx9sLeqrpE0AFeJI/ZPiqDKzMal
+B43eSfNxwVi+ZxN0L1ICUbL9KKZvHs/QBxWLA1fGVAXrz7sRplEVvakPpTfHoEnv
+sKaMWVKaK/S5WGbDhElb6zb/Lwo19DsIAPjGYqFvzFJBmobJAkEA9iSeTGkR9X26
+GywZoYrIMlRh34htOIRx1UUq88rFzdrCF21kQ4lhBIkX5OZMMy652i2gyak4OZTe
+YewIv8jw9QJBAN7EQNHG8jPwXfVp91/fqxVQEfumuP2i6uiWWYQgZCmla2+0xcLZ
+pMQ6sQEe10hhTrVnzHgAUVp50Ntn2jwBX78CQF09veGAI9d1Cxzj9cmmAvRd1r2Q
+tp8kPOLnUsALXib+6WtqewLCdcf8DtsdClyRJMIraq85tRzK8fryKNZNzkkCQEgA
+yS7FDj5JgCU15hZgFk1iPx3HCt44jZM2HaL+UUHAzRQjKxTLAl3G1rWVAWLMyQML
+lORoveLvotl4HOruSsMCQQCAx9dV9JUSFoy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