shinrich commented on code in PR #10866:
URL: https://github.com/apache/trafficserver/pull/10866#discussion_r1409624966


##########
tests/gold_tests/bigobj/bigobj.test.py:
##########
@@ -52,65 +47,88 @@
 )
 
 ts.Disk.remap_config.AddLine(
-    'map https://localhost http://localhost'
+    f'map https://localhost:{ts.Variables.ssl_port} 
http://localhost:{ts.Variables.port}'
+)
+ts.Disk.remap_config.AddLine(
+    f'map https://localhost:{ts.Variables.ssl_portv6} 
http://localhost:{ts.Variables.port}'
 )
-
-# Set up to check the output after the tests have run.
-#
-log_id = Test.Disk.File("log2.txt")
-log_id.Content = "log2.gold"
 
 # Size of object to get.  (NOTE:  If you increase this significantly you may 
also have to increase cache
 # capacity in tests/gold_tests/autest-size/min_cfg/storage.config.  Also, for 
very large objects, if
 # proxy.config.diags.debug.enabled is 1, the PUSH request will timeout and 
fail.)
 #
 obj_kilobytes = 10 * 1024
+obj_bytes = obj_kilobytes * 10
+header = "HTTP/1.1 200 OK\r\nContent-length: {}\r\n\r\n".format(obj_bytes)
+
+
+def create_pushfile():
+    f = open(Test.RunDirectory + "/objfile", "w")
+    f.write(header)
+    f.write("x" * obj_bytes)
+    f.close()
+    return True
+
 
 tr = Test.AddTestRun("PUSH an object to the cache")
 # Delay on readiness of TS IPv4 ssl port
-tr.Processes.Default.StartBefore(ts)
-#
+tr.Processes.Default.StartBefore(ts, ready=lambda: create_pushfile())
 # Put object with URL http://localhost/bigobj in cache using PUSH request.
-tr.Processes.Default.Command = (
-    f'./push_request {obj_kilobytes} | nc localhost {ts.Variables.port}'

Review Comment:
   Since curl does support PUSH, that seems more reliable and maintainable than 
relying on netcat. 
   
   The specific failure I was seeing on u22 was with the last testcase
   > file 
/home/ubuntu/ats10/build-mydev/tests/_sandbox/bigobj/_output/6-tr-Default/stream.stdout.txt
 : The PUSH request should have received a 403 response. - 
^[[0m^[[31mFailed^[[0m^[[1m
             Reason: Contents of 
/home/ubuntu/ats10/build-mydev/tests/_sandbox/bigobj/_output/6-tr-Default/stream.stdout.txt
 did not contains expression: "403 Access Denied"
   
   Specifically the stream.stdout.txt file was empty.  I assume there is a 
connection close difference or something between the distros.  Rather than 
debugging that, since nc isn't really needed, I felt it would be easier to deal 
with by using curl instead.
   



-- 
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]

Reply via email to