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
This commit is contained in:
Dan Fandrich 2023-06-14 14:19:26 -07:00
parent 355f4144df
commit 72c5bb14e7
16 changed files with 47 additions and 20 deletions

View 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">

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

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

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

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

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

View 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

View 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
Host: %HOSTIP:%HTTPPORT
@ -89,7 +92,6 @@ opcode = 1
mode = octet
tsize = 0
blksize = 512
timeout = 6
filename = /%TESTNUMBER0003
QUIT
</protocol>

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

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

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

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

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

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

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

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