This is an automated email from the ASF dual-hosted git repository.
masaori 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 b4021827fe AuTest: cache after following redirect (#12425)
b4021827fe is described below
commit b4021827fe049bc521317c8e2a94dd94311db5bf
Author: Masaori Koshiba <[email protected]>
AuthorDate: Wed Aug 6 07:36:25 2025 +0900
AuTest: cache after following redirect (#12425)
* Move replay.yaml file under replay/
* AuTest: cache after following redirect
---
.../redirect_to_same_origin_on_cache.test.py | 3 ++-
.../redirect_to_same_origin_on_cache.replay.yaml | 26 ++++++++++++++++++++++
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/tests/gold_tests/redirect/redirect_to_same_origin_on_cache.test.py
b/tests/gold_tests/redirect/redirect_to_same_origin_on_cache.test.py
index 4ca60e1926..9a809ce641 100644
--- a/tests/gold_tests/redirect/redirect_to_same_origin_on_cache.test.py
+++ b/tests/gold_tests/redirect/redirect_to_same_origin_on_cache.test.py
@@ -27,7 +27,7 @@ TestParams = Dict[str, Any]
class TestRedirectToSameOriginOnCache:
"""Configure a test for reproducing #9275."""
- replay_filepath_one: str = "redirect_to_same_origin_on_cache.replay.yaml"
+ replay_filepath_one: str =
"replay/redirect_to_same_origin_on_cache.replay.yaml"
client_counter: int = 0
server_counter: int = 0
ts_counter: int = 0
@@ -121,6 +121,7 @@ class TestRedirectToSameOriginOnCache:
})
ts.Disk.remap_config.AddLine(f"map oof.com
http://oof.backend.com:{server_one.Variables.http_port}")
+ ts.Disk.plugin_config.AddLine("xdebug.so
--enable=x-cache,x-cache-key,via")
self._ts = ts
diff --git
a/tests/gold_tests/redirect/redirect_to_same_origin_on_cache.replay.yaml
b/tests/gold_tests/redirect/replay/redirect_to_same_origin_on_cache.replay.yaml
similarity index 74%
rename from
tests/gold_tests/redirect/redirect_to_same_origin_on_cache.replay.yaml
rename to
tests/gold_tests/redirect/replay/redirect_to_same_origin_on_cache.replay.yaml
index 45ec9e03c7..bd8de8ce26 100644
--- a/tests/gold_tests/redirect/redirect_to_same_origin_on_cache.replay.yaml
+++
b/tests/gold_tests/redirect/replay/redirect_to_same_origin_on_cache.replay.yaml
@@ -44,6 +44,7 @@ sessions:
proxy-response:
status: 200
+
- client-request:
method: "GET"
version: "1.1"
@@ -60,6 +61,31 @@ sessions:
headers:
fields:
- [ content-length, 16 ]
+ - [ cache-control, "public,max-age=3600"]
+
+ proxy-response:
+ status: 200
+
+ - client-request:
+ # wait for cache I/O
+ delay: 100ms
+ method: "GET"
+ version: "1.1"
+ url: /a/path/resource
+ headers:
+ fields:
+ - [ Host, oof.com ]
+ - [ Connection, keep-alive ]
+ - [ Content-Length, 0 ]
+ - [ x-debug, x-cache ]
+ # should no request to origin server
+ server-response:
+ status: 503
+
+ # hitting cache is expected
proxy-response:
status: 200
+ headers:
+ fields:
+ - [ x-cache, {value: "hit-fresh", as: equal } ]