]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: fix lib tests to run with a dynamic log directory
authorDan Fandrich <dan@coneharvesters.com>
Wed, 29 Mar 2023 15:29:29 +0000 (08:29 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Thu, 30 Mar 2023 16:53:57 +0000 (09:53 -0700)
Ref: #10818

18 files changed:
tests/data/test1903
tests/data/test1905
tests/data/test1908
tests/data/test506
tests/data/test568
tests/data/test572
tests/data/test654
tests/data/test668
tests/data/test676
tests/libtest/lib1903.c
tests/libtest/lib1905.c
tests/libtest/lib1908.c
tests/libtest/lib506.c
tests/libtest/lib568.c
tests/libtest/lib572.c
tests/libtest/lib654.c
tests/libtest/lib668.c
tests/libtest/lib676.c

index 5a4d3e0a500a3b09e1f8a2bb7b8bae7d300fcdf6..ff5a0f29dd7232c4c4c9a4afe7311419fc06495f 100644 (file)
@@ -33,7 +33,7 @@ CURLOPT_COOKIEFILE then reset then set again
 lib%TESTNUMBER
 </tool>
 <command>
-http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER
+http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER %LOGDIR/cookies%TESTNUMBER
 </command>
 <file name="%LOGDIR/cookies%TESTNUMBER" mode="text">
 # Netscape HTTP Cookie File
index cf2498ff939cb7fe3a6f13c765b035e4d8a82161..308dc9a39532a71230396ddbdcfe3a7757462601 100644 (file)
@@ -33,7 +33,7 @@ CURLOPT_COOKIELIST set to "FLUSH" of a shared cookie object
 lib%TESTNUMBER
 </tool>
 <command>
-http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER
+http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER %LOGDIR/cookies%TESTNUMBER
 </command>
 <features>
 cookies
index 69058a20867f002ddf738c462ad064b848872539..4ec55ed2341f85efbdcd24d0ee02e36dcec1e746 100644 (file)
@@ -51,7 +51,7 @@ lib%TESTNUMBER
 </tool>
 
 <command>
-%HOSTIP:%HTTPPORT/%TESTNUMBER
+%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/altsvc-%TESTNUMBER
 </command>
 </client>
 
index d6196ec02573c86b92c7d821fd7b93d3f9c32932..30d4c6215411b230bba20aaeccd472a4c16c1457 100644 (file)
@@ -74,7 +74,7 @@ TZ=GMT
 lib%TESTNUMBER
 </tool>
 <command>
-http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/jar%TESTNUMBER
 </command>
 </client>
 
index 7f7df731c1a3467fae42fb1c900dd04bc40c4a8b..700fd44bfe49d887db54648dae38f95d5a561300 100644 (file)
@@ -58,7 +58,7 @@ lib%TESTNUMBER
 RTSP Announce (PUT and POST style) test
 </name>
 <command>
-rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER
+rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER %LOGDIR/file%TESTNUMBER.txt
 </command>
 # file written before test command runs
 <file name="%LOGDIR/file%TESTNUMBER.txt">
index ff49988891832527773215ac08ffe63be34dada7..4ac86bc9bf570e354f25548cd13555b33b12dc56 100644 (file)
@@ -73,7 +73,7 @@ lib%TESTNUMBER
 RTSP GET_PARAMETER (Put/Heartbeat/Post)
 </name>
 <command>
-rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER
+rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER %LOGDIR/file%TESTNUMBER.txt
 </command>
 # file written before test command runs
 <file name="%LOGDIR/file%TESTNUMBER.txt">
index f046f9e279f8e5b4d04fed0c3b9c0ceb67d49636..c71a047af5ea3c83ac6f9e2ca8b16b43ae4597c1 100644 (file)
@@ -54,7 +54,7 @@ lib%TESTNUMBER
 HTTP duplicate easy handle with mime data
  </name>
  <command>
-http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/file%TESTNUMBER.txt
 </command>
 <file name="%LOGDIR/file%TESTNUMBER.txt">
 This is data from a file
index 984d2e0d28f27b584136e8c9ad28d4f3039f2fce..ab7cbec9960b66c50c057cfae68272f650cf95da 100644 (file)
@@ -47,7 +47,7 @@ lib%TESTNUMBER
 HTTP mimepost early end of data detection
  </name>
  <command>
-http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/file%TESTNUMBER.txt
 </command>
 <file name="%LOGDIR/file%TESTNUMBER.txt">
 This is data from a file
index 4ca312c1b6d30fe2953f1ceacd7cb59500f59c98..6e1fd193f4087b2f88210c53542f9e2f2f8c9d7a 100644 (file)
@@ -44,7 +44,7 @@ Content-Type: text/html
 
 # Client-side
 <client>
-<file name="%LOGDIR/cookies676">
+<file name="%LOGDIR/cookies%TESTNUMBER">
 %HOSTIP        TRUE    /we/want/       FALSE   2118138987      proven  yes
 </file>
 <server>
@@ -59,7 +59,7 @@ lib%TESTNUMBER
 verify setting CURLOPT_COOKIEFILE to NULL again
  </name>
  <command>
-http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER
+http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER %LOGDIR/cookies676
 </command>
 <features>
 cookies
index 701cd7f0d362940cbac584fb38da3aa6c7ecc381..240dbe729a4c8e4a9f8c055daeadc693bccaeaef 100644 (file)
@@ -38,13 +38,13 @@ int test(char *URL)
     goto cleanup;
 
   curl_easy_setopt(ch, CURLOPT_URL, URL);
-  curl_easy_setopt(ch, CURLOPT_COOKIEFILE, "log/cookies1903");
+  curl_easy_setopt(ch, CURLOPT_COOKIEFILE, libtest_arg2);
   curl_easy_perform(ch);
 
   curl_easy_reset(ch);
 
   curl_easy_setopt(ch, CURLOPT_URL, URL);
-  curl_easy_setopt(ch, CURLOPT_COOKIEFILE, "log/cookies1903");
+  curl_easy_setopt(ch, CURLOPT_COOKIEFILE, libtest_arg2);
   curl_easy_perform(ch);
 
   cleanup:
index 455814f76e2406e89055798f50a847951f2e0873..bae975c994a2e9707d5e11981b0bb36b90e0398d 100644 (file)
@@ -55,8 +55,8 @@ int test(char *URL)
 
   curl_easy_setopt(ch, CURLOPT_SHARE, sh);
   curl_easy_setopt(ch, CURLOPT_URL, URL);
-  curl_easy_setopt(ch, CURLOPT_COOKIEFILE, "log/cookies1905");
-  curl_easy_setopt(ch, CURLOPT_COOKIEJAR, "log/cookies1905");
+  curl_easy_setopt(ch, CURLOPT_COOKIEFILE, libtest_arg2);
+  curl_easy_setopt(ch, CURLOPT_COOKIEJAR, libtest_arg2);
 
   curl_multi_add_handle(cm, ch);
 
index 1ef979c218662fe2c7b8c994fe46d40958f3ec23..ff92dafb4b8af3202fb269ef6e7a663819733f12 100644 (file)
@@ -39,7 +39,7 @@ int test(char *URL)
   if(hnd) {
     curl_easy_setopt(hnd, CURLOPT_URL, URL);
     curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 1L);
-    curl_easy_setopt(hnd, CURLOPT_ALTSVC, "log/altsvc-1908");
+    curl_easy_setopt(hnd, CURLOPT_ALTSVC, libtest_arg2);
     ret = curl_easy_perform(hnd);
 
     if(!ret) {
index 8862c46ce9252d0e9ca6967c7227223db363e9b2..dd4759ac452604c577be1e0d8484cfa2fb3485c8 100644 (file)
@@ -24,8 +24,8 @@
 #include "test.h"
 #include "memdebug.h"
 
-static const char *HOSTHEADER = "Host: www.host.foo.com";
-static const char *JAR = "log/jar506";
+static const char * const HOSTHEADER = "Host: www.host.foo.com";
+#define JAR libtest_arg2
 #define THREADS 2
 
 /* struct containing data of a thread */
index 2d747ef390471b5c152f878cc8ca03a6a27f809e..9e761e8da58ebb58060fa1545fa249f86d87026f 100644 (file)
@@ -78,13 +78,13 @@ int test(char *URL)
   free(stream_uri);
   stream_uri = NULL;
 
-  sdp = open("log/file568.txt", O_RDONLY);
+  sdp = open(libtest_arg2, O_RDONLY);
   fstat(sdp, &file_info);
   close(sdp);
 
-  sdpf = fopen("log/file568.txt", "rb");
+  sdpf = fopen(libtest_arg2, "rb");
   if(!sdpf) {
-    fprintf(stderr, "can't open log/file568.txt\n");
+    fprintf(stderr, "can't open %s\n", libtest_arg2);
     res = TEST_ERR_MAJOR_BAD;
     goto test_cleanup;
   }
index aa723de89f9650a2c539776ce5bf8b18b8828cff..f21037dc2f9a9e8acd811dded1992994031a08a1 100644 (file)
@@ -97,13 +97,13 @@ int test(char *URL)
   stream_uri = NULL;
 
   /* PUT style GET_PARAMETERS */
-  params = open("log/file572.txt", O_RDONLY);
+  params = open(libtest_arg2, O_RDONLY);
   fstat(params, &file_info);
   close(params);
 
-  paramsf = fopen("log/file572.txt", "rb");
+  paramsf = fopen(libtest_arg2, "rb");
   if(!paramsf) {
-    fprintf(stderr, "can't open log/file572.txt\n");
+    fprintf(stderr, "can't open %s\n", libtest_arg2);
     res = TEST_ERR_MAJOR_BAD;
     goto test_cleanup;
   }
index 449e220e862b433bac63c7b2a6955a3a978515ca..96551637dfcc75f4a0ad663ae4522e71ba640f19 100644 (file)
@@ -109,7 +109,7 @@ int test(char *URL)
   hdrs = curl_slist_append(hdrs, "X-Test-Number: 654");
   curl_mime_headers(part, hdrs, TRUE);
   part = curl_mime_addpart(mime);
-  curl_mime_filedata(part, "log/file654.txt");
+  curl_mime_filedata(part, libtest_arg2);
   part = curl_mime_addpart(mime);
   curl_mime_data_cb(part, (curl_off_t) -1, read_callback, NULL, free_callback,
                     &pooh);
index 26c5858853b12c53693d4804dbb66abc0d210f72..35ab758f381c0af5cb56d7debc9fb5d597c16f2d 100644 (file)
@@ -98,7 +98,7 @@ int test(char *URL)
   curl_mime_name(part, "field3");
   /* Regular file part sources early end of data can be detected because
      the file size is known. In addition, and EOF test is performed. */
-  curl_mime_filedata(part, "log/file668.txt");
+  curl_mime_filedata(part, libtest_arg2);
 
   /* Bind mime data to its easy handle. */
   test_setopt(easy, CURLOPT_MIMEPOST, mime);
index 2051795f0f05b5432e3e71861ff94d90d9d0a0e6..478d5f3a1e957662def329b14e765407ba939f1a 100644 (file)
@@ -45,7 +45,7 @@ int test(char *URL)
   test_setopt(curl, CURLOPT_URL, URL);
   test_setopt(curl, CURLOPT_HEADER, 1L);
   test_setopt(curl, CURLOPT_USERAGENT, "the-moo agent next generation");
-  test_setopt(curl, CURLOPT_COOKIEFILE, "log/cookies676");
+  test_setopt(curl, CURLOPT_COOKIEFILE, libtest_arg2);
   test_setopt(curl, CURLOPT_VERBOSE, 1L);
 
   res = curl_easy_perform(curl);