diff --git a/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests.test.py b/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests.test.py index da4df7c2649..b25290583d2 100644 --- a/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests.test.py +++ b/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests.test.py @@ -223,7 +223,6 @@ ps.StartBefore(Test.Processes.ts, ready=When.PortOpen(ts.Variables.port)) ps.Command = curl_and_args + ' http://www.example.com/path -H "uuid: full"' ps.ReturnCode = 0 -ps.Streams.stdout = "gold/full.stdout.gold" ps.Streams.stderr = "gold/full.stderr.gold" tr.StillRunningAfter = ts @@ -233,9 +232,9 @@ ps = tr.Processes.Default ps.Command = curl_and_args + ' http://www.example.com/path -r {} -H "uuid: inner"'.format(inner_str) ps.ReturnCode = 0 -#ps.Streams.stdout = "gold/inner.stdout.gold" ps.Streams.stderr = "gold/inner.stderr.gold" ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: miss", "expected cache miss") +ps.Streams.stdout.Content += Testers.ContainsExpression("Content-Range: bytes 7-15/18", "expected content-range header") tr.StillRunningAfter = ts # 2 Test - Fetch from cache @@ -243,9 +242,9 @@ ps = tr.Processes.Default ps.Command = curl_and_args + ' http://www.example.com/path -r {}'.format(inner_str) ps.ReturnCode = 0 -#ps.Streams.stdout = "gold/inner.stdout.gold" ps.Streams.stderr = "gold/inner.stderr.gold" ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: hit", "expected cache hit") +ps.Streams.stdout.Content += Testers.ContainsExpression("Content-Range: bytes 7-15/18", "expected content-range header") tr.StillRunningAfter = ts # full range @@ -255,9 +254,9 @@ ps = tr.Processes.Default ps.Command = curl_and_args + ' http://www.example.com/path -r {} -H "uuid: frange"'.format(frange_str) ps.ReturnCode = 0 -#ps.Streams.stdout = "gold/frange.stdout.gold" -ps.Streams.stderr = "gold/frange.stderr.gold" +ps.Streams.stderr = "gold/full.stderr.gold" ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: miss", "expected cache miss") +ps.Streams.stdout.Content += Testers.ContainsExpression("Content-Range: bytes 0-18/18", "expected content-range header") tr.StillRunningAfter = ts # 4 Test - 0- request @@ -265,9 +264,9 @@ ps = tr.Processes.Default ps.Command = curl_and_args + ' http://www.example.com/path -r {}'.format(frange_str) ps.ReturnCode = 0 -#ps.Streams.stdout = "gold/frange.stdout.gold" -ps.Streams.stderr = "gold/frange.stderr.gold" +ps.Streams.stderr = "gold/full.stderr.gold" ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: hit", "expected cache hit") +ps.Streams.stdout.Content += Testers.ContainsExpression("Content-Range: bytes 0-18/18", "expected content-range header") tr.StillRunningAfter = ts # end range @@ -277,9 +276,9 @@ ps = tr.Processes.Default ps.Command = curl_and_args + ' http://www.example.com/path -r {} -H "uuid: last"'.format(last_str) ps.ReturnCode = 0 -#ps.Streams.stdout = "gold/last.stdout.gold" ps.Streams.stderr = "gold/last.stderr.gold" ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: miss", "expected cache miss") +ps.Streams.stdout.Content += Testers.ContainsExpression("Content-Range: bytes 13-18/18", "expected content-range header") tr.StillRunningAfter = ts # 6 Test - -5 request hit @@ -287,9 +286,9 @@ ps = tr.Processes.Default ps.Command = curl_and_args + ' http://www.example.com/path -r {}'.format(last_str) ps.ReturnCode = 0 -#ps.Streams.stdout = "gold/last.stdout.gold" ps.Streams.stderr = "gold/last.stderr.gold" ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: hit", "expected cache hit") +ps.Streams.stdout.Content += Testers.ContainsExpression("Content-Range: bytes 13-18/18", "expected content-range header") tr.StillRunningAfter = ts # Ensure 404's aren't getting cached @@ -306,20 +305,19 @@ tr = Test.AddTestRun("404 request 2nd") ps = tr.Processes.Default ps.Command = curl_and_args + ' http://www.example.com/404 -r 0-' -ps.Streams.stdout = "gold/404.stdout.gold" ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: miss", "expected cache miss") -tr.StillRunningAfter = ts +ps.Streams.stdout.Content += Testers.ContainsExpression("404 Not Found", "expected 404 response") -''' +tr.StillRunningAfter = ts curl_and_args = 'curl -s -D /dev/stdout -o /dev/stderr -x localhost:{} -H "x-debug: x-parentselection-key"'.format(ts.Variables.port) +''' # 9 Test - cache_key_url request tr = Test.AddTestRun("cache_key_url request") ps = tr.Processes.Default ps.Command = curl_and_args + ' http://parentselect/path -r {} -H "uuid: pselect"'.format(pselect_str) ps.ReturnCode = 0 -ps.Streams.stdout = "gold/pselect.stdout.gold" ps.Streams.stdout.Content = Testers.ContainsExpression( "X-ParentSelection-Key: .*-bytes=", "expected bytes in parent selection key", @@ -327,13 +325,24 @@ tr.StillRunningAfter = ts tr.StillRunningAfter = server -# 10 Test - non cache_key_url request ... no X-ParentSelectionKey +# 10 Test - non cache_key_url request ... no X-ParentSelection-Key tr = Test.AddTestRun("non cache_key_url request") ps = tr.Processes.Default ps.Command = curl_and_args + ' http://www.example.com/path -r {} -H "uuid: inner"'.format(inner_str) ps.ReturnCode = 0 -ps.Streams.stdout = "gold/pselect_none.stdout.gold" +ps.Streams.stdout.Content = Testers.ExcludesExpression("X-ParentSelection-Key", "parent select key shouldn't show up") tr.StillRunningAfter = ts tr.StillRunningAfter = server +# 11 Test - cache_key_url request -- deprecated +tr = Test.AddTestRun("cache_key_url request - dprecated") +ps = tr.Processes.Default +ps.Command = curl_and_args + ' http://psd/path -r {} -H "uuid: pselect"'.format(pselect_str) +ps.ReturnCode = 0 +ps.Streams.stdout.Content = Testers.ContainsExpression( + "X-ParentSelection-Key: .*-bytes=", + "expected bytes in parent selection key", +) +tr.StillRunningAfter = ts +tr.StillRunningAfter = server ''' diff --git a/tests/gold_tests/pluginTest/cache_range_requests/gold/404.stdout.gold b/tests/gold_tests/pluginTest/cache_range_requests/gold/404.stdout.gold deleted file mode 100644 index f188050f072..00000000000 --- a/tests/gold_tests/pluginTest/cache_range_requests/gold/404.stdout.gold +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 404 Not Found -Server: `` -Date: `` -Age: 0 -Transfer-Encoding: chunked -Proxy-Connection: `` -X-Cache: miss -`` diff --git a/tests/gold_tests/pluginTest/cache_range_requests/gold/frange.stderr.gold b/tests/gold_tests/pluginTest/cache_range_requests/gold/frange.stderr.gold deleted file mode 100644 index 24ad29c1a82..00000000000 --- a/tests/gold_tests/pluginTest/cache_range_requests/gold/frange.stderr.gold +++ /dev/null @@ -1 +0,0 @@ -lets go surfin now`` diff --git a/tests/gold_tests/pluginTest/cache_range_requests/gold/frange.stdout.gold b/tests/gold_tests/pluginTest/cache_range_requests/gold/frange.stdout.gold deleted file mode 100644 index 39a960b16a6..00000000000 --- a/tests/gold_tests/pluginTest/cache_range_requests/gold/frange.stdout.gold +++ /dev/null @@ -1,10 +0,0 @@ -HTTP/1.1 206 Partial Content -Accept-Ranges: bytes -Cache-Control: max-age=500 -Content-Range: bytes 0-18/18 -Etag: "path" -Content-Length: 18 -Date: `` -Server: `` -X-Cache: `` -`` diff --git a/tests/gold_tests/pluginTest/cache_range_requests/gold/full.stderr.gold b/tests/gold_tests/pluginTest/cache_range_requests/gold/full.stderr.gold index 24ad29c1a82..c2475221112 100644 --- a/tests/gold_tests/pluginTest/cache_range_requests/gold/full.stderr.gold +++ b/tests/gold_tests/pluginTest/cache_range_requests/gold/full.stderr.gold @@ -1 +1 @@ -lets go surfin now`` +lets go surfin now \ No newline at end of file diff --git a/tests/gold_tests/pluginTest/cache_range_requests/gold/full.stdout.gold b/tests/gold_tests/pluginTest/cache_range_requests/gold/full.stdout.gold deleted file mode 100644 index f4f8fe5d715..00000000000 --- a/tests/gold_tests/pluginTest/cache_range_requests/gold/full.stdout.gold +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Cache-Control: max-age=500 -Etag: "path" -Content-Length: 18 -Date: `` -Server: `` -X-Cache: miss -`` diff --git a/tests/gold_tests/pluginTest/cache_range_requests/gold/inner.stderr.gold b/tests/gold_tests/pluginTest/cache_range_requests/gold/inner.stderr.gold index 1b0ef57a044..90be4bf1a54 100644 --- a/tests/gold_tests/pluginTest/cache_range_requests/gold/inner.stderr.gold +++ b/tests/gold_tests/pluginTest/cache_range_requests/gold/inner.stderr.gold @@ -1 +1 @@ - surfin`` + surfin \ No newline at end of file diff --git a/tests/gold_tests/pluginTest/cache_range_requests/gold/inner.stdout.gold b/tests/gold_tests/pluginTest/cache_range_requests/gold/inner.stdout.gold deleted file mode 100644 index dbf15cee731..00000000000 --- a/tests/gold_tests/pluginTest/cache_range_requests/gold/inner.stdout.gold +++ /dev/null @@ -1,10 +0,0 @@ -HTTP/1.1 206 Partial Content -Accept-Ranges: bytes -Cache-Control: max-age=500 -Content-Range: bytes 7-15/18 -Etag: "path" -Content-Length: 7 -Date: `` -Server: `` -X-Cache: `` -`` diff --git a/tests/gold_tests/pluginTest/cache_range_requests/gold/last.stderr.gold b/tests/gold_tests/pluginTest/cache_range_requests/gold/last.stderr.gold index 9e4c8c43d82..836a80c7a51 100644 --- a/tests/gold_tests/pluginTest/cache_range_requests/gold/last.stderr.gold +++ b/tests/gold_tests/pluginTest/cache_range_requests/gold/last.stderr.gold @@ -1 +1 @@ -n now`` +n now \ No newline at end of file diff --git a/tests/gold_tests/pluginTest/cache_range_requests/gold/last.stdout.gold b/tests/gold_tests/pluginTest/cache_range_requests/gold/last.stdout.gold deleted file mode 100644 index b71a2c98e10..00000000000 --- a/tests/gold_tests/pluginTest/cache_range_requests/gold/last.stdout.gold +++ /dev/null @@ -1,10 +0,0 @@ -HTTP/1.1 206 Partial Content -Accept-Ranges: bytes -Cache-Control: max-age=500 -Content-Range: bytes 12-18/18 -Etag: "path" -Content-Length: 5 -Date: `` -Server: `` -X-Cache: `` -`` diff --git a/tests/gold_tests/pluginTest/cache_range_requests/gold/pselect.stdout.gold b/tests/gold_tests/pluginTest/cache_range_requests/gold/pselect.stdout.gold deleted file mode 100644 index 6b2ecc5626a..00000000000 --- a/tests/gold_tests/pluginTest/cache_range_requests/gold/pselect.stdout.gold +++ /dev/null @@ -1,10 +0,0 @@ -HTTP/1.1 206 Partial Content -Accept-Ranges: bytes -Cache-Control: max-age=500 -Content-Range: bytes 1-10/18 -Etag: "path" -Content-Length: 9 -Date: `` -Server: `` -X-ParentSelection: `` -`` diff --git a/tests/gold_tests/pluginTest/cache_range_requests/gold/pselect_none.stdout.gold b/tests/gold_tests/pluginTest/cache_range_requests/gold/pselect_none.stdout.gold deleted file mode 100644 index 510cf0269ee..00000000000 --- a/tests/gold_tests/pluginTest/cache_range_requests/gold/pselect_none.stdout.gold +++ /dev/null @@ -1,9 +0,0 @@ -HTTP/1.1 206 Partial Content -Accept-Ranges: bytes -Cache-Control: `` -Content-Range: `` -Etag: `` -Content-Length: `` -Date: `` -Server: `` -``