From: Fabian Keil <fk@fabiankeil.de>
Date: Tue, 24 May 2022 06:07:40 +0000 (+0200)
Subject: tests/cts: When there's lots of POST data, read it from a file
X-Git-Tag: v_4_0_0~82
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/faq/user-manual/static/gitweb.js?a=commitdiff_plain;h=a50caf716686cac436937bdfd7bcb2444e5f59c5;p=privoxy.git

tests/cts: When there's lots of POST data, read it from a file

... instead of the command line.

Makes it less likely that the curl executions fails due
to the argument list being too long.

Reported by: Roland

Sponsored by: Privoxy project funds collected at SPI
---

diff --git a/tests/cts/client-body-filter/data/test12 b/tests/cts/client-body-filter/data/test12
index 8db65fde..b2d3ad6a 100644
--- a/tests/cts/client-body-filter/data/test12
+++ b/tests/cts/client-body-filter/data/test12
@@ -39,8 +39,11 @@ proxy
 # Sending the first request to appease the test framework.
 # We mainly care about the second request which is too large for Privoxy to buffer it.
 <command>
-http://%HOSTIP:%HTTPPORT/first-request/%TESTNUMBER --next -d "blafasel%repeat[20000 x padding]%" http://%HOSTIP:%HTTPPORT/second-request/%TESTNUMBER
+http://%HOSTIP:%HTTPPORT/first-request/%TESTNUMBER --next -d @log/post-data-%TESTNUMBER http://%HOSTIP:%HTTPPORT/second-request/%TESTNUMBER
 </command>
+<file name="log/post-data-%TESTNUMBER">
+blafasel%repeat[20000 x padding]%
+</file>
 </client>
 
 <verify>
diff --git a/tests/cts/client-body-tagger-https/data/test15 b/tests/cts/client-body-tagger-https/data/test15
index f16f5a38..ece0648b 100644
--- a/tests/cts/client-body-tagger-https/data/test15
+++ b/tests/cts/client-body-tagger-https/data/test15
@@ -40,8 +40,11 @@ Two requests to the same URL. The second one is a POST request with an offending
 proxy
 </features>
 <command>
--s --write-out '%{stderr}%{response_code}\n' --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER --next -d "blafasel%repeat[20000 x padding]%" -s --write-out '%{stderr}%{response_code}\n' --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER
+-s --write-out '%{stderr}%{response_code}\n' --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER --next -d @log/post-data-%TESTNUMBER -s --write-out '%{stderr}%{response_code}\n' --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER
 </command>
+<file name="log/post-data-%TESTNUMBER">
+blafasel%repeat[20000 x padding]%
+</file>
 </client>
 
 <verify>
diff --git a/tests/cts/client-body-tagger-https/data/test7 b/tests/cts/client-body-tagger-https/data/test7
index dd72ae85..445148d9 100644
--- a/tests/cts/client-body-tagger-https/data/test7
+++ b/tests/cts/client-body-tagger-https/data/test7
@@ -42,8 +42,11 @@ Two requests to the same URL. The second one is a POST request with an offending
 proxy
 </features>
 <command>
--s --write-out '%{stderr}%{response_code}\n' --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER --next -d "blafasel%repeat[20000 x padding]%" -s --write-out '%{stderr}%{response_code}\n' --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER
+-s --write-out '%{stderr}%{response_code}\n' --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER --next -d @log/post-data-%TESTNUMBER -s --write-out '%{stderr}%{response_code}\n' --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER
 </command>
+<file name="log/post-data-%TESTNUMBER">
+blafasel%repeat[20000 x padding]%
+</file>
 </client>
 
 <verify>
diff --git a/tests/cts/client-body-tagger/data/test7 b/tests/cts/client-body-tagger/data/test7
index d108d812..753d89f9 100644
--- a/tests/cts/client-body-tagger/data/test7
+++ b/tests/cts/client-body-tagger/data/test7
@@ -29,8 +29,11 @@ Two requests to the same URL. The second one is a POST request with an offending
 proxy
 </features>
 <command>
--s --write-out '%{stderr}%{response_code}\n' http://%HOSTIP:%HTTPPORT/%TESTNUMBER --next -d "blafasel%repeat[20000 x padding]%" -s --write-out '%{stderr}%{response_code}\n' http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+-s --write-out '%{stderr}%{response_code}\n' http://%HOSTIP:%HTTPPORT/%TESTNUMBER --next -d @log/post-data-%TESTNUMBER -s --write-out '%{stderr}%{response_code}\n' http://%HOSTIP:%HTTPPORT/%TESTNUMBER
 </command>
+<file name="log/post-data-%TESTNUMBER">
+blafasel%repeat[20000 x padding]%
+</file>
 </client>
 
 <verify>