You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "bneradt (via GitHub)" <gi...@apache.org> on 2026/04/02 15:46:06 UTC
Re: [PR] tests/gold_tests/headers tests: use ATSReplayTest [trafficserver]
bneradt commented on code in PR #13033:
URL: https://github.com/apache/trafficserver/pull/13033#discussion_r3028864431
##########
tests/gold_tests/headers/accept_webp.test.py:
##########
@@ -18,71 +18,9 @@
# limitations under the License.
Test.Summary = '''
-Checking that we don't serve image/webp to clients that do not support it
+Check that ATS does not reuse a cached image/webp alternate for clients that do not advertise image/webp
'''
-Test.SkipIf(Condition.CurlUsingUnixDomainSocket())
Test.ContinueOnFail = True
-# Define default ATS
-ts = Test.MakeATSProcess("ts")
-server = Test.MakeOriginServer("server")
-
-testName = "accept_webp"
-request_header = {
- "headers":
- "GET / HTTP/1.1\r\nHost: www.example.com\r\nAccept: image/webp,image/png,image/svg+xml,image/*;q=0.8,video/*;q=0.8,*/*;q=0.5\r\n\r\n",
- "timestamp": "1469733493.993",
- "body": ""
-}
-response_header = {
- "headers": "HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Type: image/webp\r\nCache-Control: max-age=300\r\n",
- "timestamp": "1469733493.993",
- "body": "xxx"
-}
-server.addResponse("sessionlog.json", request_header, response_header)
-
-# ATS Configuration
-ts.Disk.records_config.update(
- {
- 'proxy.config.diags.debug.enabled': 1,
- 'proxy.config.diags.debug.tags': 'http_match',
- 'proxy.config.http.cache.ignore_accept_mismatch': 0,
- 'proxy.config.http.insert_response_via_str': 3,
- 'proxy.config.http.cache.http': 1,
- 'proxy.config.http.wait_for_cache': 1,
- })
-
-ts.Disk.remap_config.AddLine('map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port))
-
-# Test 1 - Request with image/webp support from the origin
-tr = Test.AddTestRun()
-tr.Processes.Default.StartBefore(server, ready=When.PortOpen(server.Variables.Port))
-tr.Processes.Default.StartBefore(Test.Processes.ts)
-tr.MakeCurlCommand(
- '-s -D - -v --ipv4 --http1.1 -H "Accept: image/webp,image/png,image/svg+xml,image/*;q=0.8,video/*;q=0.8,*/*;q=0.5" -H "Host: www.example.com" http://localhost:{0}/'
- .format(ts.Variables.port),
- ts=ts)
-tr.Processes.Default.ReturnCode = 0
-tr.Processes.Default.Streams.stderr = "gold/accept_webp.gold"
Review Comment:
Removed the orphaned gold files in a153b84cd and reran the focused headers ATSReplayTest batch in the fix_tickets_4 container.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org