]> granicus.if.org Git - curl/commitdiff
tests: make test file names more unique
authorDan Fandrich <dan@coneharvesters.com>
Tue, 9 May 2017 17:49:17 +0000 (19:49 +0200)
committerDan Fandrich <dan@coneharvesters.com>
Tue, 9 May 2017 19:52:05 +0000 (21:52 +0200)
Include the test number in the names of files written out by tests to
reduce the chance of accidental duplication and to make it more clear
which test is associated with which file.

13 files changed:
tests/data/test1104
tests/data/test1900
tests/data/test1901
tests/data/test1902
tests/data/test1903
tests/data/test216
tests/data/test256
tests/data/test38
tests/data/test569
tests/data/test571
tests/data/test87
tests/libtest/lib1900.c
tests/server/fake_ntlm.c

index 21efe3c15e1da4d55738e82b392d0aea8713eebd..102d52282003a321d0b8ec4ba386797c8032a90d 100644 (file)
@@ -59,7 +59,7 @@ http
 HTTP cookie expiry date at Jan 1 00:00:00 GMT 1970
  </name>
  <command>
-http://%HOSTIP:%HTTPPORT/want/1104 -L -x %HOSTIP:%HTTPPORT -c log/cookies.jar
+http://%HOSTIP:%HTTPPORT/want/1104 -L -x %HOSTIP:%HTTPPORT -c log/cookies1104.jar
 </command>
 </client>
 
index 04c59a826f768668a1133bd48793c0d862ed9704..2e3c93a0d45a0227c1b210616432c025fae38998 100644 (file)
@@ -42,9 +42,9 @@ lib1900
 HTTP GET using pipelining
  </name>
  <command>
-http://%HOSTIP:%HTTPPIPEPORT/
+http://%HOSTIP:%HTTPPIPEPORT/ log/urls1900.txt
 </command>
-<file name="log/urls.txt">
+<file name="log/urls1900.txt">
 0 1k.txt
 1000 100k.txt
 0 1k.txt
index 17c04d14e3591fce53264bb1b1565ae5421ae288..83cdf729012444d9a88595128139cb0e238afda3 100644 (file)
@@ -43,9 +43,9 @@ lib1900
 HTTP GET using pipelining, blacklisted site
  </name>
  <command>
-http://%HOSTIP:%HTTPPIPEPORT/
+http://%HOSTIP:%HTTPPIPEPORT/ log/urls1901.txt
 </command>
-<file name="log/urls.txt">
+<file name="log/urls1901.txt">
 blacklist_site 127.0.0.1:%HTTPPIPEPORT
 0 1k.txt
 1000 100k.txt
index 533ed55a8f0483c03277126052da6fad3d9ba588..3c999316bd8a0a89b5421dbed8dfde4560755028 100644 (file)
@@ -43,9 +43,9 @@ lib1900
 HTTP GET using pipelining, broken pipe
  </name>
  <command>
-http://%HOSTIP:%HTTPPIPEPORT/
+http://%HOSTIP:%HTTPPIPEPORT/ log/urls1902.txt
 </command>
-<file name="log/urls.txt">
+<file name="log/urls1902.txt">
 0 1k.txt
 1000 connection_close.txt
 1 1k.txt
index c72561838dec68265274bfea3a324c5b507e37cc..219ffe11c40985a237a9283b724b472cd1972f81 100644 (file)
@@ -43,9 +43,9 @@ lib1900
 HTTP GET using pipelining, penalized on content-length
  </name>
  <command>
-http://%HOSTIP:%HTTPPIPEPORT/
+http://%HOSTIP:%HTTPPIPEPORT/ log/urls1903.txt
 </command>
-<file name="log/urls.txt">
+<file name="log/urls1903.txt">
 0 1k.txt
 1000 100k.txt
 550 alphabet.txt
index 0c4de0a6308792da2dd676e29e30adb1524f6e03..404e9c98a3108bf1c0e983e49205ca22dcc37e32 100644 (file)
@@ -18,7 +18,7 @@ ftp
 FTP upload two files to the same dir
  </name>
  <command>
