]> granicus.if.org Git - curl/commitdiff
Made test case 241 precheck that the given name resolves to an ipv6 address,
authorDaniel Stenberg <daniel@haxx.se>
Tue, 17 May 2005 10:27:11 +0000 (10:27 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 17 May 2005 10:27:11 +0000 (10:27 +0000)
or the test is skipped. Ideally, we should let this test case go over a few
frequently used IPv6 localhost aliases...

tests/data/test241
tests/runtests.pl
tests/server/resolve.c

index e1a1ebba25fdb34d086694a0084bbd66a88465c8..161c6263fc07b4622e676aab06bd21bbdf25b3c2 100644 (file)
@@ -26,6 +26,9 @@ HTTP-IPv6 GET (using ip6-localhost)
  <command>
 -g "http://ip6-localhost:%HTTP6PORT/241"
 </command>
+<precheck>
+./server/resolve --ipv6 ip6-localhost
+</precheck>
 </client>
 
 #
index eec07406f2d0ea078bb12a38a865743360ff91a1..0ba5d8bc1ceaef2a672b97f12950287a8a86a969 100755 (executable)
@@ -1058,6 +1058,7 @@ sub singletest {
                 chomp $why;
             }
         }
+        print "prechecked $cmd\n" if($verbose);
     }
 
     if($why) {
index e1b75e3598f54d8d9f957d5fee2b10918705620a..84b369e6becc49e5fc1268b07b207115037c8e3c 100644 (file)
@@ -125,8 +125,8 @@ int main(int argc, char *argv[])
 
     he = gethostbyname(host);
 
-    printf("Resolve '%s' %s\n",
-           host, he?"SUCCESSFUL":"FAILED");
+    if(!he)
+      printf("Resolving '%s' FAILED\n", host);
 
     return he?0:1;
   }
@@ -143,8 +143,9 @@ int main(int argc, char *argv[])
     hints.ai_flags = AI_CANONNAME;
     rc = (getaddrinfo)(host, "80", &hints, &ai);
 
-    printf("Resolve '%s' %s\n",
-           host, !rc?"SUCCESSFUL":"FAILED");
+    if(rc)
+      printf("Resolving '%s' FAILED\n", host);
+
     return !rc?0:1;
   }
 #endif