]> granicus.if.org Git - curl/commitdiff
Updated the test harness to check for protocol support before running each
authorDan Fandrich <dan@coneharvesters.com>
Fri, 9 Mar 2007 21:01:39 +0000 (21:01 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Fri, 9 Mar 2007 21:01:39 +0000 (21:01 +0000)
test, fixing KNOWN_BUGS #11.  Fixed some tests to more accurately specify
their required servers and features.

20 files changed:
CHANGES
docs/KNOWN_BUGS
tests/FILEFORMAT
tests/data/test19
tests/data/test20
tests/data/test200
tests/data/test201
tests/data/test202
tests/data/test203
tests/data/test204
tests/data/test205
tests/data/test208
tests/data/test212
tests/data/test501
tests/data/test504
tests/data/test75
tests/data/test76
tests/data/test79
tests/data/test87
tests/runtests.pl

diff --git a/CHANGES b/CHANGES
index b0240bcdcdcef69fadf7ef7055e8588a7942a547..f47d35b3bc78babdf5f2cb7b85f23527f2329e24 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,10 @@
 
                                   Changelog
 
+Dan F (9 March 2007)
+- Updated the test harness to check for protocol support before running each
+  test, fixing KNOWN_BUGS #11.
+
 Dan F (7 March 2007)
 - Reintroduced (after a 3 year hiatus) an FTPS test case (400) into the test
   harness.  It is very limited as it supports only ftps:// URLs with
index ae5fbd716ff2832d40488e2220ab12223826d83c..74bf092f8b98ab036dee49285b92a726e528f396 100644 (file)
@@ -106,9 +106,6 @@ may have been fixed since this was written!
   acknowledged after the actual TCP connect (during the SOCKS "negotiate"
   phase).
 
-11. Using configure --disable-[protocol] may cause 'make test' to fail for
-  tests using the disabled protocol(s).
-
 10. To get HTTP Negotiate authentication to work fine, you need to provide a
   (fake) user name (this concerns both curl and the lib) because the code
   wrongly only considers authentication if there's a user name provided.
index f1c80305834202973bdeb2190c923d443e4ea384..398915a706769ebb0674369519afe4cf74ffaaf6 100644 (file)
@@ -117,7 +117,17 @@ pipe: [num] -   tell the server to expect this many HTTP requests before
 
 <server>
 What server(s) this test case requires/uses:
-'http' 'ftp', 'https', 'ftps', 'http-ipv6'. Give only one per line.
+
+file
+ftp
+ftp-ipv6
+ftps
+http
+http-ipv6
+https
+none
+
+Give only one per line.  This subsection is mandatory.
 </server>
 
 <features>
@@ -134,6 +144,10 @@ libz
 netrc_debug
 OpenSSL
 SSL
+
+as well as each protocol that curl supports.  A protocol only needs to be
+specified if it is different from the server (useful when the server
+is 'none').
 </features>
 
 <killserver>
index aba75d3ec0a5e58437ec5c979a850718788916c8..dd60b8cf3a96a361f6b33ea8d6232ba213960a67 100644 (file)
@@ -17,6 +17,9 @@ FAILURE
 <server>
 none
 </server>
+<features>
+http
+</features>
  <name>
 attempt connect to non-listening socket
  </name>
index cd1536060bd08ddd1ab93f0304da8a3aea5d1277..d3bf305097f1b08288aa1feba568ba69eda6669d 100644 (file)
@@ -16,6 +16,9 @@ FAILURE
 <server>
 none
 </server>
+<features>
+http
+</features>
  <name>
 attempt connect to non-existing host name
  </name>
index 7b5ec41ffd4e9e43e17ea152599692d5949c3307..23ac26afc980a62d7cfe50944aa545025adbeaea 100644 (file)
@@ -13,7 +13,7 @@ moo
 # Client-side
 <client>
 <server>
-none
+file
 </server>
  <name>
 basic file:// file
index e8ddb7fae8ef468d704046cf9add7d64330668bf..eb2422418575aaf70036c168ba584271b0670170 100644 (file)
@@ -8,7 +8,7 @@
 # Client-side
 <client>
 <server>
-none
+file
 </server>
  <name>
 missing file:// file
index 5b578cbab61045e72bf414153343fa6f19ee0f82..4344d64c8ac68059f6aa3a97271d87673f550a10 100644 (file)
@@ -8,7 +8,7 @@
 # Client-side
 <client>
 <server>
-none
+file
 </server>
  <name>
 two file:// URLs to stdout
index c1c04209b7b86c072a08f7e5c424d637ccfca249..c7cdce56e75539a89ee5828501c225b27a53cfae 100644 (file)
@@ -13,7 +13,7 @@ moo
 # Client-side
 <client>
 <server>
-none
+file
 </server>
  <name>
 file:/path URL with a single slash
index cb21c6d38363010ec7629a9b144f87b33f9208f5..c4e219e983e4859028237bdf6dd737a2fc027ba7 100644 (file)
@@ -4,7 +4,7 @@
 # Client-side
 <client>
 <server>
-none
+file
 </server>
  <name>
 "upload" with file://
index 7bef1a8687b331a2393c48dc62face9560426502..edcf7fecec09e6a340f5dc7300e26bf45fcc288f 100644 (file)
@@ -4,7 +4,7 @@
 # Client-side
 <client>
 <server>
-none
+file
 </server>
  <name>
 "upload" with file://
index 97eacbc458bb9c7ed81f9ca800e31f008b1c613a..eac3d5572c3790ec3251a9b3c33277612494b488 100644 (file)
@@ -16,6 +16,9 @@ blablabla
 <server>
 http
 </server>
+<features>
+ftp
+</features>
  <name>
 HTTP PUT a to a FTP URL with username+password - over HTTP proxy
  </name>
index d745011d6279cf6759433d59d28f09d998eb0e12..655a32f38f9247e7bd652a9d8e318adad48fe4df 100644 (file)
@@ -12,7 +12,7 @@ data blobb
 ipv6
 </features>
 <server>
-ftp
+ftp-ipv6
 </server>
  <name>
 Get two FTP files with no remote EPRT support
index f8a8591572b0f059aa241b26988a3e3f01049217..99cd3b8f772e062e6f7324ec294f43294599a0e3 100644 (file)
@@ -7,8 +7,11 @@
 # Client-side
 <client>
 <server>
-file
+none
 </server>
+<features>
+http
+</features>
 # tool is what to use instead of 'curl'
 <tool>
 lib501
index 488fb5c7747d27e59f6ff2a384b967eaf0bcca55..dadd64a14d0ad6a450f109603849a5868531e68e 100644 (file)
@@ -8,6 +8,9 @@
 <server>
 none
 </server>
+<features>
+http
+</features>
 # tool is what to use instead of 'curl'
 <tool>
 lib504
index 25440f5135f732aaced244d068333ad1e2b778b1..779f0d883b96714a8438c6fdb0f959fe6d9a3e74 100644 (file)
@@ -17,6 +17,9 @@ FAILURE
 <server>
 none
 </server>
+<features>
+http
+</features>
  <name>
 HTTP, urlglob retrieval with bad range
  </name>
index d4094038b5da183c0c5bfc8e59ceb601c4c27978..ada3a33595621e589302f23cca36b46e1d82eeb2 100644 (file)
@@ -15,6 +15,9 @@ FAILURE
 <server>
 none
 </server>
+<features>
+http
+</features>
  <name>
 HTTP, -O with no file name part in the URL
  </name>
index 382eddde7f75b4bed86fa2e7a8ace699a32a51b3..db97635e0bb15585257d5be2dbc06c4d44825ff2 100644 (file)
@@ -27,6 +27,9 @@ contents
 <server>
 http
 </server>
+<features>
+ftp
+</features>
  <name>
 FTP over HTTP proxy
  </name>
index 77316569016e55edb75361fe3bf5aeedb8c1806b..40b274b2ef0f5c30110886e8b6e0c07aecb3071e 100644 (file)
@@ -15,6 +15,9 @@ FAILURE
 <server>
 none
 </server>
+<features>
+http
+</features>
  <name>
 urlglob with bad -o #[num] usage
  </name>
index aeff8b4fa5df98c39565f2d013dcea2e0245472c..5fb45b1719ba0a9045933cd0ca7106bf953f0bd4 100755 (executable)
@@ -146,6 +146,7 @@ my $has_gnutls;  # set if libcurl is built with GnuTLS
 my $has_nss;     # set if libcurl is built with NSS
 my $has_textaware; # set if running on a system that has a text mode concept
   # on files. Windows for example
+my @protocols;   # array of supported protocols
 
 my $skipped=0;  # number of tests skipped; reported in main loop
 my %skipped;    # skipped{reason}=counter, reasons for skip
@@ -1021,8 +1022,16 @@ sub checksystem {
            }
         }
         elsif($_ =~ /^Protocols: (.*)/i) {
-            # these are the supported protocols, we don't use this knowledge
-            # at this point
+            # these are the protocols compiled in to this libcurl
+            @protocols = split(' ', $1);
+
+            # Generate a "proto-ipv6" version of each protocol to match the
+            # IPv6 <server> name. This works even if IPv6 support isn't
+            # compiled in because the <features> test will fail.
+            push @protocols, map($_ . "-ipv6", @protocols);
+
+            # 'none' is used in test cases to mean no server
+            push @protocols, ('none');
         }
         elsif($_ =~ /^Features: (.*)/i) {
             $feat = $1;
@@ -1283,6 +1292,10 @@ sub singletest {
                 next;
             }
         }
+        # See if this "feature" is in the list of supported protocols
+        elsif (grep /^$f$/, @protocols) {
+            next;
+        }
 
         $why = "curl lacks $f support";
         last;
@@ -2065,6 +2078,12 @@ sub serverfortest {
         return "no server specified";
     }
 
+    my $proto = lc($what[0]);
+    chomp $proto;
+    if (! grep /^$proto$/, @protocols) {
+        return "curl lacks $proto support";
+    }
+
     return &startservers(@what);
 }