diff --git a/ci/rat-regex.txt b/ci/rat-regex.txt index 26c63b9523d..dfea60e7f59 100644 --- a/ci/rat-regex.txt +++ b/ci/rat-regex.txt @@ -24,6 +24,7 @@ .*\.config$ .*\.yaml$ .*\.gold$ +.*\.test_input$ ^\.gitignore$ ^\.gitmodules$ ^\.perltidyrc$ diff --git a/proxy/hdrs/MIME.cc b/proxy/hdrs/MIME.cc index b88c5d5b954..7376e3ca870 100644 --- a/proxy/hdrs/MIME.cc +++ b/proxy/hdrs/MIME.cc @@ -2349,8 +2349,6 @@ ParseResult MIMEScanner::get(TextView &input, TextView &output, bool &output_shares_input, bool eof_p, ScanType scan_type) { ParseResult zret = PARSE_RESULT_CONT; - // Need this for handling dangling CR. - static const char RAW_CR{ParseRules::CHAR_CR}; auto text = input; while (PARSE_RESULT_CONT == zret && !text.empty()) { @@ -2368,7 +2366,7 @@ MIMEScanner::get(TextView &input, TextView &output, bool &output_shares_input, b } } else if (ParseRules::is_lf(*text)) { ++text; - zret = PARSE_RESULT_DONE; // Required by regression test. + zret = PARSE_RESULT_ERROR; // lone LF } else { // consume this character in the next state. m_state = MIME_PARSE_INSIDE; @@ -2380,21 +2378,28 @@ MIMEScanner::get(TextView &input, TextView &output, bool &output_shares_input, b ++text; zret = PARSE_RESULT_DONE; } else { - // This really should be an error (spec doesn't permit lone CR) but the regression tests - // require it. - this->append(TextView(&RAW_CR, 1)); // This is to fix a core dump of the icc 19.1 compiler when {&RAW_CR, 1} is used - m_state = MIME_PARSE_INSIDE; + zret = PARSE_RESULT_ERROR; // lone CR } break; case MIME_PARSE_INSIDE: { - auto lf_off = text.find(ParseRules::CHAR_LF); - if (lf_off != TextView::npos) { - text.remove_prefix(lf_off + 1); // drop up to and including LF - if (LINE == scan_type) { - zret = PARSE_RESULT_OK; - m_state = MIME_PARSE_BEFORE; - } else { - m_state = MIME_PARSE_AFTER; // looking for line folding. + auto cr_off = text.find(ParseRules::CHAR_CR); + if (cr_off != TextView::npos) { + text.remove_prefix(cr_off + 1); // drop up to and including CR + // Is the next item a LF? + if (!text.empty()) { + if (text[0] == ParseRules::CHAR_LF) { + text.remove_prefix(1); // drop up to and including LF + if (LINE == scan_type) { + zret = PARSE_RESULT_OK; + m_state = MIME_PARSE_BEFORE; + } else { + m_state = MIME_PARSE_AFTER; // looking for line folding. + } + } else { // Next char is not LF, you lose + zret = PARSE_RESULT_ERROR; + } + } else { // No LF yet, adjust state to note + m_state = MIME_PARSE_FOUND_CR; } } else { // no EOL, consume all text without changing state. text.remove_prefix(text.size()); @@ -2531,18 +2536,14 @@ mime_parser_parse(MIMEParser *parser, HdrHeap *heap, MIMEHdrImpl *mh, const char return err; } - ////////////////////////////////////////////////// - // if got a LF or CR on its own, end the header // - ////////////////////////////////////////////////// + /////////////////////////////////////////////////// + // if got a CR and LF on its own, end the header // + /////////////////////////////////////////////////// if ((parsed.size() >= 2) && (parsed[0] == ParseRules::CHAR_CR) && (parsed[1] == ParseRules::CHAR_LF)) { return PARSE_RESULT_DONE; } - if ((parsed.size() >= 1) && (parsed[0] == ParseRules::CHAR_LF)) { - return PARSE_RESULT_DONE; - } - ///////////////////////////////////////////// // find pointers into the name:value field // ///////////////////////////////////////////// diff --git a/proxy/hdrs/unit_tests/test_Hdrs.cc b/proxy/hdrs/unit_tests/test_Hdrs.cc index 73022bf6212..51827b00407 100644 --- a/proxy/hdrs/unit_tests/test_Hdrs.cc +++ b/proxy/hdrs/unit_tests/test_Hdrs.cc @@ -45,24 +45,26 @@ TEST_CASE("HdrTestHttpParse", "[proxy][hdrtest]") int expected_result; int expected_bytes_consumed; }; - static const std::array tests = {{ + static const std::array tests = {{ {"GET /index.html HTTP/1.0\r\n", PARSE_RESULT_DONE, 26}, {"GET /index.html HTTP/1.0\r\n\r\n***BODY****", PARSE_RESULT_DONE, 28}, + {"GET /index.html HTTP/1.0\r\na\rb\n", PARSE_RESULT_ERROR, 28}, + {"GET /index.html HTTP/1.0\r\nUser-Agent: foobar\r \n", PARSE_RESULT_ERROR, 45}, {"GET /index.html HTTP/1.0\r\nUser-Agent: foobar\r\n\r\n***BODY****", PARSE_RESULT_DONE, 48}, {"GET", PARSE_RESULT_ERROR, 3}, {"GET /index.html", PARSE_RESULT_ERROR, 15}, {"GET /index.html\r\n", PARSE_RESULT_ERROR, 17}, {"GET /index.html HTTP/1.0", PARSE_RESULT_ERROR, 24}, {"GET /index.html HTTP/1.0\r", PARSE_RESULT_ERROR, 25}, - {"GET /index.html HTTP/1.0\n", PARSE_RESULT_DONE, 25}, - {"GET /index.html HTTP/1.0\n\n", PARSE_RESULT_DONE, 26}, + {"GET /index.html HTTP/1.0\n", PARSE_RESULT_ERROR, 25}, + {"GET /index.html HTTP/1.0\n\n", PARSE_RESULT_ERROR, 26}, {"GET /index.html HTTP/1.0\r\n\r\n", PARSE_RESULT_DONE, 28}, {"GET /index.html HTTP/1.0\r\nUser-Agent: foobar", PARSE_RESULT_ERROR, 44}, - {"GET /index.html HTTP/1.0\r\nUser-Agent: foobar\n", PARSE_RESULT_DONE, 45}, + {"GET /index.html HTTP/1.0\r\nUser-Agent: foobar\n", PARSE_RESULT_ERROR, 45}, {"GET /index.html HTTP/1.0\r\nUser-Agent: foobar\r\n", PARSE_RESULT_DONE, 46}, {"GET /index.html HTTP/1.0\r\nUser-Agent: foobar\r\n\r\n", PARSE_RESULT_DONE, 48}, - {"GET /index.html HTTP/1.0\nUser-Agent: foobar\n", PARSE_RESULT_DONE, 44}, - {"GET /index.html HTTP/1.0\nUser-Agent: foobar\nBoo: foo\n", PARSE_RESULT_DONE, 53}, + {"GET /index.html HTTP/1.0\nUser-Agent: foobar\n", PARSE_RESULT_ERROR, 44}, + {"GET /index.html HTTP/1.0\nUser-Agent: foobar\nBoo: foo\n", PARSE_RESULT_ERROR, 53}, {"GET /index.html HTTP/1.0\r\nUser-Agent: foobar\r\n", PARSE_RESULT_DONE, 46}, {"GET /index.html HTTP/1.0\r\n", PARSE_RESULT_DONE, 26}, {"GET /index.html hTTP/1.0\r\n", PARSE_RESULT_ERROR, 26}, diff --git a/tests/gold_tests/body_factory/data/www.customplugin204.test_get.txt b/tests/gold_tests/body_factory/data/www.customplugin204.test_get.test_input similarity index 95% rename from tests/gold_tests/body_factory/data/www.customplugin204.test_get.txt rename to tests/gold_tests/body_factory/data/www.customplugin204.test_get.test_input index 4cf018aea16..be603f95f17 100644 --- a/tests/gold_tests/body_factory/data/www.customplugin204.test_get.txt +++ b/tests/gold_tests/body_factory/data/www.customplugin204.test_get.test_input @@ -1,2 +1,2 @@ -GET HTTP://www.customplugin204.test/ HTTP/1.1 - +GET HTTP://www.customplugin204.test/ HTTP/1.1 + diff --git a/tests/gold_tests/body_factory/data/www.customtemplate204.test_get.txt b/tests/gold_tests/body_factory/data/www.customtemplate204.test_get.test_input similarity index 96% rename from tests/gold_tests/body_factory/data/www.customtemplate204.test_get.txt rename to tests/gold_tests/body_factory/data/www.customtemplate204.test_get.test_input index f16fbc74628..395d7985f69 100644 --- a/tests/gold_tests/body_factory/data/www.customtemplate204.test_get.txt +++ b/tests/gold_tests/body_factory/data/www.customtemplate204.test_get.test_input @@ -1,2 +1,2 @@ -GET HTTP://www.customtemplate204.test/ HTTP/1.1 - +GET HTTP://www.customtemplate204.test/ HTTP/1.1 + diff --git a/tests/gold_tests/body_factory/data/www.default204.test_get.txt b/tests/gold_tests/body_factory/data/www.default204.test_get.test_input similarity index 95% rename from tests/gold_tests/body_factory/data/www.default204.test_get.txt rename to tests/gold_tests/body_factory/data/www.default204.test_get.test_input index 1a421ddf182..e77408af827 100644 --- a/tests/gold_tests/body_factory/data/www.default204.test_get.txt +++ b/tests/gold_tests/body_factory/data/www.default204.test_get.test_input @@ -1,2 +1,2 @@ -GET HTTP://www.default204.test/ HTTP/1.1 - +GET HTTP://www.default204.test/ HTTP/1.1 + diff --git a/tests/gold_tests/body_factory/data/www.default304.test_get.txt b/tests/gold_tests/body_factory/data/www.default304.test_get.test_input similarity index 95% rename from tests/gold_tests/body_factory/data/www.default304.test_get.txt rename to tests/gold_tests/body_factory/data/www.default304.test_get.test_input index d251435b982..c9064fa0ade 100644 --- a/tests/gold_tests/body_factory/data/www.default304.test_get.txt +++ b/tests/gold_tests/body_factory/data/www.default304.test_get.test_input @@ -1,2 +1,2 @@ -GET HTTP://www.default304.test/ HTTP/1.1 - +GET HTTP://www.default304.test/ HTTP/1.1 + diff --git a/tests/gold_tests/body_factory/data/www.example.test_get_200.txt b/tests/gold_tests/body_factory/data/www.example.test_get_200.test_input similarity index 93% rename from tests/gold_tests/body_factory/data/www.example.test_get_200.txt rename to tests/gold_tests/body_factory/data/www.example.test_get_200.test_input index 5994603557f..c53681f3486 100644 --- a/tests/gold_tests/body_factory/data/www.example.test_get_200.txt +++ b/tests/gold_tests/body_factory/data/www.example.test_get_200.test_input @@ -1,3 +1,3 @@ -GET /get200 HTTP/1.1 -Host: www.example.test - +GET /get200 HTTP/1.1 +Host: www.example.test + diff --git a/tests/gold_tests/body_factory/data/www.example.test_get_304.txt b/tests/gold_tests/body_factory/data/www.example.test_get_304.test_input similarity index 95% rename from tests/gold_tests/body_factory/data/www.example.test_get_304.txt rename to tests/gold_tests/body_factory/data/www.example.test_get_304.test_input index 03a8d5967eb..8d0aecf9bdb 100644 --- a/tests/gold_tests/body_factory/data/www.example.test_get_304.txt +++ b/tests/gold_tests/body_factory/data/www.example.test_get_304.test_input @@ -1,4 +1,4 @@ -GET /get304 HTTP/1.1 -Host: www.example.test -If-Modified-Since: Thu, 1 Jan 1970 00:00:00 GMT - +GET /get304 HTTP/1.1 +Host: www.example.test +If-Modified-Since: Thu, 1 Jan 1970 00:00:00 GMT + diff --git a/tests/gold_tests/body_factory/data/www.example.test_head.txt b/tests/gold_tests/body_factory/data/www.example.test_head.test_input similarity index 95% rename from tests/gold_tests/body_factory/data/www.example.test_head.txt rename to tests/gold_tests/body_factory/data/www.example.test_head.test_input index 514c1071065..c5a5c979e9e 100644 --- a/tests/gold_tests/body_factory/data/www.example.test_head.txt +++ b/tests/gold_tests/body_factory/data/www.example.test_head.test_input @@ -1,3 +1,3 @@ -HEAD http://www.example.test/ HTTP/1.1 -Host: www.example.test - +HEAD http://www.example.test/ HTTP/1.1 +Host: www.example.test + diff --git a/tests/gold_tests/body_factory/data/www.example.test_head_200.txt b/tests/gold_tests/body_factory/data/www.example.test_head_200.test_input similarity index 94% rename from tests/gold_tests/body_factory/data/www.example.test_head_200.txt rename to tests/gold_tests/body_factory/data/www.example.test_head_200.test_input index fc0f1d536fd..6d214e1b365 100644 --- a/tests/gold_tests/body_factory/data/www.example.test_head_200.txt +++ b/tests/gold_tests/body_factory/data/www.example.test_head_200.test_input @@ -1,3 +1,3 @@ -HEAD /head200 HTTP/1.1 -Host: www.example.test - +HEAD /head200 HTTP/1.1 +Host: www.example.test + diff --git a/tests/gold_tests/body_factory/http204_response.test.py b/tests/gold_tests/body_factory/http204_response.test.py index 5d1147e9561..529abf6266a 100644 --- a/tests/gold_tests/body_factory/http204_response.test.py +++ b/tests/gold_tests/body_factory/http204_response.test.py @@ -77,7 +77,7 @@ defaultTr.Processes.Default.StartBefore(Test.Processes.ts) defaultTr.StillRunningAfter = ts -defaultTr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{DEFAULT_204_HOST}_get.txt" +defaultTr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{DEFAULT_204_HOST}_get.test_input" defaultTr.Processes.Default.TimeOut = 5 # seconds defaultTr.Processes.Default.ReturnCode = 0 defaultTr.Processes.Default.Streams.stdout = "gold/http-204.gold" @@ -86,7 +86,7 @@ customTemplateTr = Test.AddTestRun(f"Test domain {CUSTOM_TEMPLATE_204_HOST}") customTemplateTr.StillRunningBefore = ts customTemplateTr.StillRunningAfter = ts -customTemplateTr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{CUSTOM_TEMPLATE_204_HOST}_get.txt" +customTemplateTr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{CUSTOM_TEMPLATE_204_HOST}_get.test_input" customTemplateTr.Processes.Default.TimeOut = 5 # seconds customTemplateTr.Processes.Default.ReturnCode = 0 customTemplateTr.Processes.Default.Streams.stdout = "gold/http-204-custom.gold" diff --git a/tests/gold_tests/body_factory/http204_response_plugin.test.py b/tests/gold_tests/body_factory/http204_response_plugin.test.py index 72ba642c908..7f701961654 100644 --- a/tests/gold_tests/body_factory/http204_response_plugin.test.py +++ b/tests/gold_tests/body_factory/http204_response_plugin.test.py @@ -45,7 +45,7 @@ tr.Processes.Default.StartBefore(Test.Processes.ts) tr.StillRunningAfter = ts -tr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{CUSTOM_PLUGIN_204_HOST}_get.txt" +tr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{CUSTOM_PLUGIN_204_HOST}_get.test_input" tr.Processes.Default.TimeOut = 5 # seconds tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.Streams.stdout = "gold/http-204-custom-plugin.gold" diff --git a/tests/gold_tests/body_factory/http304_response.test.py b/tests/gold_tests/body_factory/http304_response.test.py index 7baa4b424e2..807f413d28f 100644 --- a/tests/gold_tests/body_factory/http304_response.test.py +++ b/tests/gold_tests/body_factory/http304_response.test.py @@ -48,7 +48,7 @@ tr.Processes.Default.StartBefore(Test.Processes.ts) tr.StillRunningAfter = ts -cmd_tpl = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{DEFAULT_304_HOST}_get.txt" +cmd_tpl = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{DEFAULT_304_HOST}_get.test_input" tr.Processes.Default.Command = cmd_tpl tr.Processes.Default.TimeOut = 5 # seconds tr.Processes.Default.ReturnCode = 0 diff --git a/tests/gold_tests/body_factory/http_head_no_origin.test.py b/tests/gold_tests/body_factory/http_head_no_origin.test.py index 097c4761095..2e1c4a2a35b 100644 --- a/tests/gold_tests/body_factory/http_head_no_origin.test.py +++ b/tests/gold_tests/body_factory/http_head_no_origin.test.py @@ -37,7 +37,7 @@ tr.Processes.Default.StartBefore(Test.Processes.ts) tr.StillRunningAfter = ts -tr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_head.txt" +tr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_head.test_input" tr.Processes.Default.TimeOut = 5 # seconds tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.Streams.stdout = "gold/http-head-no-origin.gold" diff --git a/tests/gold_tests/body_factory/http_with_origin.test.py b/tests/gold_tests/body_factory/http_with_origin.test.py index 24f833e03f4..8ea3c0a7954 100644 --- a/tests/gold_tests/body_factory/http_with_origin.test.py +++ b/tests/gold_tests/body_factory/http_with_origin.test.py @@ -74,7 +74,7 @@ trhead200.StillRunningAfter = ts trhead200.StillRunningAfter = server -trhead200.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_head_200.txt" +trhead200.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_head_200.test_input" trhead200.Processes.Default.TimeOut = 5 # seconds trhead200.Processes.Default.ReturnCode = 0 trhead200.Processes.Default.Streams.stdout = "gold/http-head-200.gold" @@ -86,7 +86,7 @@ trget200.StillRunningAfter = ts trget200.StillRunningAfter = server -trget200.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_get_200.txt" +trget200.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_get_200.test_input" trget200.Processes.Default.TimeOut = 5 # seconds trget200.Processes.Default.ReturnCode = 0 trget200.Processes.Default.Streams.stdout = "gold/http-get-200.gold" @@ -98,7 +98,7 @@ trget304.StillRunningAfter = ts trget304.StillRunningAfter = server -cmd_tpl = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_get_304.txt" +cmd_tpl = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_get_304.test_input" trget304.Processes.Default.Command = cmd_tpl trget304.Processes.Default.TimeOut = 5 # seconds trget304.Processes.Default.ReturnCode = 0 diff --git a/tests/gold_tests/headers/data/www.http408.test.txt b/tests/gold_tests/headers/data/www.http408.test.test_input similarity index 72% rename from tests/gold_tests/headers/data/www.http408.test.txt rename to tests/gold_tests/headers/data/www.http408.test.test_input index 81f9f9893e5..4e3be6c5294 100644 --- a/tests/gold_tests/headers/data/www.http408.test.txt +++ b/tests/gold_tests/headers/data/www.http408.test.test_input @@ -1,5 +1,5 @@ -POST / HTTP/1.1 -Host: www.http408.test -Content-Length: 100 - -arbitrary content \ No newline at end of file +POST / HTTP/1.1 +Host: www.http408.test +Content-Length: 100 + +arbitrary content diff --git a/tests/gold_tests/headers/data/www.passthrough.test_get.txt b/tests/gold_tests/headers/data/www.passthrough.test_get.test_input similarity index 95% rename from tests/gold_tests/headers/data/www.passthrough.test_get.txt rename to tests/gold_tests/headers/data/www.passthrough.test_get.test_input index ffe69c2afd9..0cba742da68 100644 --- a/tests/gold_tests/headers/data/www.passthrough.test_get.txt +++ b/tests/gold_tests/headers/data/www.passthrough.test_get.test_input @@ -1,2 +1,2 @@ -GET http://www.passthrough.test/ HTTP/1.1 - +GET http://www.passthrough.test/ HTTP/1.1 + diff --git a/tests/gold_tests/headers/data/www.redirect0.test_get.txt b/tests/gold_tests/headers/data/www.redirect0.test_get.test_input similarity index 95% rename from tests/gold_tests/headers/data/www.redirect0.test_get.txt rename to tests/gold_tests/headers/data/www.redirect0.test_get.test_input index 3d3d219e385..40fce98c217 100644 --- a/tests/gold_tests/headers/data/www.redirect0.test_get.txt +++ b/tests/gold_tests/headers/data/www.redirect0.test_get.test_input @@ -1,2 +1,2 @@ -GET http://www.redirect0.test/ HTTP/1.1 - +GET http://www.redirect0.test/ HTTP/1.1 + diff --git a/tests/gold_tests/headers/data/www.redirect301.test_get.txt b/tests/gold_tests/headers/data/www.redirect301.test_get.test_input similarity index 95% rename from tests/gold_tests/headers/data/www.redirect301.test_get.txt rename to tests/gold_tests/headers/data/www.redirect301.test_get.test_input index e51c353dddc..48352678c17 100644 --- a/tests/gold_tests/headers/data/www.redirect301.test_get.txt +++ b/tests/gold_tests/headers/data/www.redirect301.test_get.test_input @@ -1,2 +1,2 @@ -GET http://www.redirect301.test/ HTTP/1.1 - +GET http://www.redirect301.test/ HTTP/1.1 + diff --git a/tests/gold_tests/headers/data/www.redirect302.test_get.txt b/tests/gold_tests/headers/data/www.redirect302.test_get.test_input similarity index 95% rename from tests/gold_tests/headers/data/www.redirect302.test_get.txt rename to tests/gold_tests/headers/data/www.redirect302.test_get.test_input index 35f77503149..6aae2667c6d 100644 --- a/tests/gold_tests/headers/data/www.redirect302.test_get.txt +++ b/tests/gold_tests/headers/data/www.redirect302.test_get.test_input @@ -1,2 +1,2 @@ -GET http://www.redirect302.test/ HTTP/1.1 - +GET http://www.redirect302.test/ HTTP/1.1 + diff --git a/tests/gold_tests/headers/data/www.redirect307.test_get.txt b/tests/gold_tests/headers/data/www.redirect307.test_get.test_input similarity index 95% rename from tests/gold_tests/headers/data/www.redirect307.test_get.txt rename to tests/gold_tests/headers/data/www.redirect307.test_get.test_input index 49bb1bc3072..b37c8ae1486 100644 --- a/tests/gold_tests/headers/data/www.redirect307.test_get.txt +++ b/tests/gold_tests/headers/data/www.redirect307.test_get.test_input @@ -1,2 +1,2 @@ -GET http://www.redirect307.test/ HTTP/1.1 - +GET http://www.redirect307.test/ HTTP/1.1 + diff --git a/tests/gold_tests/headers/data/www.redirect308.test_get.txt b/tests/gold_tests/headers/data/www.redirect308.test_get.test_input similarity index 95% rename from tests/gold_tests/headers/data/www.redirect308.test_get.txt rename to tests/gold_tests/headers/data/www.redirect308.test_get.test_input index 097e95eb126..05bcbf8ec78 100644 --- a/tests/gold_tests/headers/data/www.redirect308.test_get.txt +++ b/tests/gold_tests/headers/data/www.redirect308.test_get.test_input @@ -1,2 +1,2 @@ -GET http://www.redirect308.test/ HTTP/1.1 - +GET http://www.redirect308.test/ HTTP/1.1 + diff --git a/tests/gold_tests/headers/domain-blacklist-30x.test.py b/tests/gold_tests/headers/domain-blacklist-30x.test.py index 275c3425890..b38f1413c55 100644 --- a/tests/gold_tests/headers/domain-blacklist-30x.test.py +++ b/tests/gold_tests/headers/domain-blacklist-30x.test.py @@ -60,7 +60,7 @@ redirect301tr.Processes.Default.StartBefore(Test.Processes.ts) redirect301tr.StillRunningAfter = ts redirect301tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_get.txt'.format(REDIRECT_301_HOST)) + format(ts.Variables.port, 'data/{0}_get.test_input'.format(REDIRECT_301_HOST)) redirect301tr.Processes.Default.TimeOut = 5 # seconds redirect301tr.Processes.Default.ReturnCode = 0 redirect301tr.Processes.Default.Streams.stdout = "redirect301_get.gold" @@ -69,7 +69,7 @@ redirect302tr.StillRunningBefore = ts redirect302tr.StillRunningAfter = ts redirect302tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_get.txt'.format(REDIRECT_302_HOST)) + format(ts.Variables.port, 'data/{0}_get.test_input'.format(REDIRECT_302_HOST)) redirect302tr.Processes.Default.TimeOut = 5 # seconds redirect302tr.Processes.Default.ReturnCode = 0 redirect302tr.Processes.Default.Streams.stdout = "redirect302_get.gold" @@ -79,7 +79,7 @@ redirect302tr.StillRunningBefore = ts redirect307tr.StillRunningAfter = ts redirect307tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_get.txt'.format(REDIRECT_307_HOST)) + format(ts.Variables.port, 'data/{0}_get.test_input'.format(REDIRECT_307_HOST)) redirect307tr.Processes.Default.TimeOut = 5 # seconds redirect307tr.Processes.Default.ReturnCode = 0 redirect307tr.Processes.Default.Streams.stdout = "redirect307_get.gold" @@ -88,7 +88,7 @@ redirect308tr.StillRunningBefore = ts redirect308tr.StillRunningAfter = ts redirect308tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_get.txt'.format(REDIRECT_308_HOST)) + format(ts.Variables.port, 'data/{0}_get.test_input'.format(REDIRECT_308_HOST)) redirect308tr.Processes.Default.TimeOut = 5 # seconds redirect308tr.Processes.Default.ReturnCode = 0 redirect308tr.Processes.Default.Streams.stdout = "redirect308_get.gold" @@ -97,7 +97,7 @@ redirect0tr.StillRunningBefore = ts redirect0tr.StillRunningAfter = ts redirect0tr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_get.txt'.format(REDIRECT_0_HOST)) + format(ts.Variables.port, 'data/{0}_get.test_input'.format(REDIRECT_0_HOST)) redirect0tr.Processes.Default.TimeOut = 5 # seconds redirect0tr.Processes.Default.ReturnCode = 0 redirect0tr.Processes.Default.Streams.stdout = "redirect0_get.gold" @@ -106,7 +106,7 @@ passthroughtr.StillRunningBefore = ts passthroughtr.StillRunningAfter = ts passthroughtr.Processes.Default.Command = "python3 tcp_client.py 127.0.0.1 {0} {1} | grep -v '^Date: '| grep -v '^Server: ATS/'".\ - format(ts.Variables.port, 'data/{0}_get.txt'.format(PASSTHRU_HOST)) + format(ts.Variables.port, 'data/{0}_get.test_input'.format(PASSTHRU_HOST)) passthroughtr.Processes.Default.TimeOut = 5 # seconds passthroughtr.Processes.Default.ReturnCode = 0 passthroughtr.Processes.Default.Streams.stdout = "passthrough_get.gold" diff --git a/tests/gold_tests/headers/http408.test.py b/tests/gold_tests/headers/http408.test.py index e3c2d9cd697..8f6b5d21f4b 100644 --- a/tests/gold_tests/headers/http408.test.py +++ b/tests/gold_tests/headers/http408.test.py @@ -51,7 +51,7 @@ tr.Processes.Default.StartBefore(server) tr.Processes.Default.StartBefore(Test.Processes.ts) tr.Processes.Default.Command = 'python3 tcp_client.py 127.0.0.1 {0} {1} --delay-after-send {2}'\ - .format(ts.Variables.port, 'data/{0}.txt'.format(HTTP_408_HOST), TIMEOUT + 2) + .format(ts.Variables.port, 'data/{0}.test_input'.format(HTTP_408_HOST), TIMEOUT + 2) tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.TimeOut = 10 tr.Processes.Default.Streams.stdout = "http408.gold" diff --git a/tests/gold_tests/pluginTest/combo_handler/combo_handler.test.py b/tests/gold_tests/pluginTest/combo_handler/combo_handler.test.py index b4a5a3e2c44..4aeb8b672ee 100644 --- a/tests/gold_tests/pluginTest/combo_handler/combo_handler.test.py +++ b/tests/gold_tests/pluginTest/combo_handler/combo_handler.test.py @@ -117,10 +117,10 @@ def add_server_obj(content_type, path): tr = Test.AddTestRun() tr.Processes.Default.Command = tcp_client("127.0.0.1", ts.Variables.port, - "GET /admin/v1/combo?obj1&sub:obj2&obj3 HTTP/1.1\n" + - "Host: xyz\n" + - "Connection: close\n" + - "\n" + "GET /admin/v1/combo?obj1&sub:obj2&obj3 HTTP/1.1\r\n" + + "Host: xyz\r\n" + + "Connection: close\r\n" + + "\r\n" ) tr.Processes.Default.ReturnCode = 0 f = tr.Disk.File("_output/1-tr-Default/stream.all.txt") @@ -128,10 +128,10 @@ def add_server_obj(content_type, path): tr = Test.AddTestRun() tr.Processes.Default.Command = tcp_client("127.0.0.1", ts.Variables.port, - "GET /admin/v1/combo?obj1&sub:obj2&obj4 HTTP/1.1\n" + - "Host: xyz\n" + - "Connection: close\n" + - "\n" + "GET /admin/v1/combo?obj1&sub:obj2&obj4 HTTP/1.1\r\n" + + "Host: xyz\r\n" + + "Connection: close\r\n" + + "\r\n" ) tr.Processes.Default.ReturnCode = 0 f = tr.Disk.File("_output/2-tr-Default/stream.all.txt") diff --git a/tests/gold_tests/pluginTest/xdebug/x_cache_info/none.in b/tests/gold_tests/pluginTest/xdebug/x_cache_info/none.test_input similarity index 92% rename from tests/gold_tests/pluginTest/xdebug/x_cache_info/none.in rename to tests/gold_tests/pluginTest/xdebug/x_cache_info/none.test_input index 1d9b7f59a4f..2d8e0e1b5b4 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_cache_info/none.in +++ b/tests/gold_tests/pluginTest/xdebug/x_cache_info/none.test_input @@ -1,4 +1,4 @@ -GET /argh HTTP/1.1 -Host: none -X-Debug: X-Cache-Info - +GET /argh HTTP/1.1 +Host: none +X-Debug: X-Cache-Info + diff --git a/tests/gold_tests/pluginTest/xdebug/x_cache_info/one.in b/tests/gold_tests/pluginTest/xdebug/x_cache_info/one.test_input similarity index 92% rename from tests/gold_tests/pluginTest/xdebug/x_cache_info/one.in rename to tests/gold_tests/pluginTest/xdebug/x_cache_info/one.test_input index e751d8ddad3..3a73f5fd021 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_cache_info/one.in +++ b/tests/gold_tests/pluginTest/xdebug/x_cache_info/one.test_input @@ -1,4 +1,4 @@ -GET /argh HTTP/1.1 -Host: one -X-Debug: X-Cache-Info - +GET /argh HTTP/1.1 +Host: one +X-Debug: X-Cache-Info + diff --git a/tests/gold_tests/pluginTest/xdebug/x_cache_info/three.in b/tests/gold_tests/pluginTest/xdebug/x_cache_info/three.test_input similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_cache_info/three.in rename to tests/gold_tests/pluginTest/xdebug/x_cache_info/three.test_input index d0f63c0d440..59ed7b594ac 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_cache_info/three.in +++ b/tests/gold_tests/pluginTest/xdebug/x_cache_info/three.test_input @@ -1,4 +1,4 @@ -GET /argh HTTP/1.1 -Host: three123 -X-Debug: x-cACHE-iNFO - +GET /argh HTTP/1.1 +Host: three123 +X-Debug: x-cACHE-iNFO + diff --git a/tests/gold_tests/pluginTest/xdebug/x_cache_info/two.in b/tests/gold_tests/pluginTest/xdebug/x_cache_info/two.test_input similarity index 92% rename from tests/gold_tests/pluginTest/xdebug/x_cache_info/two.in rename to tests/gold_tests/pluginTest/xdebug/x_cache_info/two.test_input index 55786b0aebf..64258cadc38 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_cache_info/two.in +++ b/tests/gold_tests/pluginTest/xdebug/x_cache_info/two.test_input @@ -1,4 +1,4 @@ -GET /argh HTTP/1.1 -Host: two -X-Debug: x-cache-info - +GET /argh HTTP/1.1 +Host: two +X-Debug: x-cache-info + diff --git a/tests/gold_tests/pluginTest/xdebug/x_cache_info/x_cache_info.test.py b/tests/gold_tests/pluginTest/xdebug/x_cache_info/x_cache_info.test.py index 892297bb6dd..39a861e65a7 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_cache_info/x_cache_info.test.py +++ b/tests/gold_tests/pluginTest/xdebug/x_cache_info/x_cache_info.test.py @@ -51,13 +51,13 @@ files = ["none", "one", "two", "three"] for file in files: - Test.Setup.Copy(f'{Test.TestDirectory}/{file}.in') + Test.Setup.Copy(f'{Test.TestDirectory}/{file}.test_input') def sendMsg(msgFile): global started tr = Test.AddTestRun() - tr.Processes.Default.Command = f"( python3 tools/tcp_client.py 127.0.0.1 {ts.Variables.port} {msgFile}.in ; echo '======' ) | sed 's/:{server.Variables.Port}/:SERVER_PORT/' >> out.log 2>&1" + tr.Processes.Default.Command = f"( python3 tools/tcp_client.py 127.0.0.1 {ts.Variables.port} {msgFile}.test_input ; echo '======' ) | sed 's/:{server.Variables.Port}/:SERVER_PORT/' >> out.log 2>&1" tr.Processes.Default.ReturnCode = 0 if not started: diff --git a/tests/gold_tests/pluginTest/xdebug/x_effective_url/none.in b/tests/gold_tests/pluginTest/xdebug/x_effective_url/none.test_input similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_effective_url/none.in rename to tests/gold_tests/pluginTest/xdebug/x_effective_url/none.test_input index e07b30662f5..c9c47a8c297 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_effective_url/none.in +++ b/tests/gold_tests/pluginTest/xdebug/x_effective_url/none.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: none -X-Debug: X-Effective-URL -Connection: close - +GET /argh HTTP/1.1 +Host: none +X-Debug: X-Effective-URL +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_effective_url/one.in b/tests/gold_tests/pluginTest/xdebug/x_effective_url/one.test_input similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_effective_url/one.in rename to tests/gold_tests/pluginTest/xdebug/x_effective_url/one.test_input index d9223256128..f27ecc620db 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_effective_url/one.in +++ b/tests/gold_tests/pluginTest/xdebug/x_effective_url/one.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: one -X-Debug: x-effective-url -Connection: close - +GET /argh HTTP/1.1 +Host: one +X-Debug: x-effective-url +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_effective_url/three.in b/tests/gold_tests/pluginTest/xdebug/x_effective_url/three.test_input similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_effective_url/three.in rename to tests/gold_tests/pluginTest/xdebug/x_effective_url/three.test_input index 7076c1a249c..ec1a09aaaa5 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_effective_url/three.in +++ b/tests/gold_tests/pluginTest/xdebug/x_effective_url/three.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: three123 -X-Debug: X-effective-url -Connection: close - +GET /argh HTTP/1.1 +Host: three123 +X-Debug: X-effective-url +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_effective_url/two.in b/tests/gold_tests/pluginTest/xdebug/x_effective_url/two.test_input similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_effective_url/two.in rename to tests/gold_tests/pluginTest/xdebug/x_effective_url/two.test_input index 52ded33b4f0..9a1fd140a75 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_effective_url/two.in +++ b/tests/gold_tests/pluginTest/xdebug/x_effective_url/two.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: two -X-Debug: X-EFFECTIVE-URL -Connection: close - +GET /argh HTTP/1.1 +Host: two +X-Debug: X-EFFECTIVE-URL +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_effective_url/x_effective_url.test.py b/tests/gold_tests/pluginTest/xdebug/x_effective_url/x_effective_url.test.py index ed1c3b54300..6323110b039 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_effective_url/x_effective_url.test.py +++ b/tests/gold_tests/pluginTest/xdebug/x_effective_url/x_effective_url.test.py @@ -61,7 +61,7 @@ def sendMsg(msgFile): tr = Test.AddTestRun() tr.Processes.Default.Command = ( - "( python3 {}/tcp_client.py 127.0.0.1 {} {}/{}.in".format( + "( python3 {}/tcp_client.py 127.0.0.1 {} {}/{}.test_input".format( Test.RunDirectory, ts.Variables.port, Test.TestDirectory, msgFile) + " ; echo '======' ) | sed 's/:{}/:SERVER_PORT/' >> {}/out.log 2>&1 ".format( server.Variables.Port, Test.RunDirectory) diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/four.in b/tests/gold_tests/pluginTest/xdebug/x_remap/four.test_input similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/four.in rename to tests/gold_tests/pluginTest/xdebug/x_remap/four.test_input index 68420397501..481f01534f5 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/four.in +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/four.test_input @@ -1,5 +1,5 @@ -GET /not_there HTTP/1.1 -Host: two -X-Debug: X-Remap, Probe -Connection: close - +GET /not_there HTTP/1.1 +Host: two +X-Debug: X-Remap, Probe +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd1.in b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd1.test_input similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/fwd1.in rename to tests/gold_tests/pluginTest/xdebug/x_remap/fwd1.test_input index 82f3fa52ecb..8b374433c7a 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd1.in +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd1.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: two -X-Debug: X-Remap, fwd, Probe -Connection: close - +GET /argh HTTP/1.1 +Host: two +X-Debug: X-Remap, fwd, Probe +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd2.in b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd2.test_input similarity index 94% rename from tests/gold_tests/pluginTest/xdebug/x_remap/fwd2.in rename to tests/gold_tests/pluginTest/xdebug/x_remap/fwd2.test_input index 4f7ea91305f..2f6c38ff10e 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd2.in +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd2.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: two -X-Debug: X-Remap, fwd=0, probe -Connection: close - +GET /argh HTTP/1.1 +Host: two +X-Debug: X-Remap, fwd=0, probe +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd3.in b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd3.test_input similarity index 94% rename from tests/gold_tests/pluginTest/xdebug/x_remap/fwd3.in rename to tests/gold_tests/pluginTest/xdebug/x_remap/fwd3.test_input index 42c187a9c9a..7f30b0f53c7 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd3.in +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd3.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: two -X-Debug: X-Remap, fwd= 1, Probe -Connection: close - +GET /argh HTTP/1.1 +Host: two +X-Debug: X-Remap, fwd= 1, Probe +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd4.in b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd4.test_input similarity index 94% rename from tests/gold_tests/pluginTest/xdebug/x_remap/fwd4.in rename to tests/gold_tests/pluginTest/xdebug/x_remap/fwd4.test_input index db3ce259716..79699d0dcbe 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd4.in +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd4.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: two -X-Debug: PROBE, X-Remap, fwd = 999999 -Connection: close - +GET /argh HTTP/1.1 +Host: two +X-Debug: PROBE, X-Remap, fwd = 999999 +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd5.in b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd5.test_input similarity index 94% rename from tests/gold_tests/pluginTest/xdebug/x_remap/fwd5.in rename to tests/gold_tests/pluginTest/xdebug/x_remap/fwd5.test_input index 02b44e7c3de..666e67b2308 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd5.in +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd5.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: two -X-Debug: X-Remap, fwd = 999999xxx, Probe -Connection: close - +GET /argh HTTP/1.1 +Host: two +X-Debug: X-Remap, fwd = 999999xxx, Probe +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/none.in b/tests/gold_tests/pluginTest/xdebug/x_remap/none.test_input similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/none.in rename to tests/gold_tests/pluginTest/xdebug/x_remap/none.test_input index a077b72790d..7b816cefe8e 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/none.in +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/none.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: none -X-Debug: X-Remap, Probe -Connection: close - +GET /argh HTTP/1.1 +Host: none +X-Debug: X-Remap, Probe +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/one.in b/tests/gold_tests/pluginTest/xdebug/x_remap/one.test_input similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/one.in rename to tests/gold_tests/pluginTest/xdebug/x_remap/one.test_input index 6a35a87a16f..f0ae4209ea6 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/one.in +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/one.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: one -X-Debug: X-Remap, probe -Connection: close - +GET /argh HTTP/1.1 +Host: one +X-Debug: X-Remap, probe +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/three.in b/tests/gold_tests/pluginTest/xdebug/x_remap/three.test_input similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/three.in rename to tests/gold_tests/pluginTest/xdebug/x_remap/three.test_input index 1d9612a51f9..8c0269ff946 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/three.in +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/three.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: three123 -X-Debug: X-Remap, Probe -Connection: close - +GET /argh HTTP/1.1 +Host: three123 +X-Debug: X-Remap, Probe +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/two.in b/tests/gold_tests/pluginTest/xdebug/x_remap/two.test_input similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/two.in rename to tests/gold_tests/pluginTest/xdebug/x_remap/two.test_input index 514d173c104..4de650ab71f 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/two.in +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/two.test_input @@ -1,5 +1,5 @@ -GET /argh HTTP/1.1 -Host: two -X-Debug: PROBE, X-Remap -Connection: close - +GET /argh HTTP/1.1 +Host: two +X-Debug: PROBE, X-Remap +Connection: close + diff --git a/tests/gold_tests/pluginTest/xdebug/x_remap/x_remap.test.py b/tests/gold_tests/pluginTest/xdebug/x_remap/x_remap.test.py index f5ee5df0eea..d85dedcef81 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/x_remap.test.py +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/x_remap.test.py @@ -59,7 +59,7 @@ def sendMsg(msgFile): tr = Test.AddTestRun() tr.Processes.Default.Command = ( - "( python3 {}/tcp_client.py 127.0.0.1 {} {}/{}.in".format( + "( python3 {}/tcp_client.py 127.0.0.1 {} {}/{}.test_input".format( Test.RunDirectory, ts.Variables.port, Test.TestDirectory, msgFile) + " ; echo '======' ) | sed 's/:{}/:SERVER_PORT/' >> {}/out.log 2>&1 ".format( server.Variables.Port, Test.RunDirectory) diff --git a/tests/gold_tests/tls/early_h1_get.txt b/tests/gold_tests/tls/early_h1_get.test_input similarity index 93% rename from tests/gold_tests/tls/early_h1_get.txt rename to tests/gold_tests/tls/early_h1_get.test_input index 93b5876dc30..047f0a308d6 100644 --- a/tests/gold_tests/tls/early_h1_get.txt +++ b/tests/gold_tests/tls/early_h1_get.test_input @@ -1,3 +1,3 @@ -GET /early_get HTTP/1.1 -Host: 127.0.0.1 - +GET /early_get HTTP/1.1 +Host: 127.0.0.1 + diff --git a/tests/gold_tests/tls/early_h1_post.txt b/tests/gold_tests/tls/early_h1_post.test_input similarity index 94% rename from tests/gold_tests/tls/early_h1_post.txt rename to tests/gold_tests/tls/early_h1_post.test_input index 117b06c080d..3cdf49d857e 100644 --- a/tests/gold_tests/tls/early_h1_post.txt +++ b/tests/gold_tests/tls/early_h1_post.test_input @@ -1,6 +1,6 @@ -POST /early_post HTTP/1.1 -Host: 127.0.0.1 -Content-Length: 11 - +POST /early_post HTTP/1.1 +Host: 127.0.0.1 +Content-Length: 11 + knock knock diff --git a/tests/gold_tests/tls/early_h2_get.txt b/tests/gold_tests/tls/early_h2_get.test_input similarity index 100% rename from tests/gold_tests/tls/early_h2_get.txt rename to tests/gold_tests/tls/early_h2_get.test_input diff --git a/tests/gold_tests/tls/early_h2_multi1.txt b/tests/gold_tests/tls/early_h2_multi1.test_input similarity index 100% rename from tests/gold_tests/tls/early_h2_multi1.txt rename to tests/gold_tests/tls/early_h2_multi1.test_input diff --git a/tests/gold_tests/tls/early_h2_multi2.txt b/tests/gold_tests/tls/early_h2_multi2.test_input similarity index 100% rename from tests/gold_tests/tls/early_h2_multi2.txt rename to tests/gold_tests/tls/early_h2_multi2.test_input diff --git a/tests/gold_tests/tls/early_h2_post.txt b/tests/gold_tests/tls/early_h2_post.test_input similarity index 100% rename from tests/gold_tests/tls/early_h2_post.txt rename to tests/gold_tests/tls/early_h2_post.test_input diff --git a/tests/gold_tests/tls/test-0rtt-s_client.py b/tests/gold_tests/tls/test-0rtt-s_client.py index d2a90447c87..576976ea30a 100644 --- a/tests/gold_tests/tls/test-0rtt-s_client.py +++ b/tests/gold_tests/tls/test-0rtt-s_client.py @@ -28,7 +28,7 @@ def main(): http_ver = sys.argv[2] test = sys.argv[3] sess_file_path = os.path.join(sys.argv[4], 'sess.dat') - early_data_file_path = os.path.join(sys.argv[4], 'early_{0}_{1}.txt'.format(http_ver, test)) + early_data_file_path = os.path.join(sys.argv[4], 'early_{0}_{1}.test_input'.format(http_ver, test)) s_client_cmd_1 = shlex.split( 'openssl s_client -connect 127.0.0.1:{0} -tls1_3 -quiet -sess_out {1}'.format(ats_port, sess_file_path)) diff --git a/tests/gold_tests/tls/tls_0rtt_server.test.py b/tests/gold_tests/tls/tls_0rtt_server.test.py index 2c69ec087f2..07628c4aadf 100644 --- a/tests/gold_tests/tls/tls_0rtt_server.test.py +++ b/tests/gold_tests/tls/tls_0rtt_server.test.py @@ -100,12 +100,12 @@ ts.Setup.Copy('test-0rtt-s_client.py') ts.Setup.Copy('h2_early_decode.py') -ts.Setup.Copy('early_h1_get.txt') -ts.Setup.Copy('early_h1_post.txt') -ts.Setup.Copy('early_h2_get.txt') -ts.Setup.Copy('early_h2_post.txt') -ts.Setup.Copy('early_h2_multi1.txt') -ts.Setup.Copy('early_h2_multi2.txt') +ts.Setup.Copy('early_h1_get.test_input') +ts.Setup.Copy('early_h1_post.test_input') +ts.Setup.Copy('early_h2_get.test_input') +ts.Setup.Copy('early_h2_post.test_input') +ts.Setup.Copy('early_h2_multi1.test_input') +ts.Setup.Copy('early_h2_multi2.test_input') ts.Disk.records_config.update({ 'proxy.config.diags.debug.enabled': 1, diff --git a/tests/tools/tcp_client.py b/tests/tools/tcp_client.py index 632f76dd4cb..fb9ea827927 100644 --- a/tests/tools/tcp_client.py +++ b/tests/tools/tcp_client.py @@ -63,8 +63,9 @@ def main(argv): args = parser.parse_args() data = '' - with open(args.file, 'r') as f: - data = f.read() + with open(args.file, 'rb') as f: + raw_data = f.read() + data = raw_data.decode() tcp_client(args.host, args.port, data, args.delay_after_send)