]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: improve reliability of TFTP tests
authorDan Fandrich <dan@coneharvesters.com>
Wed, 14 Jun 2023 21:19:26 +0000 (14:19 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Tue, 20 Jun 2023 00:10:24 +0000 (17:10 -0700)
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

16 files changed:
tests/data/test1007
tests/data/test1009
tests/data/test1049
tests/data/test1093
tests/data/test1094
tests/data/test1099
tests/data/test1238
tests/data/test2002
tests/data/test2003
tests/data/test2004
tests/data/test271
tests/data/test283
tests/data/test284
tests/data/test285
tests/data/test286
tests/data/test332

index 5618048eea617b023fa7bcdab5835a7a2331242a..e9f11c8b99235faab5078de97519674ea144e4fd 100644 (file)
@@ -30,12 +30,14 @@ This data will not be sent
 <errorcode>
 69
 </errorcode>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 2
 mode = octet
 tsize = 27
 blksize = 512
-timeout = 6
 filename = /invalid-file
 </protocol>
 <stderr mode="text">
index 9e1fa55f580809996ec62c80d53e8f818e38de97..041d88198d08d83a289bcd8b0bb6b39ef6c4653c 100644 (file)
@@ -35,12 +35,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER --local-port 44444-45444
 #
 # Verify pseudo protocol after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 1
 mode = octet
 tsize = 0
 blksize = 512
-timeout = 6
 filename = /%TESTNUMBER
 </protocol>
 </verify>
index 54d23903a8fa97f327ceff260d778fd9a61c5aca..165ba1ea795b6be28ee1b9fc363b3781144953c4 100644 (file)
@@ -35,12 +35,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER --interface %CLIENTIP
 #
 # Verify pseudo protocol after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 1
 mode = octet
 tsize = 0
 blksize = 512
-timeout = 6
 filename = /%TESTNUMBER
 </protocol>
 </verify>
index 4fbc7b81b7befb70731fde726bdc6eaa01f1f40b..3d903412e22b779510a23b4e5aae06a2c7e26f2a 100644 (file)
@@ -35,12 +35,14 @@ TFTP retrieve with mode=i
 #
 # Verify pseudo protocol after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 1
 mode = octet
 tsize = 0
 blksize = 512
-timeout = 6
 filename = /%TESTNUMBER
 </protocol>
 </verify>
index dd1452bb53374e398b98d601e5ffa5cb589e27da..1b2a58591959d1b4b7b34e74cc560b4ffb552016 100644 (file)
@@ -41,12 +41,14 @@ TFTP retrieve with mode=netascii
 #
 # Verify pseudo protocol after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 1
 mode = netascii
 tsize = 0
 blksize = 512
-timeout = 6
 filename = /%TESTNUMBER
 </protocol>
 </verify>
index 77099916f2553fe07c90f368a3627e924e17ccf9..34cd99129d1bf8d27569b7923a746cecf8b7960d 100644 (file)
@@ -30,18 +30,19 @@ tftp://%HOSTIP:%TFTPPORT/an/invalid-file tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER
 #
 # Verify pseudo protocol after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 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
 </protocol>
 <stdout>
index dbde8ee156c064edabb9fdec82b39ec0b3362591..3e36fbfcca795196cd332a3e5e17ea54c2133518 100644 (file)
@@ -47,12 +47,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER -Y1000 -y2
 #
 # Verify pseudo protocol after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 1
 mode = octet
 tsize = 0
 blksize = 512
-timeout = 6
 filename = /%TESTNUMBER
 </protocol>
 # 28 = CURLE_OPERATION_TIMEDOUT
index 1616cade1778b925f951c5dc2b31b1337862d051..e06490b95873a102629d67b1a5941d7473404ac1 100644 (file)
@@ -72,6 +72,9 @@ moo
 #
 # Verify data after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 GET /%TESTNUMBER0001 HTTP/1.1\r
 Host: %HOSTIP:%HTTPPORT\r
@@ -89,7 +92,6 @@ opcode = 1
 mode = octet
 tsize = 0
 blksize = 512
-timeout = 6
 filename = /%TESTNUMBER0003
 QUIT\r
 </protocol>
index 8af42538b9977cc4c1a8c4cd19f3c73ceefb3997..9054a8d4a58a8d065676094eaa8cd72748a86582 100644 (file)
@@ -72,6 +72,9 @@ moo
 #
 # Verify data after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 GET /%TESTNUMBER0001 HTTP/1.1\r
 Host: %HOSTIP:%HTTPPORT\r
@@ -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\r
 SIZE %TESTNUMBER0002\r
index d747b8335ca530038239ba88986075beb627d0c2..80463569c6edb95c75bbf7dc7365777ef8e41d92 100644 (file)
@@ -41,18 +41,19 @@ for several protocols
 #
 # Verify data after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 1
 mode = octet
 tsize = 0
 blksize = 512
-timeout = 6
 filename = /%TESTNUMBER
 opcode = 1
 mode = octet
 tsize = 0
 blksize = 512
-timeout = 6
 filename = /%TESTNUMBER
 </protocol>
 <stdout>
index f6d5ad7b5c7d6376144129a851b986b7a784cff0..a82519875725755f2825c54557cbd484c9972e8e 100644 (file)
@@ -34,12 +34,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER
 #
 # Verify pseudo protocol after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 1
 mode = octet
 tsize = 0
 blksize = 512
-timeout = 6
 filename = /%TESTNUMBER
 </protocol>
 </verify>
index 2c1ebd249d527244e10b37354b59c3a8de9bcffd..0f2d0089a6407b8eb157c737bf6acb6b5ee0cde7 100644 (file)
@@ -27,12 +27,14 @@ tftp://%HOSTIP:%TFTPPORT//invalid-file --tftp-blksize 1024
 <errorcode>
 69
 </errorcode>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 1
 mode = octet
 tsize = 0
 blksize = 1024
-timeout = 6
 filename = /invalid-file
 </protocol>
 </verify>
index 2f4ea431793ab4f6908a0fdc8924b1ceaf97f4a1..a18f4929e533db7e61239dd2a363b7d47d8ab34a 100644 (file)
@@ -58,12 +58,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER
 #
 # Verify pseudo protocol after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 1
 mode = octet
 tsize = 0
 blksize = 512
-timeout = 6
 filename = /%TESTNUMBER
 </protocol>
 </verify>
index 1b76d19396f8373430110571f3822ebbf942941e..8cb479a12995a63c9b3268e31921222606af3577 100644 (file)
@@ -16,7 +16,7 @@ tftp
 TFTP send
  </name>
  <command>
--T %LOGDIR/test%TESTNUMBER.txt tftp://%HOSTIP:%TFTPPORT//
+-T %LOGDIR/test%TESTNUMBER.txt tftp://%HOSTIP:%TFTPPORT// --connect-time 549
 </command>
 <file name="%LOGDIR/test%TESTNUMBER.txt">
 a chunk of
@@ -40,7 +40,7 @@ opcode = 2
 mode = octet
 tsize = 32
 blksize = 512
-timeout = 6
+timeout = 10
 filename = /test%TESTNUMBER.txt
 </protocol>
 </verify>
index 4ba0bcdeb6f15b247d4295d3c1462062872e590e..d51ec106220cb4262a636ae395b465aa140a7c0d 100644 (file)
@@ -83,12 +83,14 @@ condition in the TFTP transmit code.
 123456789ABCDEF
 123456789ABCDEF
 </upload>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 2
 mode = octet
 tsize = 512
 blksize = 512
-timeout = 6
 filename = /test%TESTNUMBER.txt
 </protocol>
 </verify>
index d2bd8bb6e66426a053a57e750dbda8cd75bb9b72..54763eda0e56d07f6bbe5a2998f52ce34f5befc0 100644 (file)
@@ -33,12 +33,14 @@ tftp://%HOSTIP:%TFTPPORT//%TESTNUMBER --tftp-blksize 400
 #
 # Verify pseudo protocol after the test has been "shot"
 <verify>
+<strip>
+^timeout = [5-6]$
+</strip>
 <protocol>
 opcode = 1
 mode = octet
 tsize = 0
 blksize = 400
-timeout = 6
 filename = /%TESTNUMBER
 </protocol>
 </verify>