--T log/upload.216 ftp://%HOSTIP:%FTPPORT/a/path/216/ -T log/upload.216 ftp://%HOSTIP:%FTPPORT/a/path/216/%2e%2eanotherup
+-T log/upload.216 ftp://%HOSTIP:%FTPPORT/a/path/216/ -T log/upload.216 ftp://%HOSTIP:%FTPPORT/a/path/216/%2e%2eanotherup.216
 </command>
 <file name="log/upload.216">
 upload this file twice
@@ -38,7 +38,7 @@ EPSV
 TYPE I\r
 STOR upload.216\r
 EPSV\r
-STOR ..anotherup\r
+STOR ..anotherup.216\r
 QUIT\r
 </protocol>
 </verify>
index 2b96ecf3d6c06731b8b1212defaa666d94838074..17ae807d14a0592eafdd9046d7c6609158a423bf 100644 (file)
@@ -29,9 +29,9 @@ http
 HTTP resume request over proxy with auth without server supporting it
  </name>
  <command option="no-output">
--x http://%HOSTIP:%HTTPPORT http://%HOSTIP:%HTTPPORT/want/256 -C - --no-include -o log/fewl.txt -U daniel:stenberg
+-x http://%HOSTIP:%HTTPPORT http://%HOSTIP:%HTTPPORT/want/256 -C - --no-include -o log/fewl256.txt -U daniel:stenberg
 </command>
-<file name="log/fewl.txt">
+<file name="log/fewl256.txt">
 This text is here to simulate a partly downloaded file to resume
 download on.
 </file>
@@ -56,7 +56,7 @@ Proxy-Connection: Keep-Alive
 </protocol>
 
 # the download target file must remain untouched
-<file name="log/fewl.txt">
+<file name="log/fewl256.txt">
 This text is here to simulate a partly downloaded file to resume
 download on.
 </file>
index 848150a33dff391b46b53337e49f0861d12a012b..db257f2f8614a58d21be070a74e8e8fe2cb9f4a3 100644 (file)
@@ -28,9 +28,9 @@ http
 HTTP resume request without server supporting it
  </name>
  <command option="no-output">
-http://%HOSTIP:%HTTPPORT/want/38 -C - --no-include -o log/fewl.txt
+http://%HOSTIP:%HTTPPORT/want/38 -C - --no-include -o log/fewl38.txt
 </command>
-<file name="log/fewl.txt">
+<file name="log/fewl38.txt">
 This text is here to simulate a partly downloaded file to resume
 download on.
 </file>
