From: Dan Fandrich Date: Wed, 14 Jun 2023 21:19:26 +0000 (-0700) Subject: tests: improve reliability of TFTP tests X-Git-Tag: curl-8_2_0~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72c5bb14e75ebb2e3d85229217f00b5d632ddf78;p=thirdparty%2Fcurl.git tests: improve reliability of TFTP tests Stop checking the timeout used by the client under test (for most tests). The timeout will change if the TFTP test server is slow (such as happens on an overprovisioned CI server) because the client will retry and reduce its timeout, and the actual value is not important for most tests. test285 is changed a different way, by increasing the connect timeout. This improves test coverage by allowing the changed timeout value to be checked, but improves reliability with a carefully-chosen timeout that not only allows twice the time to respond as before, but also allows several retries before the client will change its timeout value. Ref: #11328 --- diff --git a/tests/data/test1007 b/tests/data/test1007 index 5618048eea..e9f11c8b99 100644 --- a/tests/data/test1007 +++ b/tests/data/test1007 @@ -30,12 +30,14 @@ This data will not be sent 69 + +^timeout = [5-6]$ + opcode = 2 mode = octet tsize = 27 blksize = 512 -timeout = 6 filename = /invalid-file diff --git a/tests/data/test1009 b/tests/data/test1009 index 9e1fa55f58..041d88198d 100644 --- a/tests/data/test1009 +++ b/tests/data/test1009 @@ -35,12 +35,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER --local-port 44444-45444 # # Verify pseudo protocol after the test has been "shot" + +^timeout = [5-6]$ + opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER diff --git a/tests/data/test1049 b/tests/data/test1049 index 54d23903a8..165ba1ea79 100644 --- a/tests/data/test1049 +++ b/tests/data/test1049 @@ -35,12 +35,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER --interface %CLIENTIP # # Verify pseudo protocol after the test has been "shot" + +^timeout = [5-6]$ + opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER diff --git a/tests/data/test1093 b/tests/data/test1093 index 4fbc7b81b7..3d903412e2 100644 --- a/tests/data/test1093 +++ b/tests/data/test1093 @@ -35,12 +35,14 @@ TFTP retrieve with mode=i # # Verify pseudo protocol after the test has been "shot" + +^timeout = [5-6]$ + opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER diff --git a/tests/data/test1094 b/tests/data/test1094 index dd1452bb53..1b2a585919 100644 --- a/tests/data/test1094 +++ b/tests/data/test1094 @@ -41,12 +41,14 @@ TFTP retrieve with mode=netascii # # Verify pseudo protocol after the test has been "shot" + +^timeout = [5-6]$ + opcode = 1 mode = netascii tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER diff --git a/tests/data/test1099 b/tests/data/test1099 index 77099916f2..34cd99129d 100644 --- a/tests/data/test1099 +++ b/tests/data/test1099 @@ -30,18 +30,19 @@ tftp://%HOSTIP:%TFTPPORT/an/invalid-file tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER # # Verify pseudo protocol after the test has been "shot" + +^timeout = [5-6]$ + opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = an/invalid-file opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER diff --git a/tests/data/test1238 b/tests/data/test1238 index dbde8ee156..3e36fbfcca 100644 --- a/tests/data/test1238 +++ b/tests/data/test1238 @@ -47,12 +47,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER -Y1000 -y2 # # Verify pseudo protocol after the test has been "shot" + +^timeout = [5-6]$ + opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER # 28 = CURLE_OPERATION_TIMEDOUT diff --git a/tests/data/test2002 b/tests/data/test2002 index 1616cade17..e06490b958 100644 --- a/tests/data/test2002 +++ b/tests/data/test2002 @@ -72,6 +72,9 @@ moo # # Verify data after the test has been "shot" + +^timeout = [5-6]$ + GET /%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT @@ -89,7 +92,6 @@ opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER0003 QUIT diff --git a/tests/data/test2003 b/tests/data/test2003 index 8af42538b9..9054a8d4a5 100644 --- a/tests/data/test2003 +++ b/tests/data/test2003 @@ -72,6 +72,9 @@ moo # # Verify data after the test has been "shot" + +^timeout = [5-6]$ + GET /%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT @@ -89,13 +92,11 @@ opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER0003 opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER0003 EPSV SIZE %TESTNUMBER0002 diff --git a/tests/data/test2004 b/tests/data/test2004 index d747b8335c..80463569c6 100644 --- a/tests/data/test2004 +++ b/tests/data/test2004 @@ -41,18 +41,19 @@ for several protocols # # Verify data after the test has been "shot" + +^timeout = [5-6]$ + opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER diff --git a/tests/data/test271 b/tests/data/test271 index f6d5ad7b5c..a825198757 100644 --- a/tests/data/test271 +++ b/tests/data/test271 @@ -34,12 +34,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER # # Verify pseudo protocol after the test has been "shot" + +^timeout = [5-6]$ + opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER diff --git a/tests/data/test283 b/tests/data/test283 index 2c1ebd249d..0f2d0089a6 100644 --- a/tests/data/test283 +++ b/tests/data/test283 @@ -27,12 +27,14 @@ tftp://%HOSTIP:%TFTPPORT//invalid-file --tftp-blksize 1024 69 + +^timeout = [5-6]$ + opcode = 1 mode = octet tsize = 0 blksize = 1024 -timeout = 6 filename = /invalid-file diff --git a/tests/data/test284 b/tests/data/test284 index 2f4ea43179..a18f4929e5 100644 --- a/tests/data/test284 +++ b/tests/data/test284 @@ -58,12 +58,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER # # Verify pseudo protocol after the test has been "shot" + +^timeout = [5-6]$ + opcode = 1 mode = octet tsize = 0 blksize = 512 -timeout = 6 filename = /%TESTNUMBER diff --git a/tests/data/test285 b/tests/data/test285 index 1b76d19396..8cb479a129 100644 --- a/tests/data/test285 +++ b/tests/data/test285 @@ -16,7 +16,7 @@ tftp TFTP send --T %LOGDIR/test%TESTNUMBER.txt tftp://%HOSTIP:%TFTPPORT// +-T %LOGDIR/test%TESTNUMBER.txt tftp://%HOSTIP:%TFTPPORT// --connect-time 549 a chunk of @@ -40,7 +40,7 @@ opcode = 2 mode = octet tsize = 32 blksize = 512 -timeout = 6 +timeout = 10 filename = /test%TESTNUMBER.txt diff --git a/tests/data/test286 b/tests/data/test286 index 4ba0bcdeb6..d51ec10622 100644 --- a/tests/data/test286 +++ b/tests/data/test286 @@ -83,12 +83,14 @@ condition in the TFTP transmit code. 123456789ABCDEF 123456789ABCDEF + +^timeout = [5-6]$ + opcode = 2 mode = octet tsize = 512 blksize = 512 -timeout = 6 filename = /test%TESTNUMBER.txt diff --git a/tests/data/test332 b/tests/data/test332 index d2bd8bb6e6..54763eda0e 100644 --- a/tests/data/test332 +++ b/tests/data/test332 @@ -33,12 +33,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER --tftp-blksize 400 # # Verify pseudo protocol after the test has been "shot" + +^timeout = [5-6]$ + opcode = 1 mode = octet tsize = 0 blksize = 400 -timeout = 6 filename = /%TESTNUMBER