ywkaras commented on code in PR #10861: URL: https://github.com/apache/trafficserver/pull/10861#discussion_r1410127689
########## tests/gold_tests/bad_http_fmt/bad_http_fmt.test.py: ########## @@ -55,108 +101,111 @@ ' - GET' ]) -Test.GetTcpPort("server_port") - - -def server_cmd(resp_id): - dq = '"' - return (fr"(nc -o server{resp_id}.log " + - fr"--sh-exec 'sleep 1 ; printf {dq}HTTP/1.1 200 OK\r\n" + - fr"X-Resp-Id: {resp_id}\r\n" + - fr"Content-Length: 0\r\n\r\n{dq}' " + - fr"-l 127.0.0.1 {Test.Variables.server_port} & )") - +ts.Disk.remap_config.AddLine( + 'map /add-method http://127.0.0.1:{0}/'.format(Test.Variables.upstream_port) +) +ts.Disk.remap_config.AddLine( + 'map / http://127.0.0.1:{0}/'.format(server.Variables.Port) +) # Even if the request from the client is HTTP version 1.0, ATS's request to server will be HTTP version 1.1. # -tr = Test.AddTestRun() +tr = Test.AddTestRun("success-1.0") tr.Processes.Default.StartBefore(ts) +tr.Processes.Default.StartBefore(server) tr.Processes.Default.Command = ( - server_cmd(1) + - fr" ; printf 'GET {random_path}HTTP/1.0\r\n" + - fr"Host: localhost:{Test.Variables.server_port}\r\n" + - r"X-Req-Id: 0\r\n\r\n'" + + f"printf 'GET {random_path}/0 HTTP/1.0\r\n" + + "Host: example.com\r\n" + + "Connection: close\r\n" + + "X-Req-Id: 1\r\n\r\n'" + f" | nc localhost {ts.Variables.port} >> client.log" + " ; echo '======' >> client.log" ) tr.Processes.Default.ReturnCode = 0 -tr = Test.AddTestRun() +tr = Test.AddTestRun("success-1.1") tr.Processes.Default.Command = ( - server_cmd(2) + - fr" ; printf 'GET {random_path}HTTP/1.1\r\n" + - fr"Host: localhost:{Test.Variables.server_port}\r\n" + - r"X-Req-Id: 1\r\n\r\n'" + + f"printf 'GET {random_path}/1 HTTP/1.1\r\n" + Review Comment: Seems like a bad first line was changed into a good one? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@trafficserver.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org