diff --git a/ci/rat-regex.txt b/ci/rat-regex.txt index dfea60e7f59..26c63b9523d 100644 --- a/ci/rat-regex.txt +++ b/ci/rat-regex.txt @@ -24,7 +24,6 @@ .*\.config$ .*\.yaml$ .*\.gold$ -.*\.test_input$ ^\.gitignore$ ^\.gitmodules$ ^\.perltidyrc$ diff --git a/proxy/hdrs/MIME.cc b/proxy/hdrs/MIME.cc index 7376e3ca870..b88c5d5b954 100644 --- a/proxy/hdrs/MIME.cc +++ b/proxy/hdrs/MIME.cc @@ -2349,6 +2349,8 @@ 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()) { @@ -2366,7 +2368,7 @@ MIMEScanner::get(TextView &input, TextView &output, bool &output_shares_input, b } } else if (ParseRules::is_lf(*text)) { ++text; - zret = PARSE_RESULT_ERROR; // lone LF + zret = PARSE_RESULT_DONE; // Required by regression test. } else { // consume this character in the next state. m_state = MIME_PARSE_INSIDE; @@ -2378,28 +2380,21 @@ MIMEScanner::get(TextView &input, TextView &output, bool &output_shares_input, b ++text; zret = PARSE_RESULT_DONE; } else { - zret = PARSE_RESULT_ERROR; // lone CR + // 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; } break; case MIME_PARSE_INSIDE: { - 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; + 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. } } else { // no EOL, consume all text without changing state. text.remove_prefix(text.size()); @@ -2536,14 +2531,18 @@ mime_parser_parse(MIMEParser *parser, HdrHeap *heap, MIMEHdrImpl *mh, const char return err; } - /////////////////////////////////////////////////// - // if got a CR and LF on its own, end the header // - /////////////////////////////////////////////////// + ////////////////////////////////////////////////// + // if got a LF or CR 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 51827b00407..73022bf6212 100644 --- a/proxy/hdrs/unit_tests/test_Hdrs.cc +++ b/proxy/hdrs/unit_tests/test_Hdrs.cc @@ -45,26 +45,24 @@ 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_ERROR, 25}, - {"GET /index.html HTTP/1.0\n\n", PARSE_RESULT_ERROR, 26}, + {"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\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_ERROR, 45}, + {"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\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_ERROR, 44}, - {"GET /index.html HTTP/1.0\nUser-Agent: foobar\nBoo: foo\n", PARSE_RESULT_ERROR, 53}, + {"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\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.test_input b/tests/gold_tests/body_factory/data/www.customplugin204.test_get.txt similarity index 95% rename from tests/gold_tests/body_factory/data/www.customplugin204.test_get.test_input rename to tests/gold_tests/body_factory/data/www.customplugin204.test_get.txt index be603f95f17..4cf018aea16 100644 --- a/tests/gold_tests/body_factory/data/www.customplugin204.test_get.test_input +++ b/tests/gold_tests/body_factory/data/www.customplugin204.test_get.txt @@ -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.test_input b/tests/gold_tests/body_factory/data/www.customtemplate204.test_get.txt similarity index 96% rename from tests/gold_tests/body_factory/data/www.customtemplate204.test_get.test_input rename to tests/gold_tests/body_factory/data/www.customtemplate204.test_get.txt index 395d7985f69..f16fbc74628 100644 --- a/tests/gold_tests/body_factory/data/www.customtemplate204.test_get.test_input +++ b/tests/gold_tests/body_factory/data/www.customtemplate204.test_get.txt @@ -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.test_input b/tests/gold_tests/body_factory/data/www.default204.test_get.txt similarity index 95% rename from tests/gold_tests/body_factory/data/www.default204.test_get.test_input rename to tests/gold_tests/body_factory/data/www.default204.test_get.txt index e77408af827..1a421ddf182 100644 --- a/tests/gold_tests/body_factory/data/www.default204.test_get.test_input +++ b/tests/gold_tests/body_factory/data/www.default204.test_get.txt @@ -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.test_input b/tests/gold_tests/body_factory/data/www.default304.test_get.txt similarity index 95% rename from tests/gold_tests/body_factory/data/www.default304.test_get.test_input rename to tests/gold_tests/body_factory/data/www.default304.test_get.txt index c9064fa0ade..d251435b982 100644 --- a/tests/gold_tests/body_factory/data/www.default304.test_get.test_input +++ b/tests/gold_tests/body_factory/data/www.default304.test_get.txt @@ -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.test_input b/tests/gold_tests/body_factory/data/www.example.test_get_200.txt similarity index 93% rename from tests/gold_tests/body_factory/data/www.example.test_get_200.test_input rename to tests/gold_tests/body_factory/data/www.example.test_get_200.txt index c53681f3486..5994603557f 100644 --- a/tests/gold_tests/body_factory/data/www.example.test_get_200.test_input +++ b/tests/gold_tests/body_factory/data/www.example.test_get_200.txt @@ -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.test_input b/tests/gold_tests/body_factory/data/www.example.test_get_304.txt similarity index 95% rename from tests/gold_tests/body_factory/data/www.example.test_get_304.test_input rename to tests/gold_tests/body_factory/data/www.example.test_get_304.txt index 8d0aecf9bdb..03a8d5967eb 100644 --- a/tests/gold_tests/body_factory/data/www.example.test_get_304.test_input +++ b/tests/gold_tests/body_factory/data/www.example.test_get_304.txt @@ -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.test_input b/tests/gold_tests/body_factory/data/www.example.test_head.txt similarity index 95% rename from tests/gold_tests/body_factory/data/www.example.test_head.test_input rename to tests/gold_tests/body_factory/data/www.example.test_head.txt index c5a5c979e9e..514c1071065 100644 --- a/tests/gold_tests/body_factory/data/www.example.test_head.test_input +++ b/tests/gold_tests/body_factory/data/www.example.test_head.txt @@ -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.test_input b/tests/gold_tests/body_factory/data/www.example.test_head_200.txt similarity index 94% rename from tests/gold_tests/body_factory/data/www.example.test_head_200.test_input rename to tests/gold_tests/body_factory/data/www.example.test_head_200.txt index 6d214e1b365..fc0f1d536fd 100644 --- a/tests/gold_tests/body_factory/data/www.example.test_head_200.test_input +++ b/tests/gold_tests/body_factory/data/www.example.test_head_200.txt @@ -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 529abf6266a..5d1147e9561 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.test_input" +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.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.test_input" +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.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 7f701961654..72ba642c908 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.test_input" +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.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 807f413d28f..7baa4b424e2 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.test_input" +cmd_tpl = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{DEFAULT_304_HOST}_get.txt" 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 2e1c4a2a35b..097c4761095 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.test_input" +tr.Processes.Default.Command = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_head.txt" 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 8ea3c0a7954..24f833e03f4 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.test_input" +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.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.test_input" +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.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.test_input" +cmd_tpl = f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} data/{HOST}_get_304.txt" 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.test_input b/tests/gold_tests/headers/data/www.http408.test.txt similarity index 72% rename from tests/gold_tests/headers/data/www.http408.test.test_input rename to tests/gold_tests/headers/data/www.http408.test.txt index 4e3be6c5294..81f9f9893e5 100644 --- a/tests/gold_tests/headers/data/www.http408.test.test_input +++ b/tests/gold_tests/headers/data/www.http408.test.txt @@ -1,5 +1,5 @@ -POST / HTTP/1.1 -Host: www.http408.test -Content-Length: 100 - -arbitrary content +POST / HTTP/1.1 +Host: www.http408.test +Content-Length: 100 + +arbitrary content \ No newline at end of file diff --git a/tests/gold_tests/headers/data/www.passthrough.test_get.test_input b/tests/gold_tests/headers/data/www.passthrough.test_get.txt similarity index 95% rename from tests/gold_tests/headers/data/www.passthrough.test_get.test_input rename to tests/gold_tests/headers/data/www.passthrough.test_get.txt index 0cba742da68..ffe69c2afd9 100644 --- a/tests/gold_tests/headers/data/www.passthrough.test_get.test_input +++ b/tests/gold_tests/headers/data/www.passthrough.test_get.txt @@ -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.test_input b/tests/gold_tests/headers/data/www.redirect0.test_get.txt similarity index 95% rename from tests/gold_tests/headers/data/www.redirect0.test_get.test_input rename to tests/gold_tests/headers/data/www.redirect0.test_get.txt index 40fce98c217..3d3d219e385 100644 --- a/tests/gold_tests/headers/data/www.redirect0.test_get.test_input +++ b/tests/gold_tests/headers/data/www.redirect0.test_get.txt @@ -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.test_input b/tests/gold_tests/headers/data/www.redirect301.test_get.txt similarity index 95% rename from tests/gold_tests/headers/data/www.redirect301.test_get.test_input rename to tests/gold_tests/headers/data/www.redirect301.test_get.txt index 48352678c17..e51c353dddc 100644 --- a/tests/gold_tests/headers/data/www.redirect301.test_get.test_input +++ b/tests/gold_tests/headers/data/www.redirect301.test_get.txt @@ -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.test_input b/tests/gold_tests/headers/data/www.redirect302.test_get.txt similarity index 95% rename from tests/gold_tests/headers/data/www.redirect302.test_get.test_input rename to tests/gold_tests/headers/data/www.redirect302.test_get.txt index 6aae2667c6d..35f77503149 100644 --- a/tests/gold_tests/headers/data/www.redirect302.test_get.test_input +++ b/tests/gold_tests/headers/data/www.redirect302.test_get.txt @@ -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.test_input b/tests/gold_tests/headers/data/www.redirect307.test_get.txt similarity index 95% rename from tests/gold_tests/headers/data/www.redirect307.test_get.test_input rename to tests/gold_tests/headers/data/www.redirect307.test_get.txt index b37c8ae1486..49bb1bc3072 100644 --- a/tests/gold_tests/headers/data/www.redirect307.test_get.test_input +++ b/tests/gold_tests/headers/data/www.redirect307.test_get.txt @@ -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.test_input b/tests/gold_tests/headers/data/www.redirect308.test_get.txt similarity index 95% rename from tests/gold_tests/headers/data/www.redirect308.test_get.test_input rename to tests/gold_tests/headers/data/www.redirect308.test_get.txt index 05bcbf8ec78..097e95eb126 100644 --- a/tests/gold_tests/headers/data/www.redirect308.test_get.test_input +++ b/tests/gold_tests/headers/data/www.redirect308.test_get.txt @@ -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 b38f1413c55..275c3425890 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.test_input'.format(REDIRECT_301_HOST)) + format(ts.Variables.port, 'data/{0}_get.txt'.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.test_input'.format(REDIRECT_302_HOST)) + format(ts.Variables.port, 'data/{0}_get.txt'.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.test_input'.format(REDIRECT_307_HOST)) + format(ts.Variables.port, 'data/{0}_get.txt'.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.test_input'.format(REDIRECT_308_HOST)) + format(ts.Variables.port, 'data/{0}_get.txt'.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.test_input'.format(REDIRECT_0_HOST)) + format(ts.Variables.port, 'data/{0}_get.txt'.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.test_input'.format(PASSTHRU_HOST)) + format(ts.Variables.port, 'data/{0}_get.txt'.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 8f6b5d21f4b..e3c2d9cd697 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}.test_input'.format(HTTP_408_HOST), TIMEOUT + 2) + .format(ts.Variables.port, 'data/{0}.txt'.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 4aeb8b672ee..b4a5a3e2c44 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\r\n" + - "Host: xyz\r\n" + - "Connection: close\r\n" + - "\r\n" + "GET /admin/v1/combo?obj1&sub:obj2&obj3 HTTP/1.1\n" + + "Host: xyz\n" + + "Connection: close\n" + + "\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\r\n" + - "Host: xyz\r\n" + - "Connection: close\r\n" + - "\r\n" + "GET /admin/v1/combo?obj1&sub:obj2&obj4 HTTP/1.1\n" + + "Host: xyz\n" + + "Connection: close\n" + + "\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.test_input b/tests/gold_tests/pluginTest/xdebug/x_cache_info/none.in similarity index 92% rename from tests/gold_tests/pluginTest/xdebug/x_cache_info/none.test_input rename to tests/gold_tests/pluginTest/xdebug/x_cache_info/none.in index 2d8e0e1b5b4..1d9b7f59a4f 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_cache_info/none.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_cache_info/none.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_cache_info/one.in similarity index 92% rename from tests/gold_tests/pluginTest/xdebug/x_cache_info/one.test_input rename to tests/gold_tests/pluginTest/xdebug/x_cache_info/one.in index 3a73f5fd021..e751d8ddad3 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_cache_info/one.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_cache_info/one.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_cache_info/three.in similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_cache_info/three.test_input rename to tests/gold_tests/pluginTest/xdebug/x_cache_info/three.in index 59ed7b594ac..d0f63c0d440 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_cache_info/three.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_cache_info/three.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_cache_info/two.in similarity index 92% rename from tests/gold_tests/pluginTest/xdebug/x_cache_info/two.test_input rename to tests/gold_tests/pluginTest/xdebug/x_cache_info/two.in index 64258cadc38..55786b0aebf 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_cache_info/two.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_cache_info/two.in @@ -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 39a861e65a7..892297bb6dd 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}.test_input') + Test.Setup.Copy(f'{Test.TestDirectory}/{file}.in') 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}.test_input ; 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}.in ; 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.test_input b/tests/gold_tests/pluginTest/xdebug/x_effective_url/none.in similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_effective_url/none.test_input rename to tests/gold_tests/pluginTest/xdebug/x_effective_url/none.in index c9c47a8c297..e07b30662f5 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_effective_url/none.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_effective_url/none.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_effective_url/one.in similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_effective_url/one.test_input rename to tests/gold_tests/pluginTest/xdebug/x_effective_url/one.in index f27ecc620db..d9223256128 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_effective_url/one.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_effective_url/one.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_effective_url/three.in similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_effective_url/three.test_input rename to tests/gold_tests/pluginTest/xdebug/x_effective_url/three.in index ec1a09aaaa5..7076c1a249c 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_effective_url/three.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_effective_url/three.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_effective_url/two.in similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_effective_url/two.test_input rename to tests/gold_tests/pluginTest/xdebug/x_effective_url/two.in index 9a1fd140a75..52ded33b4f0 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_effective_url/two.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_effective_url/two.in @@ -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 6323110b039..ed1c3b54300 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 {} {}/{}.test_input".format( + "( python3 {}/tcp_client.py 127.0.0.1 {} {}/{}.in".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.test_input b/tests/gold_tests/pluginTest/xdebug/x_remap/four.in similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/four.test_input rename to tests/gold_tests/pluginTest/xdebug/x_remap/four.in index 481f01534f5..68420397501 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/four.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/four.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd1.in similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/fwd1.test_input rename to tests/gold_tests/pluginTest/xdebug/x_remap/fwd1.in index 8b374433c7a..82f3fa52ecb 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd1.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd1.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd2.in similarity index 94% rename from tests/gold_tests/pluginTest/xdebug/x_remap/fwd2.test_input rename to tests/gold_tests/pluginTest/xdebug/x_remap/fwd2.in index 2f6c38ff10e..4f7ea91305f 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd2.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd2.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd3.in similarity index 94% rename from tests/gold_tests/pluginTest/xdebug/x_remap/fwd3.test_input rename to tests/gold_tests/pluginTest/xdebug/x_remap/fwd3.in index 7f30b0f53c7..42c187a9c9a 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd3.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd3.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd4.in similarity index 94% rename from tests/gold_tests/pluginTest/xdebug/x_remap/fwd4.test_input rename to tests/gold_tests/pluginTest/xdebug/x_remap/fwd4.in index 79699d0dcbe..db3ce259716 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd4.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd4.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd5.in similarity index 94% rename from tests/gold_tests/pluginTest/xdebug/x_remap/fwd5.test_input rename to tests/gold_tests/pluginTest/xdebug/x_remap/fwd5.in index 666e67b2308..02b44e7c3de 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/fwd5.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/fwd5.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_remap/none.in similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/none.test_input rename to tests/gold_tests/pluginTest/xdebug/x_remap/none.in index 7b816cefe8e..a077b72790d 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/none.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/none.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_remap/one.in similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/one.test_input rename to tests/gold_tests/pluginTest/xdebug/x_remap/one.in index f0ae4209ea6..6a35a87a16f 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/one.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/one.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_remap/three.in similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/three.test_input rename to tests/gold_tests/pluginTest/xdebug/x_remap/three.in index 8c0269ff946..1d9612a51f9 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/three.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/three.in @@ -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.test_input b/tests/gold_tests/pluginTest/xdebug/x_remap/two.in similarity index 93% rename from tests/gold_tests/pluginTest/xdebug/x_remap/two.test_input rename to tests/gold_tests/pluginTest/xdebug/x_remap/two.in index 4de650ab71f..514d173c104 100644 --- a/tests/gold_tests/pluginTest/xdebug/x_remap/two.test_input +++ b/tests/gold_tests/pluginTest/xdebug/x_remap/two.in @@ -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 d85dedcef81..f5ee5df0eea 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 {} {}/{}.test_input".format( + "( python3 {}/tcp_client.py 127.0.0.1 {} {}/{}.in".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.test_input b/tests/gold_tests/tls/early_h1_get.txt similarity index 93% rename from tests/gold_tests/tls/early_h1_get.test_input rename to tests/gold_tests/tls/early_h1_get.txt index 047f0a308d6..93b5876dc30 100644 --- a/tests/gold_tests/tls/early_h1_get.test_input +++ b/tests/gold_tests/tls/early_h1_get.txt @@ -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.test_input b/tests/gold_tests/tls/early_h1_post.txt similarity index 94% rename from tests/gold_tests/tls/early_h1_post.test_input rename to tests/gold_tests/tls/early_h1_post.txt index 3cdf49d857e..117b06c080d 100644 --- a/tests/gold_tests/tls/early_h1_post.test_input +++ b/tests/gold_tests/tls/early_h1_post.txt @@ -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.test_input b/tests/gold_tests/tls/early_h2_get.txt similarity index 100% rename from tests/gold_tests/tls/early_h2_get.test_input rename to tests/gold_tests/tls/early_h2_get.txt diff --git a/tests/gold_tests/tls/early_h2_multi1.test_input b/tests/gold_tests/tls/early_h2_multi1.txt similarity index 100% rename from tests/gold_tests/tls/early_h2_multi1.test_input rename to tests/gold_tests/tls/early_h2_multi1.txt diff --git a/tests/gold_tests/tls/early_h2_multi2.test_input b/tests/gold_tests/tls/early_h2_multi2.txt similarity index 100% rename from tests/gold_tests/tls/early_h2_multi2.test_input rename to tests/gold_tests/tls/early_h2_multi2.txt diff --git a/tests/gold_tests/tls/early_h2_post.test_input b/tests/gold_tests/tls/early_h2_post.txt similarity index 100% rename from tests/gold_tests/tls/early_h2_post.test_input rename to tests/gold_tests/tls/early_h2_post.txt diff --git a/tests/gold_tests/tls/test-0rtt-s_client.py b/tests/gold_tests/tls/test-0rtt-s_client.py index 576976ea30a..d2a90447c87 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}.test_input'.format(http_ver, test)) + early_data_file_path = os.path.join(sys.argv[4], 'early_{0}_{1}.txt'.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 07628c4aadf..2c69ec087f2 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.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.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.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 fb9ea827927..632f76dd4cb 100644 --- a/tests/tools/tcp_client.py +++ b/tests/tools/tcp_client.py @@ -63,9 +63,8 @@ def main(argv): args = parser.parse_args() data = '' - with open(args.file, 'rb') as f: - raw_data = f.read() - data = raw_data.decode() + with open(args.file, 'r') as f: + data = f.read() tcp_client(args.host, args.port, data, args.delay_after_send)