test1915: add tracing and connect timeout
Since we see Windows fails of 1915, add tracing and a connect timeout. The test uses a port no one is supposed to listen on, but Windows has this weird wait logic. So, set a short timeout. Closes #15107
This commit is contained in:
parent
566a6d7b09
commit
bc055d08ac
@ -577,7 +577,7 @@ lib1912_LDADD = $(TESTUTIL_LIBS)
|
||||
lib1913_SOURCES = lib1913.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
|
||||
lib1913_LDADD = $(TESTUTIL_LIBS)
|
||||
|
||||
lib1915_SOURCES = lib1915.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
|
||||
lib1915_SOURCES = lib1915.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS)
|
||||
lib1915_LDADD = $(TESTUTIL_LIBS)
|
||||
|
||||
lib1916_SOURCES = lib1916.c $(SUPPORTFILES) $(WARNLESS)
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
***************************************************************************/
|
||||
#include "test.h"
|
||||
|
||||
#include "testtrace.h"
|
||||
#include "testutil.h"
|
||||
#include "warnless.h"
|
||||
#include "memdebug.h"
|
||||
@ -104,26 +105,39 @@ CURLcode test(char *URL)
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
libtest_debug_config.nohex = 1;
|
||||
libtest_debug_config.tracetime = 1;
|
||||
|
||||
easy_init(hnd);
|
||||
easy_setopt(hnd, CURLOPT_URL, URL);
|
||||
easy_setopt(hnd, CURLOPT_CONNECTTIMEOUT, 1L);
|
||||
easy_setopt(hnd, CURLOPT_HSTSREADFUNCTION, hstsread);
|
||||
easy_setopt(hnd, CURLOPT_HSTSREADDATA, &st);
|
||||
easy_setopt(hnd, CURLOPT_HSTSWRITEFUNCTION, hstswrite);
|
||||
easy_setopt(hnd, CURLOPT_HSTSWRITEDATA, &st);
|
||||
easy_setopt(hnd, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE);
|
||||
easy_setopt(hnd, CURLOPT_DEBUGDATA, &libtest_debug_config);
|
||||
easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, libtest_debug_cb);
|
||||
easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
||||
res = curl_easy_perform(hnd);
|
||||
curl_easy_cleanup(hnd);
|
||||
hnd = NULL;
|
||||
if(res == CURLE_OPERATION_TIMEDOUT) /* we expect that on Windows */
|
||||
res = CURLE_COULDNT_CONNECT;
|
||||
printf("First request returned %d\n", res);
|
||||
res = CURLE_OK;
|
||||
|
||||
easy_init(hnd);
|
||||
easy_setopt(hnd, CURLOPT_URL, URL);
|
||||
easy_setopt(hnd, CURLOPT_CONNECTTIMEOUT, 1L);
|
||||
easy_setopt(hnd, CURLOPT_HSTSREADFUNCTION, hstsreadfail);
|
||||
easy_setopt(hnd, CURLOPT_HSTSREADDATA, &st);
|
||||
easy_setopt(hnd, CURLOPT_HSTSWRITEFUNCTION, hstswrite);
|
||||
easy_setopt(hnd, CURLOPT_HSTSWRITEDATA, &st);
|
||||
easy_setopt(hnd, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE);
|
||||
easy_setopt(hnd, CURLOPT_DEBUGDATA, &libtest_debug_config);
|
||||
easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, libtest_debug_cb);
|
||||
easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
||||
res = curl_easy_perform(hnd);
|
||||
curl_easy_cleanup(hnd);
|
||||
hnd = NULL;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user