runtests: add `-m=seconds` to override test curl command timeout
No binary (build failed)
—
(log yok)
| @@ -180,6 +180,10 @@ regression test suite. | |
| Lists all test case names. | |
| + | ## `-m=[seconds]` |
| + | |
| + | Set timeout for curl commands in tests |
| + | |
| ## `-n` | |
| Disable the check for and use of valgrind. | |
| @@ -59,6 +59,7 @@ $_ = '' if /CURLOPT_HTTP_VERSION/ | |
| $_ = '' if /CURLOPT_SSLVERSION/ | |
| $_ = '' if /CURLOPT_HTTP09_ALLOWED/ | |
| $_ = '' if /CURLOPT_INTERLEAVEDATA/ | |
| + | $_ = '' if /CURLOPT_TIMEOUT_MS/ |
| </stripfile> | |
| <file name="%LOGDIR/test%TESTNUMBER.c" mode="text"> | |
| /********* Sample code generated by the curl command line tool ********** | |
| @@ -68,6 +68,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ | |
| $_ = '' if /CURLOPT_HTTP_VERSION/ | |
| $_ = '' if /CURLOPT_INTERLEAVEDATA/ | |
| $_ = '' if /CURLOPT_SSLVERSION/ | |
| + | $_ = '' if /CURLOPT_TIMEOUT_MS/ |
| </stripfile> | |
| <file name="%LOGDIR/test%TESTNUMBER.c" mode="text"> | |
| /********* Sample code generated by the curl command line tool ********** | |
| @@ -62,6 +62,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ | |
| $_ = '' if /CURLOPT_HTTP_VERSION/ | |
| $_ = '' if /CURLOPT_INTERLEAVEDATA/ | |
| $_ = '' if /CURLOPT_SSLVERSION/ | |
| + | $_ = '' if /CURLOPT_TIMEOUT_MS/ |
| </stripfile> | |
| <file name="%LOGDIR/test%TESTNUMBER.c" mode="text"> | |
| /********* Sample code generated by the curl command line tool ********** | |
| @@ -59,6 +59,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ | |
| $_ = '' if /CURLOPT_HTTP_VERSION/ | |
| $_ = '' if /CURLOPT_INTERLEAVEDATA/ | |
| $_ = '' if /CURLOPT_SSLVERSION/ | |
| + | $_ = '' if /CURLOPT_TIMEOUT_MS/ |
| </stripfile> | |
| <file name="%LOGDIR/test%TESTNUMBER.c" mode="text"> | |
| /********* Sample code generated by the curl command line tool ********** | |
| @@ -104,6 +104,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ | |
| $_ = '' if /CURLOPT_HTTP_VERSION/ | |
| $_ = '' if /CURLOPT_INTERLEAVEDATA/ | |
| $_ = '' if /CURLOPT_SSLVERSION/ | |
| + | $_ = '' if /CURLOPT_TIMEOUT_MS/ |
| # CURL_DOES_CONVERSION generates an extra comment. | |
| $_ = '' if /\/\* "value" \*\// | |
| </stripfile> | |
| @@ -144,6 +144,7 @@ $_ = '' if /CURLOPT_HTTP_VERSION/ | |
| $_ = '' if /CURLOPT_HTTP09_ALLOWED/ | |
| $_ = '' if /CURLOPT_INTERLEAVEDATA/ | |
| $_ = '' if /CURLOPT_SSLVERSION/ | |
| + | $_ = '' if /CURLOPT_TIMEOUT_MS/ |
| </stripfile> | |
| </verify> | |
| </testcase> | |
| @@ -131,6 +131,7 @@ $_ = '' if /CURLOPT_HTTP_VERSION/ | |
| $_ = '' if /CURLOPT_HTTP09_ALLOWED/ | |
| $_ = '' if /CURLOPT_INTERLEAVEDATA/ | |
| $_ = '' if /CURLOPT_SSLVERSION/ | |
| + | $_ = '' if /CURLOPT_TIMEOUT_MS/ |
| </stripfile> | |
| </verify> | |
| </testcase> | |
| @@ -109,6 +109,7 @@ $_ = '' if /CURLOPT_HTTP_VERSION/ | |
| $_ = '' if /CURLOPT_HTTP09_ALLOWED/ | |
| $_ = '' if /CURLOPT_INTERLEAVEDATA/ | |
| $_ = '' if /CURLOPT_SSLVERSION/ | |
| + | $_ = '' if /CURLOPT_TIMEOUT_MS/ |
| </stripfile> | |
| </verify> | |
| </testcase> | |
| @@ -113,6 +113,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ | |
| $_ = '' if /CURLOPT_HTTP_VERSION/ | |
| $_ = '' if /CURLOPT_INTERLEAVEDATA/ | |
| $_ = '' if /CURLOPT_SSLVERSION/ | |
| + | $_ = '' if /CURLOPT_TIMEOUT_MS/ |
| </stripfile> | |
| </verify> | |
| </testcase> | |
| @@ -65,6 +65,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ | |
| $_ = '' if /CURLOPT_HTTP_VERSION/ | |
| $_ = '' if /CURLOPT_INTERLEAVEDATA/ | |
| $_ = '' if /CURLOPT_SSLVERSION/ | |
| + | $_ = '' if /CURLOPT_TIMEOUT_MS/ |
| </stripfile> | |
| <file name="%LOGDIR/test%TESTNUMBER.c" mode="text"> | |
| /********* Sample code generated by the curl command line tool ********** | |
| @@ -61,6 +61,7 @@ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ | |
| $_ = '' if /CURLOPT_HTTP_VERSION/ | |
| $_ = '' if /CURLOPT_HTTP09_ALLOWED/ | |
| $_ = '' if /CURLOPT_INTERLEAVEDATA/ | |
| + | $_ = '' if /CURLOPT_TIMEOUT_MS/ |
| </stripfile> | |
| <file name="%LOGDIR/test%TESTNUMBER.c" mode="text"> | |
| /********* Sample code generated by the curl command line tool ********** | |
| @@ -16,7 +16,7 @@ tftp | |
| TFTP send | |
| </name> | |
| <command> | |
| - | -T %LOGDIR/test%TESTNUMBER.txt tftp://%HOSTIP:%TFTPPORT// --connect-timeout 549 |
| + | -T %LOGDIR/test%TESTNUMBER.txt tftp://%HOSTIP:%TFTPPORT// --connect-timeout 549 --max-time 599 |
| </command> | |
| <file name="%LOGDIR/test%TESTNUMBER.txt"> | |
| a chunk of | |
| @@ -49,6 +49,7 @@ BEGIN { | |
| $buildinfo | |
| $LOCKDIR | |
| $LOGDIR | |
| + | $maxtime |
| $memanalyze | |
| $MEMDUMP | |
| $perlcmd | |
| @@ -103,6 +104,7 @@ our $anyway; # continue anyway, even if a test fail | |
| our $CURLVERSION=""; # curl's reported version number | |
| our $CURLVERNUM=""; # curl's reported version number (without -DEV) | |
| our $randseed = 0; # random number seed | |
| + | our $maxtime; # curl command timeout override |
| # paths | |
| our $pwd = getcwd(); # current working directory | |
| @@ -972,6 +972,9 @@ sub singletest_run { | |
| if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-q/)) { | |
| $CMDLINE .= " -q"; | |
| } | |
| + | if($maxtime) { |
| + | $CMDLINE .= " --max-time $maxtime"; |
| + | } |
| } | |
| if(use_valgrind() && !$disablevalgrind) { | |
| @@ -2421,6 +2421,10 @@ while(@ARGV) { | |
| $short=1; | |
| $automakestyle=1; | |
| } | |
| + | elsif($ARGV[0] =~ /-m=(\d+)/) { |
| + | my ($num)=($1); |
| + | $maxtime=$num; |
| + | } |
| elsif($ARGV[0] eq "-n") { | |
| # no valgrind | |
| undef $valgrind; | |
| @@ -2563,6 +2567,7 @@ Usage: runtests.pl [options] [test selection(s)] | |
| -k keep stdout and stderr files present after tests | |
| -L path require an additional perl library file to replace certain functions | |
| -l list all test case names/descriptions | |
| + | -m=[seconds] set timeout for curl commands in tests |
| -n no valgrind | |
| --no-debuginfod disable the valgrind debuginfod functionality | |
| -o variable=value set internal variable to the specified value | |