serrislew commented on code in PR #12408:
URL: https://github.com/apache/trafficserver/pull/12408#discussion_r2270739532


##########
tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests_ident.test.py:
##########
@@ -160,36 +182,63 @@
 tr = Test.AddTestRun("0- range CrrIdent Etag check")
 tr.DelayStart = 2
 ps = tr.Processes.Default
-tr.MakeCurlCommand(curl_and_args + f" http://identheader/pathheader -r 0- -H 
'CrrIdent: Etag: {etag_custom}'", ts=ts)
+tr.MakeCurlCommand(curl_and_args + f" http://identheader/pathheader -r 0- -H 
'CrrIdent: Etag {etag_custom}'", ts=ts)
 ps.ReturnCode = 0
 ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: hit-fresh", 
"expected cache hit-fresh")
 tr.StillRunningAfter = ts
 
 # 6 Test - Ensure X-Crr-Ident Last-Modified header results in hit-fresh
 tr = Test.AddTestRun("0- range X-Crr-Ident Last-Modified check")
 ps = tr.Processes.Default
-tr.MakeCurlCommand(curl_and_args + f' http://ident/path -r 0- -H "X-Crr-Ident: 
Last-Modified: {last_modified}"', ts=ts)
+tr.MakeCurlCommand(curl_and_args + f' http://ident/path -r 0- -H "X-Crr-Ident: 
Last-Modified {last_modified}"', ts=ts)
 ps.ReturnCode = 0
 ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: hit-fresh", 
"expected cache hit-fresh")
 tr.StillRunningAfter = ts
 
 # 7 Test - Provide a mismatch Etag force IMS request
 tr = Test.AddTestRun("0- range X-Crr-Ident check")
 ps = tr.Processes.Default
-tr.MakeCurlCommand(curl_and_args + f' http://ident/path -r 0- -H "X-Crr-Ident: 
Last-Modified: foo"', ts=ts)
+tr.MakeCurlCommand(curl_and_args + f' http://ident/path -r 0- -H "X-Crr-Ident: 
Last-Modified foo"', ts=ts)
+ps.ReturnCode = 0
+ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: hit-stale", 
"expected cache hit-stale")
+tr.StillRunningAfter = ts
+
+# 8 Test - Fetch "fresh" into cache
+tr = Test.AddTestRun("0- fresh range cache load")
+ps = tr.Processes.Default
+tr.MakeCurlCommand(curl_and_args + ' http://ident/pathfresh -r 0-', ts=ts)
+ps.ReturnCode = 0
+ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: miss", 
"expected cache miss for load")
+tr.StillRunningAfter = ts
+
+# 9 Test - Ensure "fresh" is in cache
+tr = Test.AddTestRun("0- fresh range cache check")
+ps = tr.Processes.Default
+tr.MakeCurlCommand(curl_and_args + ' http://ident/pathfresh -r 0-', ts=ts)
+ps.ReturnCode = 0
+ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: hit-fresh", 
"expected cache fresh")
+tr.StillRunningAfter = ts
+
+# 10 request with different etag and ensure it goes stale

Review Comment:
   should there be a `X-Crr-Ident: Stale` header test too?



-- 
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-unsubscr...@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to