diff --git a/tests/Pipfile b/tests/Pipfile index 48caf2c992e..153efc22137 100644 --- a/tests/Pipfile +++ b/tests/Pipfile @@ -34,7 +34,6 @@ dnslib = "*" # These are likely to be available via yum/dnf or apt-get requests = "*" gunicorn = "*" -httpbin = "*" psutil = "*" # Keep init.cli.ext updated with this required microserver version. @@ -44,11 +43,6 @@ jsonschema = "*" python-jose = "*" pyyaml ="*" -# The latest version of Werkzeug (2.1.0) breaks httpbin because it removes -# deprecated function `BaseResponse` that httpbin directly or indirectly -# depends upon. Pinning Wekrzeug for now until httpbin or its dependencies is -# updated for the changed API. -Werkzeug = "==2.0.3" flask = "==2.1.3" [requires] diff --git a/tests/gold_tests/autest-site/httpbin.test.ext b/tests/gold_tests/autest-site/httpbin.test.ext index 144eeb32032..dcd1787f5b4 100644 --- a/tests/gold_tests/autest-site/httpbin.test.ext +++ b/tests/gold_tests/autest-site/httpbin.test.ext @@ -19,24 +19,23 @@ from ports import get_port -def MakeHttpBinServer(self, name, port=False, ip=False, delay=False, public_ip=False, ssl=False, options={}): +def MakeHttpBinServer(self, name, ip='127.0.0.1', port=None, + options={}) -> 'Process': data_dir = os.path.join(self.RunDirectory, name) # create Process p = self.Processes.Process(name) - if (port == False): + if port is None: port = get_port(p, "Port") - if (ip == False): - ip = '127.0.0.1' - if (delay == False): - delay = 0 self._RootRunable.SkipUnless( - Condition.HasProgram("gunicorn", "gunicorn needs be installed with httpbin package for this extension to run") + Condition.HasProgram( + "go-httpbin", + "go-httpbin needs be installed and in PATH for this extension to run") ) - command = "gunicorn -b {0}:{1} httpbin:app".format(ip, port) + command = f"go-httpbin -host {ip} -port {port} " for flag, value in options.items(): - command += " {} {}".format(flag, value) + command += f"{flag} {value} " # create process p.Command = command diff --git a/tests/gold_tests/cache/background_fill.test.py b/tests/gold_tests/cache/background_fill.test.py index 2cc603c13fa..286d46e3802 100644 --- a/tests/gold_tests/cache/background_fill.test.py +++ b/tests/gold_tests/cache/background_fill.test.py @@ -91,7 +91,7 @@ def __testCase0(self): tr.Processes.Default.Command = f""" curl -X PURGE --http1.1 -vs http://127.0.0.1:{self.ts.Variables.port}/drip?duration=4; timeout 2 curl --http1.1 -vs http://127.0.0.1:{self.ts.Variables.port}/drip?duration=4; -sleep 2; +sleep 4; curl --http1.1 -vs http://127.0.0.1:{self.ts.Variables.port}/drip?duration=4 """ tr.Processes.Default.ReturnCode = 0 @@ -107,7 +107,7 @@ def __testCase1(self): tr.Processes.Default.Command = f""" curl -X PURGE --http1.1 -vsk https://127.0.0.1:{self.ts.Variables.ssl_port}/drip?duration=4; timeout 2 curl --http1.1 -vsk https://127.0.0.1:{self.ts.Variables.ssl_port}/drip?duration=4; -sleep 2; +sleep 4; curl --http1.1 -vsk https://127.0.0.1:{self.ts.Variables.ssl_port}/drip?duration=4 """ tr.Processes.Default.ReturnCode = 0 @@ -123,7 +123,7 @@ def __testCase2(self): tr.Processes.Default.Command = f""" curl -X PURGE --http2 -vsk https://127.0.0.1:{self.ts.Variables.ssl_port}/drip?duration=4; timeout 2 curl --http2 -vsk https://127.0.0.1:{self.ts.Variables.ssl_port}/drip?duration=4; -sleep 2; +sleep 4; curl --http2 -vsk https://127.0.0.1:{self.ts.Variables.ssl_port}/drip?duration=4 """ tr.Processes.Default.ReturnCode = 0 diff --git a/tests/gold_tests/connect/gold/connect_0_stderr.gold b/tests/gold_tests/connect/gold/connect_0_stderr.gold index 55a5d335913..169ee97dbe8 100644 --- a/tests/gold_tests/connect/gold/connect_0_stderr.gold +++ b/tests/gold_tests/connect/gold/connect_0_stderr.gold @@ -18,4 +18,3 @@ `` <`` `` -* Closing connection 0 diff --git a/tests/gold_tests/h2/gold/httpbin_0_stderr.gold b/tests/gold_tests/h2/gold/httpbin_0_stderr.gold index 3ed2777919c..4bf3431d7a0 100644 --- a/tests/gold_tests/h2/gold/httpbin_0_stderr.gold +++ b/tests/gold_tests/h2/gold/httpbin_0_stderr.gold @@ -5,11 +5,10 @@ > Accept: */* `` < HTTP/2 200 `` -< server: ATS/`` -< date: `` -< content-type: application/json `` +< content-type: application/json; encoding=utf-8 +< date: `` < content-length: `` < age: `` < via: ``ApacheTrafficServer/`` -`` +< server: ATS/`` diff --git a/tests/gold_tests/h2/gold/httpbin_1_stderr.gold b/tests/gold_tests/h2/gold/httpbin_1_stderr.gold index 8c6bc6cb77e..b2d3b2ed63d 100644 --- a/tests/gold_tests/h2/gold/httpbin_1_stderr.gold +++ b/tests/gold_tests/h2/gold/httpbin_1_stderr.gold @@ -5,11 +5,11 @@ > Accept: */* `` < HTTP/2 200 `` -< server: ATS/`` -< date: `` -< content-type: application/octet-stream `` -< content-length: 0`` +< content-type: application/octet-stream +< date: `` +< content-length: `` < age: `` < via: ``ApacheTrafficServer/`` +< server: ATS/`` `` diff --git a/tests/gold_tests/h2/gold/httpbin_1_stdout.gold b/tests/gold_tests/h2/gold/httpbin_1_stdout.gold index e69de29bb2d..cf637de5885 100644 --- a/tests/gold_tests/h2/gold/httpbin_1_stdout.gold +++ b/tests/gold_tests/h2/gold/httpbin_1_stdout.gold @@ -0,0 +1 @@ +`` diff --git a/tests/gold_tests/h2/gold/httpbin_2_stderr.gold b/tests/gold_tests/h2/gold/httpbin_2_stderr.gold index c53bba6a7b1..5bd16ccf95e 100644 --- a/tests/gold_tests/h2/gold/httpbin_2_stderr.gold +++ b/tests/gold_tests/h2/gold/httpbin_2_stderr.gold @@ -5,10 +5,10 @@ > Accept: */* `` < HTTP/2 200 `` -< server: ATS/`` -< date: `` -< content-type: application/octet-stream `` +< content-type: application/octet-stream +< date: `` < age: `` < via: ``ApacheTrafficServer/`` +< server: ATS/`` `` diff --git a/tests/gold_tests/h2/gold/httpbin_2_stdout.gold b/tests/gold_tests/h2/gold/httpbin_2_stdout.gold index 9345ad17fce..d24de922216 100644 --- a/tests/gold_tests/h2/gold/httpbin_2_stdout.gold +++ b/tests/gold_tests/h2/gold/httpbin_2_stdout.gold @@ -1 +1 @@ -b99e42637ce13160c48e9b2bc9ed2d4dd175bc6cf44c7814b01e4853f262b284 - +7a884625d64511d986423b361d75a5d037d7fa62b9ecf0959b93adda1afe07ef - diff --git a/tests/gold_tests/h2/gold/httpbin_3_stdout.gold b/tests/gold_tests/h2/gold/httpbin_3_stdout.gold index 610580810ce..0a1227adb2a 100644 --- a/tests/gold_tests/h2/gold/httpbin_3_stdout.gold +++ b/tests/gold_tests/h2/gold/httpbin_3_stdout.gold @@ -1,7 +1,9 @@ { `` "form": { - "key": "value" + "key": [ + "value" + ] }, `` } diff --git a/tests/gold_tests/h2/gold/httpbin_access.gold b/tests/gold_tests/h2/gold/httpbin_access.gold index d409c47d13a..c087cccef44 100644 --- a/tests/gold_tests/h2/gold/httpbin_access.gold +++ b/tests/gold_tests/h2/gold/httpbin_access.gold @@ -1,4 +1,4 @@ [``] GET http://127.0.0.1:``/get HTTP/1.1 http/2 `` `` TCP_MISS 200 `` -[``] GET http://127.0.0.1:``/bytes/0 HTTP/1.1 http/2 `` `` TCP_MISS 200 0 +[``] GET http://127.0.0.1:``/bytes/0 HTTP/1.1 http/2 `` `` TCP_MISS 200 1 [``] GET http://127.0.0.1:``/stream-bytes/102400?seed=0 HTTP/1.1 http/2 `` `` TCP_MISS 200 102400 `` diff --git a/tests/gold_tests/h2/httpbin.test.py b/tests/gold_tests/h2/httpbin.test.py index 7af2673d475..96b9631c872 100644 --- a/tests/gold_tests/h2/httpbin.test.py +++ b/tests/gold_tests/h2/httpbin.test.py @@ -96,7 +96,9 @@ test_run.Processes.Default.Streams.stderr = Testers.GoldFile("gold/httpbin_0_stderr.gold", case_insensitive=True) test_run.StillRunningAfter = httpbin -# Test Case 1: Empty response body +# Test Case 1: Attempt an empty response body. +# Note: go-httpbin incorrectly returns a body of 1 byte instead of 0 bytes. +# https://github.com/mccutchen/go-httpbin/issues/112 test_run = Test.AddTestRun() test_run.Processes.Default.Command = 'curl -vs -k --http2 https://127.0.0.1:{0}/bytes/0'.format(ts.Variables.ssl_port) test_run.Processes.Default.ReturnCode = 0 diff --git a/tests/gold_tests/post/post-continue.test.py b/tests/gold_tests/post/post-continue.test.py index 6ae979f283c..89cf83b085b 100644 --- a/tests/gold_tests/post/post-continue.test.py +++ b/tests/gold_tests/post/post-continue.test.py @@ -33,7 +33,8 @@ # ---- # Setup httpbin Origin Server # ---- -httpbin = Test.MakeHttpBinServer("httpbin") +replay_file = "replay/post-continue.replay.yaml" +server = Test.MakeVerifierServerProcess("server", replay_file) # ---- # Setup ATS @@ -47,7 +48,7 @@ ts2.addDefaultSSLFiles() ts.Disk.remap_config.AddLine( - 'map / http://127.0.0.1:{0}'.format(httpbin.Variables.Port) + 'map / http://127.0.0.1:{0}'.format(server.Variables.http_port) ) ts.Disk.ssl_multicert_config.AddLine( 'dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key' @@ -60,7 +61,7 @@ }) ts2.Disk.remap_config.AddLine( - 'map / http://127.0.0.1:{0}'.format(httpbin.Variables.Port) + 'map / http://127.0.0.1:{0}'.format(server.Variables.http_port) ) ts2.Disk.ssl_multicert_config.AddLine( 'dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key' @@ -79,165 +80,165 @@ big_post_body_file.close() test_run = Test.AddTestRun("http1.1 POST small body with Expect header") -test_run.Processes.Default.StartBefore(httpbin, ready=When.PortOpen(httpbin.Variables.Port)) -test_run.Processes.Default.StartBefore(Test.Processes.ts) -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "Expect: 100-continue" -d "small body" -k https://127.0.0.1:{0}/post'.format( +test_run.Processes.Default.StartBefore(server) +test_run.Processes.Default.StartBefore(ts) +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "uuid: post" -H "Expect: 100-continue" -d "small body" -k https://127.0.0.1:{0}/post'.format( ts.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h1.gold" -test_run.Processes.Default.Streams.All += Testers.ContainsExpression("HTTP/1.1 100 Continue", "Has Expect header") +test_run.Processes.Default.Streams.All += Testers.ContainsExpression("HTTP/1.1 100 continue", "Has Expect header") test_run.Processes.Default.Streams.All += Testers.ContainsExpression("Expect: 100-continue", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts test_run.Processes.Default.ReturnCode = 0 test_run = Test.AddTestRun("http1.1 POST large body with Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "Expect: 100-continue" -d @big_post_body -k https://127.0.0.1:{0}/post'.format( +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "uuid: post" -H "Expect: 100-continue" -d @big_post_body -k https://127.0.0.1:{0}/post'.format( ts.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h1.gold" -test_run.Processes.Default.Streams.All += Testers.ContainsExpression("HTTP/1.1 100 Continue", "Has Expect header") +test_run.Processes.Default.Streams.All += Testers.ContainsExpression("HTTP/1.1 100 continue", "Has Expect header") test_run.Processes.Default.Streams.All += Testers.ContainsExpression("Expect: 100-continue", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts test_run.Processes.Default.ReturnCode = 0 test_run = Test.AddTestRun("http1.1 POST small body w/o Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "Expect:" -d "small body" -k https://127.0.0.1:{0}/post'.format( +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "uuid: post" -H "Expect:" -d "small body" -k https://127.0.0.1:{0}/post'.format( ts.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h1.gold" -test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("HTTP/1.1 100 Continue", "Does not have Expect header") +test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("HTTP/1.1 100 continue", "Does not have Expect header") test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("Expect: 100-continue", "Does not have Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts test_run.Processes.Default.ReturnCode = 0 test_run = Test.AddTestRun("http1.1 POST large body w/o Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "Expect: " -d @big_post_body -k https://127.0.0.1:{0}/post'.format( +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "uuid: post" -H "Expect: " -d @big_post_body -k https://127.0.0.1:{0}/post'.format( ts.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h1.gold" -test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("HTTP/1.1 100 Continue", "Does not have Expect header") +test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("HTTP/1.1 100 continue", "Does not have Expect header") test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("Expect: 100-continue", "Does not have Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts test_run.Processes.Default.ReturnCode = 0 test_run = Test.AddTestRun("http2 POST small body with Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "Expect: 100-continue" -d "small body" -k https://127.0.0.1:{0}/post'.format( +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "uuid: post" -H "Expect: 100-continue" -d "small body" -k https://127.0.0.1:{0}/post'.format( ts.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h2.gold" test_run.Processes.Default.Streams.All += Testers.ContainsExpression("xpect: 100-continue", "Has expect header") test_run.Processes.Default.Streams.All += Testers.ContainsExpression("HTTP/2 100", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts test_run.Processes.Default.ReturnCode = 0 test_run = Test.AddTestRun("http2 POST large body with Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "Expect: 100-continue" -d @big_post_body -k https://127.0.0.1:{0}/post'.format( +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "uuid: post" -H "Expect: 100-continue" -d @big_post_body -k https://127.0.0.1:{0}/post'.format( ts.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h2.gold" test_run.Processes.Default.Streams.All += Testers.ContainsExpression("xpect: 100-continue", "Has expect header") test_run.Processes.Default.Streams.All += Testers.ContainsExpression("HTTP/2 100", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts test_run.Processes.Default.ReturnCode = 0 test_run = Test.AddTestRun("http2 POST small body w/o Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "Expect: " -d "small body" -k https://127.0.0.1:{0}/post'.format( +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "uuid: post" -H "Expect: " -d "small body" -k https://127.0.0.1:{0}/post'.format( ts.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h2.gold" test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("xpect: 100-continue", "Has expect header") test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("HTTP/2 100", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts test_run.Processes.Default.ReturnCode = 0 test_run = Test.AddTestRun("http2 POST large body w/o Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "Expect: " -d @big_post_body -k https://127.0.0.1:{0}/post'.format( +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "uuid: post" -H "Expect: " -d @big_post_body -k https://127.0.0.1:{0}/post'.format( ts.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h2.gold" test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("xpect: 100-continue", "Has expect header") test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("HTTP/2 100", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts test_run.Processes.Default.ReturnCode = 0 # Do them all again against the TS that will return 100-continue immediately -test_run = Test.AddTestRun("http1.1 POST small body with Expect header") +test_run = Test.AddTestRun("http1.1 POST small body with Expect header, immediate") test_run.Processes.Default.StartBefore(Test.Processes.ts2) -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "Expect: 100-continue" -d "small body" -k https://127.0.0.1:{0}/post'.format( +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "uuid: post" -H "Expect: 100-continue" -d "small body" -k https://127.0.0.1:{0}/post'.format( ts2.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h1.gold" test_run.Processes.Default.Streams.All += Testers.ContainsExpression("HTTP/1.1 100 Continue", "Has Expect header") test_run.Processes.Default.Streams.All += Testers.ContainsExpression("Expect: 100-continue", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts2 test_run.Processes.Default.ReturnCode = 0 -test_run = Test.AddTestRun("http1.1 POST large body with Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "Expect: 100-continue" -d @big_post_body -k https://127.0.0.1:{0}/post'.format( +test_run = Test.AddTestRun("http1.1 POST large body with Expect header, immediate") +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "uuid: post" -H "Expect: 100-continue" -d @big_post_body -k https://127.0.0.1:{0}/post'.format( ts2.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h1.gold" test_run.Processes.Default.Streams.All += Testers.ContainsExpression("HTTP/1.1 100 Continue", "Has Expect header") test_run.Processes.Default.Streams.All += Testers.ContainsExpression("Expect: 100-continue", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts2 test_run.Processes.Default.ReturnCode = 0 -test_run = Test.AddTestRun("http1.1 POST small body w/o Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "Expect:" -d "small body" -k https://127.0.0.1:{0}/post'.format( +test_run = Test.AddTestRun("http1.1 POST small body w/o Expect header, immediate") +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "uuid: post" -H "Expect:" -d "small body" -k https://127.0.0.1:{0}/post'.format( ts2.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h1.gold" test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("HTTP/1.1 100 Continue", "Has Expect header") test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("Expect 100-continue", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts2 test_run.Processes.Default.ReturnCode = 0 -test_run = Test.AddTestRun("http1.1 POST large body w/o Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "Expect: " -d @big_post_body -k https://127.0.0.1:{0}/post'.format( +test_run = Test.AddTestRun("http1.1 POST large body w/o Expect header, immediate") +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http1.1 -H "uuid: post" -H "Expect: " -d @big_post_body -k https://127.0.0.1:{0}/post'.format( ts2.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h1.gold" test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("HTTP/1.1 100 Continue", "Has Expect header") test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("Expect 100-continue", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts2 test_run.Processes.Default.ReturnCode = 0 -test_run = Test.AddTestRun("http2 POST small body with Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "Expect: 100-continue" -d "small body" -k https://127.0.0.1:{0}/post'.format( +test_run = Test.AddTestRun("http2 POST small body with Expect header, immediate") +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "uuid: post" -H "Expect: 100-continue" -d "small body" -k https://127.0.0.1:{0}/post'.format( ts2.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h2.gold" test_run.Processes.Default.Streams.All += Testers.ContainsExpression("xpect: 100-continue", "Has expect header") test_run.Processes.Default.Streams.All += Testers.ContainsExpression("HTTP/2 100", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts2 test_run.Processes.Default.ReturnCode = 0 -test_run = Test.AddTestRun("http2 POST large body with Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "Expect: 100-continue" -d @big_post_body -k https://127.0.0.1:{0}/post'.format( +test_run = Test.AddTestRun("http2 POST large body with Expect header, immediate") +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "uuid: post" -H "Expect: 100-continue" -d @big_post_body -k https://127.0.0.1:{0}/post'.format( ts2.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h2.gold" test_run.Processes.Default.Streams.All += Testers.ContainsExpression("xpect: 100-continue", "Has expect header") test_run.Processes.Default.Streams.All += Testers.ContainsExpression("HTTP/2 100", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts2 test_run.Processes.Default.ReturnCode = 0 -test_run = Test.AddTestRun("http2 POST small body w/o Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "Expect: " -d "small body" -k https://127.0.0.1:{0}/post'.format( +test_run = Test.AddTestRun("http2 POST small body w/o Expect header, immediate") +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "uuid: post" -H "Expect: " -d "small body" -k https://127.0.0.1:{0}/post'.format( ts2.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h2.gold" test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("xpect: 100-continue", "Has expect header") test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("HTTP/2 100", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts2 test_run.Processes.Default.ReturnCode = 0 -test_run = Test.AddTestRun("http2 POST large body w/o Expect header") -test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "Expect: " -d @big_post_body -k https://127.0.0.1:{0}/post'.format( +test_run = Test.AddTestRun("http2 POST large body w/o Expect header, immediate") +test_run.Processes.Default.Command = 'curl -v -o /dev/null --http2 -H "uuid: post" -H "Expect: " -d @big_post_body -k https://127.0.0.1:{0}/post'.format( ts2.Variables.ssl_port) test_run.Processes.Default.Streams.All = "gold/post-h2.gold" test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("xpect: 100-continue", "Has expect header") test_run.Processes.Default.Streams.All += Testers.ExcludesExpression("HTTP/2 100", "Has Expect header") -test_run.StillRunningAfter = httpbin +test_run.StillRunningAfter = server test_run.StillRunningAfter = ts2 test_run.Processes.Default.ReturnCode = 0 diff --git a/tests/gold_tests/post/replay/post-continue.replay.yaml b/tests/gold_tests/post/replay/post-continue.replay.yaml new file mode 100644 index 00000000000..884e25ff4f2 --- /dev/null +++ b/tests/gold_tests/post/replay/post-continue.replay.yaml @@ -0,0 +1,43 @@ +# 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. + +# +# This replay file assumes that caching is enabled and +# proxy.config.http.cache.ignore_server_no_cache is set to 1(meaning the +# cache-control directives in responses to bypass the cache is ignored) +meta: + version: "1.0" + +sessions: + - transactions: + # The client is actually curl + - client-request: + method: "POST" + version: "1.1" + headers: + fields: + - [uuid, post] + - [Expect, 100-continue] + + proxy-request: + method: "POST" + + server-response: + status: 200 + reason: OK + headers: + fields: + - [Content-Length, 4] diff --git a/tests/gold_tests/proxy_protocol/gold/test_case_0_stderr.gold b/tests/gold_tests/proxy_protocol/gold/test_case_0_stderr.gold index 903ab390edf..7c11992124d 100644 --- a/tests/gold_tests/proxy_protocol/gold/test_case_0_stderr.gold +++ b/tests/gold_tests/proxy_protocol/gold/test_case_0_stderr.gold @@ -5,7 +5,10 @@ > User-Agent: curl/`` `` < HTTP/1.1 200 OK -< Server: ATS/`` +`` < Date: `` +`` < Age: `` `` +< Server: ATS/`` +`` diff --git a/tests/gold_tests/proxy_protocol/gold/test_case_0_stdout.gold b/tests/gold_tests/proxy_protocol/gold/test_case_0_stdout.gold index ad84f31d9d2..2af37b3aa71 100644 --- a/tests/gold_tests/proxy_protocol/gold/test_case_0_stdout.gold +++ b/tests/gold_tests/proxy_protocol/gold/test_case_0_stdout.gold @@ -2,7 +2,9 @@ `` "headers": { `` - "Forwarded": "for=127.0.0.1;by=127.0.0.1;proto=http", + "Forwarded": [ + "for=127.0.0.1;by=127.0.0.1;proto=http" + ], `` }, `` diff --git a/tests/gold_tests/proxy_protocol/gold/test_case_1_stderr.gold b/tests/gold_tests/proxy_protocol/gold/test_case_1_stderr.gold index 903ab390edf..7c11992124d 100644 --- a/tests/gold_tests/proxy_protocol/gold/test_case_1_stderr.gold +++ b/tests/gold_tests/proxy_protocol/gold/test_case_1_stderr.gold @@ -5,7 +5,10 @@ > User-Agent: curl/`` `` < HTTP/1.1 200 OK -< Server: ATS/`` +`` < Date: `` +`` < Age: `` `` +< Server: ATS/`` +`` diff --git a/tests/gold_tests/proxy_protocol/gold/test_case_1_stdout.gold b/tests/gold_tests/proxy_protocol/gold/test_case_1_stdout.gold index cac9e4fea4d..10c9fd4b0dc 100644 --- a/tests/gold_tests/proxy_protocol/gold/test_case_1_stdout.gold +++ b/tests/gold_tests/proxy_protocol/gold/test_case_1_stdout.gold @@ -2,7 +2,9 @@ `` "headers": { `` - "Forwarded": "for=127.0.0.1;by=127.0.0.1;proto=https", + "Forwarded": [ + "for=127.0.0.1;by=127.0.0.1;proto=https" + ], `` }, `` diff --git a/tests/gold_tests/proxy_protocol/gold/test_case_2_stdout.gold b/tests/gold_tests/proxy_protocol/gold/test_case_2_stdout.gold index e10a9aa5527..7542abde1cd 100644 --- a/tests/gold_tests/proxy_protocol/gold/test_case_2_stdout.gold +++ b/tests/gold_tests/proxy_protocol/gold/test_case_2_stdout.gold @@ -1,13 +1,18 @@ HTTP/1.1 200 OK -Server: ATS/`` +`` Date: `` +`` Age: `` +`` +Server: ATS/`` { `` "headers":``{ `` - "Forwarded":``"for=198.51.100.1;by=127.0.0.1;proto=http", + "Forwarded": [ + "for=198.51.100.1;by=127.0.0.1;proto=http" + ], `` }, `` diff --git a/tests/gold_tests/proxy_protocol/gold/test_case_3_stderr.gold b/tests/gold_tests/proxy_protocol/gold/test_case_3_stderr.gold index f7ae4307911..d613cd8957f 100644 --- a/tests/gold_tests/proxy_protocol/gold/test_case_3_stderr.gold +++ b/tests/gold_tests/proxy_protocol/gold/test_case_3_stderr.gold @@ -4,7 +4,10 @@ > User-Agent: curl/`` `` < HTTP/1.1 200 OK -< Server: ATS/`` +`` < Date: `` +`` < Age: `` `` +< Server: ATS/`` +`` diff --git a/tests/gold_tests/proxy_protocol/gold/test_case_3_stdout.gold b/tests/gold_tests/proxy_protocol/gold/test_case_3_stdout.gold index ad84f31d9d2..2af37b3aa71 100644 --- a/tests/gold_tests/proxy_protocol/gold/test_case_3_stdout.gold +++ b/tests/gold_tests/proxy_protocol/gold/test_case_3_stdout.gold @@ -2,7 +2,9 @@ `` "headers": { `` - "Forwarded": "for=127.0.0.1;by=127.0.0.1;proto=http", + "Forwarded": [ + "for=127.0.0.1;by=127.0.0.1;proto=http" + ], `` }, `` diff --git a/tests/gold_tests/proxy_protocol/gold/test_case_4_stderr.gold b/tests/gold_tests/proxy_protocol/gold/test_case_4_stderr.gold index f7ae4307911..d613cd8957f 100644 --- a/tests/gold_tests/proxy_protocol/gold/test_case_4_stderr.gold +++ b/tests/gold_tests/proxy_protocol/gold/test_case_4_stderr.gold @@ -4,7 +4,10 @@ > User-Agent: curl/`` `` < HTTP/1.1 200 OK -< Server: ATS/`` +`` < Date: `` +`` < Age: `` `` +< Server: ATS/`` +`` diff --git a/tests/gold_tests/proxy_protocol/gold/test_case_4_stdout.gold b/tests/gold_tests/proxy_protocol/gold/test_case_4_stdout.gold index cac9e4fea4d..10c9fd4b0dc 100644 --- a/tests/gold_tests/proxy_protocol/gold/test_case_4_stdout.gold +++ b/tests/gold_tests/proxy_protocol/gold/test_case_4_stdout.gold @@ -2,7 +2,9 @@ `` "headers": { `` - "Forwarded": "for=127.0.0.1;by=127.0.0.1;proto=https", + "Forwarded": [ + "for=127.0.0.1;by=127.0.0.1;proto=https" + ], `` }, ``