From 7c6d52bd51682d38192cad98241b177c09b632a3 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Mon, 22 Feb 2021 10:25:44 +0100 Subject: [PATCH 1/6] test 675: add missing CR so the test passes when run through Privoxy --- tests/data/test675 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/test675 b/tests/data/test675 index b0933bede..fdc5a7631 100644 --- a/tests/data/test675 +++ b/tests/data/test675 @@ -12,7 +12,7 @@ HTTP Basic auth HTTP/1.1 200 OK swsclose Date: Thu, 09 Nov 2010 14:49:00 GMT Content-Type: text/html -Content-Length: 26 +Content-Length: 26 the content would go here -- 2.35.2 From a0bff2426b572575b60b3e21afad778491ad67bb Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 30 Mar 2021 14:22:11 +0200 Subject: [PATCH 2/6] test 2081: add a valid reply for the second request ... so the test works when using a HTTP proxy like Privoxy that sends an error message if the server doesn't send data. --- tests/data/test2081 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/data/test2081 b/tests/data/test2081 index a6733e737..add929252 100644 --- a/tests/data/test2081 +++ b/tests/data/test2081 @@ -19,6 +19,12 @@ Connection: close This server reply is for testing a simple Location: following + +HTTP/1.1 200 This is another weirdo text message swsclose +Connection: close + +Thanks for following. + # Client-side @@ -36,9 +42,6 @@ http://user:pass@%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER#anchor --location --r # Verify data after the test has been "shot" - -52 - GET /we/want/our/%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT @@ -60,6 +63,10 @@ Location: data/%TESTNUMBER0002.txt?coolsite=yes Content-Length: 62 Connection: close +HTTP/1.1 200 This is another weirdo text message swsclose +Connection: close + +Thanks for following. http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -- 2.35.2 From 1ca775ee9fcbbcad73dfac429f98c510cbebb50b Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 31 Mar 2021 12:03:00 +0200 Subject: [PATCH 3/6] runtests.pl: add the --repeat parameter to the --help output --- tests/runtests.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/runtests.pl b/tests/runtests.pl index c4fc453d8..529b70895 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -5763,6 +5763,7 @@ Usage: runtests.pl [options] [test selection(s)] -r run time statistics -rf full run time statistics -rm force removal of files by killing locking processes (Windows only) + --repeat=[num] Run the given tests this many times -s short output --seed=[num] set the random seed to a fixed number --shallow=[num] randomly makes the torture tests "thinner" -- 2.35.2 From 2335c6d57dee73c8b663ac135389fcfbe4b02e99 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Mon, 29 Mar 2021 15:53:31 +0200 Subject: [PATCH 4/6] sws: add support for the writesize servercmd ... which controls how many bytes are written in one write operation. --- tests/server/sws.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/server/sws.c b/tests/server/sws.c index 19c5f37f5..1a0254549 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -112,6 +112,8 @@ struct httprequest { bool ntlm; /* Authorization ntlm header found */ int writedelay; /* if non-zero, delay this number of milliseconds between writes in the response */ + size_t writesize; /* if non-zero, maximum number of response bytes to write + together. */ int skip; /* if non-zero, the server is instructed to not read this many bytes from a PUT/POST request. Ie the client sends N bytes said in Content-Length, but the server only reads N @@ -328,6 +330,10 @@ static int parse_servercmd(struct httprequest *req) logmsg("instructed to delay %d msecs between packets", num); req->writedelay = num; } + else if(1 == sscanf(cmd, "writesize: %d", &num)) { + logmsg("instructed to write %d bytes together", num); + req->writesize = num; + } else { logmsg("Unknown instruction found: %s", cmd); } @@ -854,6 +860,7 @@ static void init_httprequest(struct httprequest *req) req->skipall = FALSE; req->noexpect = FALSE; req->writedelay = 0; + req->writesize = 20; req->rcmd = RCMD_NORMALREQ; req->prot_version = 0; req->callcount = 0; @@ -1107,8 +1114,8 @@ static int send_doc(curl_socket_t sock, struct httprequest *req) larger chunks are split up so that the client will need to do multiple recv() calls to get it and thus we exercise that code better */ size_t num = count; - if(num > 20) - num = 20; + if(num > req->writesize) + num = req->writesize; retry: written = swrite(sock, buffer, num); -- 2.35.2 From b01f5843217368cd15989a60b7789e10c761dab6 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Mon, 13 Dec 2021 12:39:51 +0100 Subject: [PATCH 5/6] test{440,441,493,977}: add "HTTP proxy" keywords ... so the tests can be automatically skipped when using an external proxy like Privoxy. --- tests/data/test440 | 1 + tests/data/test441 | 1 + tests/data/test493 | 1 + tests/data/test977 | 1 + 4 files changed, 4 insertions(+) diff --git a/tests/data/test440 b/tests/data/test440 index c640b0231..0986cda1a 100644 --- a/tests/data/test440 +++ b/tests/data/test440 @@ -2,6 +2,7 @@ HTTP +HTTP proxy HSTS trailing-dot diff --git a/tests/data/test441 b/tests/data/test441 index 7f5245b61..6fbf7be3b 100644 --- a/tests/data/test441 +++ b/tests/data/test441 @@ -2,6 +2,7 @@ HTTP +HTTP proxy HSTS trailing-dot diff --git a/tests/data/test493 b/tests/data/test493 index db053d105..f0c41105b 100644 --- a/tests/data/test493 +++ b/tests/data/test493 @@ -2,6 +2,7 @@ HTTP +HTTP proxy HSTS url_effective diff --git a/tests/data/test977 b/tests/data/test977 index 11ff1b783..cecfd13f0 100644 --- a/tests/data/test977 +++ b/tests/data/test977 @@ -2,6 +2,7 @@ HTTP +HTTP proxy cookies -- 2.35.2 From 47cc26f736e3a58c25826bb92c87609382652633 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 21 May 2022 14:42:42 +0200 Subject: [PATCH 6/6] test414: add the '--resolve' keyword ... so the test can be automatically skipped when using an external proxy like Privoxy. --- tests/data/test414 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/data/test414 b/tests/data/test414 index a0e143400..2211d0f40 100644 --- a/tests/data/test414 +++ b/tests/data/test414 @@ -3,6 +3,7 @@ HTTP cookies +--resolve -- 2.35.2