Lines Matching +full:protocol +full:- +full:tests
22 # SPDX-License-Identifier: curl
28 # Experimental hooks are available to run tests remotely on machines that
32 # $HOSTIP, $HOST6IP - Set to the address of the host running the test suite
33 # $CLIENTIP, $CLIENT6IP - Set to the address of the host running curl
34 # runclient, runclientoutput - Modify to copy all the files in the log/
44 # the contents of the tests/server/ directory must be from the host
47 # Note that even with these changes a number of tests will still fail (mainly
53 # Finally, to properly support -g and -n, checktestcmd needs to change
56 # fixed. As long as the -g option is never given, and the -n is always
68 # Define srcdir to the location of the tests source directory. This is
69 # usually set by the Makefile, but for out-of-tree builds with direct
109 my $CURLCONFIG="../curl-config"; # curl-config from current build
126 my $args; # command-line arguments
128 my $uname_release = `uname -r`;
139 my %disabled_keywords; # key words of tests to skip
140 my %ignored_keywords; # key words of tests to ignore results
141 my %enabled_keywords; # key words of tests to run
146 my $passedign; # tests passed with results ignored
173 my %runnersrunning; # tests currently running by runner ID
180 my $keepoutfiles; # keep stdout and stderr files after tests
182 my $postmortem; # display detailed info about failed tests
183 my $run_disabled; # run the specific tests even if listed in DISABLED
225 # which prevents messages from different tests from being interleaved.
288 foreach my $protocol (('ftp', 'http', 'ftps', 'https', 'no', 'all')) {
289 my $proxy = "${protocol}_proxy";
321 my $cmd = "\"$ENV{'NGHTTPX'}\" -v 2>$dev_null";
329 # Get the list of tests that the tests/data/Makefile.am knows about!
333 # If a non-default $TESTDIR is being used there may not be any
363 if(-d "$dir/$file") {
390 my $file1="$logdir/check-generated";
391 my $file2="$logdir/check-expected";
398 $l =~ s/([^\x20-\x7f])/sprintf "%%%02x", ord $1/eg;
409 $l =~ s/([^\x20-\x7f])/sprintf "%%%02x", ord $1/eg;
414 my @out = `diff -u $file2 $file1 2>$dev_null`;
417 @out = `diff -c $file2 $file1 2>$dev_null`;
447 logmsg "FAIL: $testnum - $testname - $subject\n";
454 # Numeric-sort words in a string
467 # Generate a "proto-ipv6" version of each protocol to match the
468 # IPv6 <server> name and a "proto-unix" to match the variant which
471 push @protocols, map(("$_-ipv6", "$_-unix"), @protocols);
473 # 'http-proxy' is used in test cases to do CONNECT through
474 push @protocols, 'http-proxy';
498 my $versioncmd=shell_quote($CURL) . " --version 1>$curlverout 2>$curlvererr";
508 $DATE = strftime "%Y-%m-%d", gmtime($current_time);
514 open(my $disabledh, "-|", "server/disabled".exe_ext('TOOL'));
531 $CURLVERNUM =~ s/^([0-9.]+)(.*)/$1/; # leading dots and numbers
541 # Windows-style path.
557 elsif ($libcurl =~ /\srustls-ffi\b/i) {
591 $feature{"c-ares"} = 1;
592 $resolver="c-ares";
613 if ($libcurl =~ /libssh\/([0-9.]*)\//i) {
635 # built with memory tracking support (--enable-curldebug); may be disabled later
637 # curl was built with --enable-debug
663 # GSS-API enabled
664 $feature{"GSS-API"} = $feat =~ /GSS-API/i;
669 # TLS-SRP enabled
670 $feature{"TLS-SRP"} = $feat =~ /TLS-SRP/i;
673 # alt-svc enabled
674 $feature{"alt-svc"} = $feat =~ /alt-svc/i;
678 if(!$feature{"c-ares"}) {
680 $feature{"threaded-resolver"} = 1;
695 $feature{"HTTPS-proxy"} = $feat =~ /HTTPS-proxy/;
696 if($feature{"HTTPS-proxy"}) {
697 # 'https-proxy' is used as "server" so consider it a protocol
698 push @protocols, 'https-proxy';
702 # Thread-safe init
706 # Test harness currently uses a non-stunnel server in order to
707 # run HTTP TLS-SRP tests required when curl is built with https
708 # protocol support and TLS-SRP feature enabled. For convenience
713 if($feature{"TLS-SRP"}) {
716 if($_ =~ /^https(-ipv6|)$/) {
723 push @protocols, 'httptls-ipv6';
732 if ($versretval == -1) {
750 if(-r "../lib/curl_config.h") {
768 my $cmd = "server/sws".exe_ext('SRV')." --version";
776 $cmd = "server/sockfilt".exe_ext('SRV')." --version";
786 my $cmd = "server/sws".exe_ext('SRV')." --version";
791 open(my $manh, "-|", shell_quote($CURL) . " -M 2>&1");
793 if($s =~ /built-in manual was disabled at build-time/) {
804 $feature{"nghttpx-h3"} = !!$nghttpx_h3;
813 $feature{"HTTP-auth"} = 1;
815 $feature{"form-api"} = 1;
819 $feature{"shuffle-dns"} = 1;
821 $feature{"verbose-strings"} = 1;
823 $feature{"headers-api"} = 1;
825 $feature{"large-time"} = 1;
826 $feature{"sha512-256"} = 1;
827 $feature{"local-http"} = servers::localhttp();
828 $feature{"codeset-utf8"} = lc(langinfo(CODESET())) eq "utf-8";
830 # make each protocol an enabled "feature"
836 $has_shared = `sh $CURLCONFIG --built-shared`;
841 die "can't run torture tests since curl was built without ".
842 "TrackMemory feature (--enable-curldebug)";
847 my $hosttype=join(' ', runclientoutput("uname -a"));
868 if($feature{"TrackMemory"} && $feature{"threaded-resolver"}) {
875 $run_event_based?"event-based ":"",
882 $feature{"TrackMemory"} = $feature{"TrackMemory"} && !$feature{"threaded-resolver"};
895 logmsg sprintf("%s", $http_ipv6?"HTTP-IPv6 ":"");
896 logmsg sprintf("%s", $http_unix?"HTTP-unix ":"");
897 logmsg sprintf("%s\n", $ftp_ipv6?"FTP-IPv6 ":"");
1060 logmsg "Warning: test$testnum not present in tests/data/Makefile.am\n";
1178 # Print the test name and count tests
1195 return -1;
1224 # Skip all the verification on torture tests
1228 return -2;
1283 # of the protocol data
1284 chomp($validstdout[-1]);
1295 return -1;
1300 $ok .= "-"; # stdout not checked
1328 # text mode check in hyper-mode. Sometimes necessary if the stderr
1340 # of the protocol data
1341 chomp($validstderr[-1]);
1350 return -1;
1355 $ok .= "-"; # stderr not checked
1358 # what to cut off from the live protocol sent by curl
1361 # what parts to cut off from the protocol & upload
1364 # this is the valid protocol blurb curl should generate
1365 my @protocol= getpart("verify", "protocol");
1366 if(@protocol) {
1370 # check if there's any attributes on the verify/protocol section
1371 my %hash = getpartattr("verify", "protocol");
1375 # of the protocol data
1376 chomp($protocol[-1]);
1383 @protocol= striparray( $_, \@protocol);
1394 subnewlines(1, \$_) for @protocol;
1397 if((!$out[0] || ($out[0] eq "")) && $protocol[0]) {
1398 logmsg "\n $testnum: protocol FAILED!\n".
1403 return -1;
1406 $res = compare($runnerid, $testnum, $testname, "protocol", \@out, \@protocol);
1408 return -1;
1415 $ok .= "-"; # protocol not checked
1433 chomp($replycheckpart[-1]);
1450 chomp($reply[-1]);
1476 return -1;
1481 $ok .= "-"; # data not checked
1490 chomp($upload[-1]);
1512 chomp($upload[-1]);
1517 return -1;
1522 $ok .= "-"; # upload not checked
1525 # this is the valid protocol blurb curl should generate to a proxy
1529 # check if there's any attributes on the verify/protocol section
1534 # of the protocol data
1535 chomp($proxyprot[-1]);
1560 return -1;
1567 $ok .= "-"; # proxy not checked
1600 return -1;
1635 chomp($outfile[-1]);
1641 return -1;
1647 $ok .= ($outputok) ? "o" : "-"; # output checked or not
1656 return -1;
1660 # accept multiple comma-separated error codes
1682 return -1;
1686 if(! -f "$logdir/$MEMDUMP") {
1691 $ok .= "-"; # problem with memory checking
1708 return -1;
1716 $ok .= "-"; # memory not checked
1726 if (-e $fname) {
1735 return -1;
1744 return -1;
1759 return -1;
1764 logmsg "FAIL: $testnum - $testname - valgrind\n";
1772 return -1;
1780 $ok .= "-"; # skipped
1784 $ok .= "-"; # valgrind not checked
1786 # add 'E' for event-based
1787 $ok .= $run_event_based ? "E" : "-";
1803 my $sofar= time()-$start;
1805 my $estleft = $esttotal - $sofar;
1809 my $took = $timevrfyend{$testnum} - $timeprepini{$testnum};
1813 logmsg sprintf("OK (%-3d out of %-3d, %s, took %.3fs, %s)\n",
1819 logmsg "PASS: $testnum - $testname\n";
1857 return (-1, 0);
1872 return (-1, 0);
1902 return (-1, 0);
1911 return (-1, 0);
1915 if($error == -2) {
1929 # Print the test name and count tests
1948 return (-1, 0);
1957 return (-1, 0);
1961 if($error == -1) {
1972 elsif($error == -2) {
2000 if($error == -1) {
2009 elsif($error == -2) {
2036 # runtimestats displays test-suite run time statistics
2063 $timesrvrtot += $timesrvrend{$testnum} - $timesrvrini{$testnum};
2065 (($timetoolini{$testnum} - $timeprepini{$testnum}) -
2066 ($timesrvrend{$testnum} - $timesrvrini{$testnum}));
2067 $timetooltot += $timetoolend{$testnum} - $timetoolini{$testnum};
2068 $timelocktot += $timesrvrlog{$testnum} - $timetoolend{$testnum};
2069 $timevrfytot += $timevrfyend{$testnum} - $timesrvrlog{$testnum};
2070 $timetesttot += $timevrfyend{$testnum} - $timeprepini{$testnum};
2072 $timesrvrend{$testnum} - $timesrvrini{$testnum}, $testnum);
2074 ($timetoolini{$testnum} - $timeprepini{$testnum}) -
2075 ($timesrvrend{$testnum} - $timesrvrini{$testnum}), $testnum);
2077 $timetoolend{$testnum} - $timetoolini{$testnum}, $testnum);
2079 $timesrvrlog{$testnum} - $timetoolend{$testnum}, $testnum);
2081 $timevrfyend{$testnum} - $timesrvrlog{$testnum}, $testnum);
2083 $timevrfyend{$testnum} - $timeprepini{$testnum}, $testnum);
2113 logmsg "-time- test\n";
2114 logmsg "------ ----\n";
2116 last if((not $fullstats) && (not $counter--));
2123 logmsg "-time- test\n";
2124 logmsg "------ ----\n";
2126 last if((not $fullstats) && (not $counter--));
2133 logmsg "-time- test\n";
2134 logmsg "------ ----\n";
2136 last if((not $fullstats) && (not $counter--));
2143 logmsg "-time- test\n";
2144 logmsg "------ ----\n";
2146 last if((not $fullstats) && (not $counter--));
2153 logmsg "-time- test\n";
2154 logmsg "------ ----\n";
2156 last if((not $fullstats) && (not $counter--));
2163 logmsg "-time- test\n";
2164 logmsg "------ ----\n";
2166 last if((not $fullstats) && (not $counter--));
2229 if(@ARGV && $ARGV[-1] eq '$TFLAGS') {
2238 my $fromnum=-1;
2241 if ($ARGV[0] eq "-v") {
2245 elsif ($ARGV[0] eq "-c") {
2250 elsif ($ARGV[0] eq "-vc") {
2254 # the development version as then it won't be able to run any tests
2260 elsif ($ARGV[0] eq "-ac") {
2265 elsif ($ARGV[0] eq "-bundle") {
2269 elsif ($ARGV[0] eq "-d") {
2270 # have the servers display protocol output
2273 elsif($ARGV[0] eq "-e") {
2274 # run the tests cases event based if possible
2277 elsif($ARGV[0] eq "-f") {
2278 # force - run the test case even if listed in DISABLED
2281 elsif($ARGV[0] eq "-E") {
2282 # load additional reasons to skip tests
2303 elsif ($ARGV[0] eq "-g") {
2307 elsif ($ARGV[0] eq "-gl") {
2311 elsif ($ARGV[0] eq "-gw") {
2316 elsif($ARGV[0] eq "-s") {
2320 elsif($ARGV[0] eq "-am") {
2321 # automake-style output
2325 elsif($ARGV[0] eq "-n") {
2329 elsif($ARGV[0] eq "--no-debuginfod") {
2333 elsif ($ARGV[0] eq "-R") {
2337 elsif($ARGV[0] =~ /^-t(.*)/) {
2346 elsif($ARGV[0] =~ /--shallow=(\d+)/) {
2347 # Fail no more than this amount per tests when running
2352 elsif($ARGV[0] =~ /--repeat=(\d+)/) {
2353 # Repeat-run the given tests this many times
2356 elsif($ARGV[0] =~ /--seed=(\d+)/) {
2357 # Set a fixed random seed (used for -R and --shallow)
2360 elsif($ARGV[0] eq "-a") {
2364 elsif($ARGV[0] eq "-o") {
2366 if ($ARGV[0] =~ /^(\w+)=([\w.:\/\[\]-]+)$/) {
2370 die "Failed to parse '-o $ARGV[0]'. May contain unexpected characters.\n";
2373 elsif($ARGV[0] eq "-p") {
2376 elsif($ARGV[0] eq "-P") {
2380 elsif($ARGV[0] eq "-L") {
2385 elsif($ARGV[0] eq "-l") {
2389 elsif($ARGV[0] =~ /^-j(.*)/) {
2397 elsif($ARGV[0] eq "-k") {
2398 # keep stdout and stderr files after tests
2401 elsif($ARGV[0] eq "-r") {
2416 elsif($ARGV[0] eq "-rf") {
2431 elsif($ARGV[0] eq "-rm") {
2435 elsif($ARGV[0] eq "-u") {
2439 elsif(($ARGV[0] eq "-h") || ($ARGV[0] eq "--help")) {
2443 -a continue even if a test fails
2444 -ac path use this curl only to talk to APIs (currently only CI test APIs)
2445 -am automake style output PASS/FAIL: [number] [name]
2446 -bundle use test bundles
2447 -c path use this curl executable
2448 -d display server debug info
2449 -e event-based execution
2450 -E file load the specified file to exclude certain tests
2451 -f forcibly run even if disabled
2452 -g run the test case with gdb
2453 -gw run the test case with gdb as a windowed application
2454 -h this help text
2455 -j[N] spawn this number of processes to run tests (default 0)
2456 -k keep stdout and stderr files present after tests
2457 -L path require an additional perl library file to replace certain functions
2458 -l list all test case names/descriptions
2459 -n no valgrind
2460 --no-debuginfod disable the valgrind debuginfod functionality
2461 -o variable=value set internal variable to the specified value
2462 -P proxy use the specified proxy
2463 -p print log file contents when a test fails
2464 -R scrambled order (uses the random seed, see --seed)
2465 -r run time statistics
2466 -rf full run time statistics
2467 -rm force removal of files by killing locking processes (Windows only)
2468 --repeat=[num] run the given tests this many times
2469 -s short output
2470 --seed=[num] set the random seed to a fixed number
2471 --shallow=[num] randomly makes the torture tests "thinner"
2472 -t[N] torture (simulate function failures); N means fail Nth function
2473 -u error instead of warning on server unexpectedly alive
2474 -v verbose output
2475 -vc path use this curl only to verify the existing servers
2476 [num] like "5 6 9" or " 5 to 22 " to run those tests only
2477 [!num] like "!5 !6 !9" to disable those tests
2478 [~num] like "~5 ~6 ~9" to ignore the result of those tests
2479 [keyword] like "IPv6" to select only tests containing the key word
2480 [!keyword] like "!cookies" to disable any tests containing the key word
2481 [~keyword] like "~cookies" to ignore results of tests containing key word
2492 $fromnum = -1;
2502 $fromnum = -1;
2506 $fromnum = -1;
2515 elsif($ARGV[0] =~ /^([-[{a-zA-Z].*)/) {
2533 open(my $curlvh, "-|", shell_quote($CURL) . " --version 2>$dev_null") ||
2558 # since valgrind 2.1.x, '--tool' option is mandatory
2562 runclient("valgrind --help 2>&1 | grep -- --tool >$dev_null 2>&1");
2570 $valgrind="../libtool --mode=execute $valgrind";
2574 # valgrind 3 renamed the --logfile option to --log-file!!!
2577 my $ver=join(' ', runclientoutput("valgrind --version"));
2579 $ver =~ s/[^0-9.]//g;
2584 $valgrind_logfile="--logfile";
2599 $gdb = "../libtool --mode=execute gdb";
2656 # globally disabled tests
2661 # Fetch all disabled tests, if there are any
2678 # preprocess the input to make conditionally disabled tests depending
2685 if(! -f "$srcdir/data/test$n") {
2686 print STDERR "WARNING! Non-existing test $n in $file!\n";
2705 # If 'all' tests are requested, find out all test numbers
2711 my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
2718 $_ =~ s/[a-z\/\.]*//g;
2735 if (-e "$TESTDIR/test$_") {
2800 $tailskip = $tailtotal - $tailshow;
2803 for($tailskip .. $tailtotal-1) {
2829 if((-d "$logdir/$log") || (! -s "$logdir/$log")) {
2833 next; # skip stdoutNnn of other tests
2836 next; # skip stderrNnn of other tests
2839 next; # skip uploadNnn of other tests
2842 next; # skip curlNnn.out of other tests
2845 next; # skip testNnn.txt of other tests
2848 next; # skip fileNnn.txt of other tests
2851 next; # skip netrcNnn of other tests
2854 next; # skip traceNnn of other tests
2857 next; # skip valgrindNnn of other tests
2869 # Scan tests to find suitable candidates
2884 # scan all tests to find ones we should try to run
2890 # Display test name now--test will be completely skipped later
2914 # The main test-loop
2917 # - if the global abort flag is set, exit the loop; we are done
2918 # - if a runner is idle, start a new test on it
2919 # - if all runners are idle, exit the loop; we are done
2920 # - if a runner has a response for us, process the response
2928 logmsg "Aborting tests\n";
2945 # A runner is ready to run a test, and tests are still available to run
2970 # See if we've completed all the tests
2973 scalar(@runtests) && die 'Internal error: still have tests to run';
2978 # If we could be running more tests, don't wait so we can schedule a new
3012 $total++; # number of tests we've run
3031 logmsg "\n - abort tests\n";
3032 undef @runtests; # empty out the remaining tests
3068 # Once all tests have been scheduled on a runner at the end of a test
3074 logmsg "Hmmm, the tests are taking a while to finish. Here is the status:\n";
3079 my $sofar = time() - $start;
3085 # Tests done, stop the servers
3113 logmsg "TESTDONE: $all tests were considered during ".
3122 logmsg "TESTINFO: $numskipped tests were skipped due to these restraints:\n";
3145 $log_line .= " and ".($c-$max)." more";
3179 testnumdetails("PASSED-IGNORED", $sorted);
3180 logmsg "IGNORED: passed tests: $sorted\n";
3186 testnumdetails("FAIL-IGNORED", $sorted);
3187 logmsg "IGNORED: failed tests: $sorted\n";
3189 logmsg sprintf("TESTDONE: $ok tests out of $total reported OK: %d%%\n",
3200 logmsg "\nTESTFAIL: No tests were performed\n\n";