bneradt commented on code in PR #8969: URL: https://github.com/apache/trafficserver/pull/8969#discussion_r936970504
########## tests/gold_tests/network_error/epiper.py: ########## @@ -0,0 +1,40 @@ +''' +''' Review Comment: Probably good to fill this in with a quick description of the script. Maybe: ``` Accept connections on the specified port and generate EPIPE on the peer by closing the connections immediately. ``` ########## tests/gold_tests/network_error/epipe.test.py: ########## @@ -0,0 +1,45 @@ +''' +''' +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ports import get_port +import sys + +Test.Summary = ''' +Test that Trafficserver starts with default configurations. +''' + +epiper = Test.Processes.Process("epiper") +epiper.Setup.CopyAs('epiper.py', Test.RunDirectory) +origin_port = get_port(epiper, "Port") +epiper.Command = f"{sys.executable} epiper.py {origin_port}" +epiper.Ready = When.PortOpen(origin_port) + +ats = Test.MakeATSProcess("ats", select_ports=True) +ats.Disk.remap_config.AddLine( + f'map / http://127.0.0.1:{origin_port}' +) +ats.Ready = When.PortOpen(ats.Variables.port) + +t = Test.AddTestRun("Verify behavior when remote server closes a connection.") +t.StillRunningAfter = ats + +curl = t.Processes.Default +curl.Command = "curl http://127.0.0.1:{0}".format(ats.Variables.port) Review Comment: Might as well use an `f"...` format string here as above. ########## tests/gold_tests/network_error/epipe.test.py: ########## @@ -0,0 +1,45 @@ +''' +''' +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ports import get_port +import sys + +Test.Summary = ''' +Test that Trafficserver starts with default configurations. +''' + +epiper = Test.Processes.Process("epiper") +epiper.Setup.CopyAs('epiper.py', Test.RunDirectory) +origin_port = get_port(epiper, "Port") +epiper.Command = f"{sys.executable} epiper.py {origin_port}" +epiper.Ready = When.PortOpen(origin_port) + +ats = Test.MakeATSProcess("ats", select_ports=True) Review Comment: A small thing, but most of our tests just use `ts` for the process name. I suggest keeping with that convention. ########## tests/gold_tests/network_error/epipe.test.py: ########## @@ -0,0 +1,45 @@ +''' +''' +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ports import get_port +import sys + +Test.Summary = ''' +Test that Trafficserver starts with default configurations. Review Comment: Probably: ``` Test that Traffic Server handles server-side EPIPE errors gracefully. ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