@@ -53,7 +53,7 @@ Accept: */*
 </protocol>
 
 # the download target file must remain untouched
-<file name="log/fewl.txt">
+<file name="log/fewl38.txt">
 This text is here to simulate a partly downloaded file to resume
 download on.
 </file>
index c4c62a4c381da7e417155725b087732d1b433447..ea6cd0bb0622a375a58cb27b6dd8a16a35517deb 100644 (file)
@@ -66,7 +66,7 @@ lib569
 RTSP Session ID parsing
 </name>
 <command>
-rtsp://%HOSTIP:%RTSPPORT/569 log/idfile.txt
+rtsp://%HOSTIP:%RTSPPORT/569 log/idfile569.txt
 </command>
 </client>
 
@@ -100,7 +100,7 @@ CSeq: 6
 Session: A\r
 \r
 </protocol>
-<file name="log/idfile.txt">
+<file name="log/idfile569.txt">
 Got Session ID: [00.+1-am-aSe55ion_id\$yes-i-am\$]
 Got Session ID: [\$extraspaces]
 Got Session ID: [A]
index 5e138cdf98bca689cd92fc64dc70f50d935450d9..494ac416b76b0061aca4bebad585c314077478dd 100644 (file)
@@ -78,7 +78,7 @@ lib571
 RTSP RTP Interleaving Test
 </name>
 <command>
-rtsp://%HOSTIP:%RTSPPORT/571 log/protofile.txt
+rtsp://%HOSTIP:%RTSPPORT/571 log/protofile571.txt
 </command>
 </client>
 
@@ -99,7 +99,7 @@ RTP: message size 85, channel 0
 RTP: message size 24, channel 1
 </stdout>
 
-<file name="log/protofile.txt">
+<file name="log/protofile571.txt">
 $99
 </file>
 </verify>
index 5e6aef30621490680f36d57467d92494b1dd95ff..ee5be78cb5ff07d49fd758399358518abdfdd908 100644 (file)
@@ -40,7 +40,7 @@ http
 urlglob with out of range -o #[num] usage
  </name>
  <command option="no-output">
-"http://%HOSTIP:%HTTPPORT/[870001-870002]" -o "log/dumpit#2.dump"
+"http://%HOSTIP:%HTTPPORT/[870001-870002]" -o "log/dumpit87-#2.dump"
 </command>
 </client>
 
@@ -50,7 +50,7 @@ urlglob with out of range -o #[num] usage
 # survives
 #
 <verify>
-<file name="log/dumpit#2.dump">
+<file name="log/dumpit87-#2.dump">
 HTTP/1.1 200 OK\r
 Funny-head: yesyes\r
 Content-Length: 16\r
index d72e3e6a2d96d614e796e99fffc75dce47921683..42c0ef1dd2eafe279c258b76ff0ad6bdcab6acb3 100644 (file)
@@ -142,7 +142,7 @@ int test(char *URL)
   int handlenum = 0;
   struct timeval last_handle_add;
 
-  if(parse_url_file("log/urls.txt") <= 0)
+  if(parse_url_file(libtest_arg2) <= 0)
     goto test_cleanup;
 
   start_test_timing();
index b5f375e468570b39e07988fbb2544b0a3116dfc7..0d1b3e1b66ac0fef6dc4e54503b77c5cae39f0ba 100644 (file)
 /* include memdebug.h last */
 #include "memdebug.h"
 
-#ifndef DEFAULT_LOGFILE
-#define DEFAULT_LOGFILE "log/fake_ntlm.log"
-#endif
+#define LOGFILE "log/fake_ntlm%d.log"
 
-const char *serverlogfile = DEFAULT_LOGFILE;
+const char *serverlogfile;
 
 /*
  * Returns an allocated buffer with printable representation of input
@@ -111,6 +109,7 @@ static char *printable(char *inbuf, size_t inlength)
 int main(int argc, char *argv[])
 {
   char buf[1024];
+  char logfilename[256];
   FILE *stream;
   char *filename;
   int error;
@@ -158,25 +157,29 @@ int main(int argc, char *argv[])
     }
   }
 
-  logmsg("fake_ntlm (user: %s) (proto: %s) (domain: %s) (cached creds: %s)",
-         helper_user, helper_proto, helper_domain,
-         (use_cached_creds) ? "yes" : "no");
-
   env = getenv("CURL_NTLM_AUTH_TESTNUM");
   if(env) {
     char *endptr;
     long lnum = strtol(env, &endptr, 10);
     if((endptr != env + strlen(env)) || (lnum < 1L)) {
-      logmsg("Test number not valid in CURL_NTLM_AUTH_TESTNUM");
+      fprintf(stderr, "Test number not valid in CURL_NTLM_AUTH_TESTNUM");
       exit(1);
     }
     testnum = lnum;
   }
   else {
-    logmsg("Test number not specified in CURL_NTLM_AUTH_TESTNUM");
+    fprintf(stderr, "Test number not specified in CURL_NTLM_AUTH_TESTNUM");
     exit(1);
   }
 
+  /* logmsg cannot be used until this file name is set */
+  snprintf(logfilename, sizeof(logfilename), LOGFILE, testnum);
+  serverlogfile = logfilename;
+
+  logmsg("fake_ntlm (user: %s) (proto: %s) (domain: %s) (cached creds: %s)",
+         helper_user, helper_proto, helper_domain,
+         (use_cached_creds) ? "yes" : "no");
+
   env = getenv("CURL_NTLM_AUTH_SRCDIR");
   if(env) {
     path = env;
@@ -276,5 +279,6 @@ int main(int argc, char *argv[])
       exit(1);
     }
   }
+  logmsg("Exit");
   return 1;
 }