aboutsummaryrefslogtreecommitdiff
path: root/tests/server
AgeCommit message (Collapse)Author
2020-05-25all: fix codespell errorsViktor Szakats
Reviewed-by: Jay Satiro Reviewed-by: Daniel Stenberg Closes https://github.com/curl/curl/pull/5452
2020-05-20tests/server/util.h: add extern to silence compiler warningDaniel Stenberg
Follow-up from a3b0699d5c1
2020-05-15sws: as last resort, get test number from server cmd fileDaniel Stenberg
If it can't be found in the request. Also support --cmdfile to set it to a custom file name. runtests.pl always writes this file with the test number in it since a while back.
2020-05-14curl_multibyte: add to curlxMarcel Raad
This will also be needed in the tool and tests. Ref: https://github.com/curl/curl/pull/3758#issuecomment-482197512 Closes https://github.com/curl/curl/pull/3784
2020-05-12CMake: do not build test programs by defaultPeter Wu
The default target should only build libcurl and curl. Add a dedicated 'testdeps' target which will be used later when running tests. Note that unittests are currently broken in CMake and already excluded. Closes #5368
2020-05-10tests/server/tftpd.c: fix include and enhance debug loggingMarc Hoersken
setjmp.h should only be included if HAVE_SETJMP_H is defined. Add additional log statements to see wether reads and writes are blocking or finishing before an alarm signal is received. Assisted-by: Peter Wu Part of #5364
2020-05-04dynbuf: introduce internal generic dynamic buffer functionsDaniel Stenberg
A common set of functions instead of many separate implementations for creating buffers that can grow when appending data to them. Existing functionality has been ported over. In my early basic testing, the total number of allocations seem at roughly the same amount as before, possibly a few less. See docs/DYNBUF.md for a description of the API. Closes #5300
2020-05-02sockfilt: make select_ws stop waiting on exit signal eventMarc Hoersken
This makes sure that select_ws behaves similar to real select which stops waiting on a signal handler being triggered. This makes it possible to gracefully stop sockfilt.exe on Windows with taskkill /IM sockfilt.exe (without /F force flag). Reviewed-by: Jay Satiro Part of #5260
2020-05-02tests/server/util.[ch]: add exit event to stop waiting on WindowsMarc Hoersken
This commit adds a global exit event to the test servers that Windows-specific wait routines can use to get triggered if the program was signaled to be terminated, eg. select_ws in sockfilt.c The exit event will be managed by the signal handling code and is set to not reset automatically to support multiple wait routines. Reviewed-by: Jay Satiro Closes #5260
2020-05-02tests/server/util.c: fix thread handle not being closedMarc Hoersken
Reviewed-by: Jay Satiro Part of #5260
2020-05-02tests/server/util.c: use raise instead of calling signal handlerMarc Hoersken
Use raise to trigger signal handler instead of calling it directly and causing potential unexpected control flow. Reviewed-by: Jay Satiro Part of #5260
2020-04-29tests: look for preprocessed tests in build directoryKamil Dudka
... which is not always the same directory as source directory Closes #5310
2020-04-24tests/git: ignore mqttd and port filesEmil Engler
Closes #5290
2020-04-20tests: run the RTSP test server on a dynamic port numberDaniel Stenberg
To avoid port collisions. Closes #5272
2020-04-20server/tftpd: fix compiler warningDaniel Stenberg
Follow-up from 369ce38ac1d Reported-by: Marc Hörsken
2020-04-20tests: run the SOCKS test server on a dynamic port numberDaniel Stenberg
Closes #5266
2020-04-20tests: run the TFTP test server on a dynamic port numberDaniel Stenberg
Picking a dynamic unused port is better than a fixed to avoid the collision risk. Closes #5265
2020-04-20mqtt: improve the state machineDaniel Stenberg
To handle PUBLISH before SUBACK and more. Updated the existing tests and added three new ones. Reported-by: Christoph Krey Bug: https://curl.haxx.se/mail/lib-2020-04/0021.html Closes #5246
2020-04-18tests: move pingpong server to dynamic listening portDaniel Stenberg
FTP, IMAP, POP3, SMTP and their IPv6 versions are now all on dynamic ports Test 842-845 are unfortunately a bit hard to move over to this concept right now and require "default port" still...
2020-04-18tests: introduce preprocessed test casesDaniel Stenberg
The runtests script now always performs variable replacement on the entire test source file before the test gets executed, and saves the updated version in a temporary file (log/test[num]) so that all test case readers/servers can use that version (if present) and thus enjoy the powers of test case variable substitution. This is necessary to allow complete port number freedom. Test 309 is updated to work with a non-fixed port number thanks to this.
2020-04-18tests: run the sws server on "any port"Daniel Stenberg
Makes the test servers for HTTP and Gopher pop up on a currently unused port and runtests adapts to that! Closes #5247
2020-04-18sockfilt: tidy variable naming and data structure in select_wsMarc Hoersken
This commit does not introduce any logical changes to the code. Reviewed-by: Jay Satiro and Marcel Raad Closes #5238
2020-04-16mqttd: s/errno/SOCKERRNODaniel Stenberg
To behave proper on Windows Reported-by: Gisle Vanem Bug: https://github.com/curl/curl/commit/5e855bbd18f84a02c951be7cac6188276818cdac#r38507132 Closes #5241
2020-04-15copyright: bump the copyright year rangeDaniel Stenberg
2020-04-14sockfilt: fix broken pipe on Windows to be ready in select_wsMarc Hoersken
Closes #5228
2020-04-14tests: add the mqtt test server mqttdDaniel Stenberg
2020-04-12tests/server: add hidden window to gracefully handle WM_CLOSEMarc Hoersken
Forward Window events as signals to existing signal event handler.
2020-04-12tests/server: add CTRL event handler for Win32 consolesMarc Hoersken
Forward CTRL events as signals to existing signal event handler.
2020-04-12tests/server: move all signal handling routines to util.[ch]Marc Hoersken
Avoid code duplication to prepare for portability enhancements.
2020-04-11tests/server/util.c: use curl_off_t instead of long for pidMarc Hoersken
Avoid potential overflow of huge PIDs on Windows. Related to #5188 Assisted-by: Marcel Raad
2020-04-11tests: fix conflict between Cygwin/msys and Windows PIDsMarc Hoersken
Add 65536 to Windows PIDs to allow Windows specific treatment by having disjunct ranges for Cygwin/msys and Windows PIDs. See also: - https://cygwin.com/git/?p=newlib-cygwin.git;a=commit; ↵ h=b5e1003722cb14235c4f166be72c09acdffc62ea - https://cygwin.com/git/?p=newlib-cygwin.git;a=commit; ↵ h=448cf5aa4b429d5a9cebf92a0da4ab4b5b6d23fe Replaces #5178 Closes #5188
2020-04-09server/resolve: remove AI_CANONNAME to make macos tell the truthDaniel Stenberg
With this bit set, my mac successfully resolves "ip6-localhost" when in fact there is no such host known to my machine! That in turn made test 241 wrongly execute and fail. Closes #5202
2020-04-06cleanup: correct copyright year range on a few filesDaniel Stenberg
2020-04-03sockfilt: remove redundancy in timeout handlingMarc Hoersken
And update other logmsg output in select_ws on Windows.
2020-04-03sockfilt: fix handling of ready closed sockets on WindowsMarc Hoersken
Replace the incomplete workaround regarding FD_CLOSE only signalling once by instead doing a pre-check with standard select and storing the result for later use. select keeps triggering on closed sockets on Windows while WSAEventSelect fires only once with data still available. By doing the pre-check we do not run in a deadlock due to waiting forever for another FD_CLOSE event.
2020-04-03sockfilt: fix race-condition of waiting threads and event handlingMarc Hoersken
Fix race-condition of waiting threads finishing while events are already being processed which lead to invalid or skipped events. Use mutex to check for one event at a time or do post-processing. In addition to mutex-based locking use specific event as signal. Closes #5156
2020-03-26sockfilt: add logmsg output to select_ws_wait_thread on WindowsMarc Hoersken
Assisted-by: Jay Satiro Reviewed-by: Daniel Stenberg Closes #5086
2020-03-24copyright: fix out-of-date copyright ranges and missing headersDaniel Stenberg
Reported by the new script 'scripts/copyright.pl'. The script has a regex whitelist for the files that don't need copyright headers. Removed three (mostly usesless) README files from docs/ Closes #5141
2020-03-08silly web server: silent a compilation warningPatrick Monnerat
Recent gcc warns when byte count of strncpy() equals the destination buffer size. Since the destination buffer is previously cleared and the source string is always shorter, reducing the byte count by one silents the warning without affecting the result. Closes #5059
2020-03-04tests: align some Windows sleep defines with each otherMarc Hoersken
2020-02-26http: added 417 response treatmentDaniel Stenberg
When doing a request with a body + Expect: 100-continue and the server responds with a 417, the same request will be retried immediately without the Expect: header. Added test 357 to verify. Also added a control instruction to tell the sws test server to not read the request body if Expect: is present, which the new test 357 uses. Reported-by: bramus on github Fixes #4949 Closes #4964
2020-02-02cleanup: fix typos and wording in docs and commentsPedro Monreal
Closes #4869 Reviewed-by: Emil Engler and Daniel Gustafsson
2020-01-03tests: Fix bounce requests with truncated writesMarc Aldorasi
Prior to this change the swsbounce check in service_connection could fail because prevtestno and prevpartno were not set, which would cause the wrong response data to be sent to some tests and cause them to fail. Ref: https://github.com/curl/curl/pull/4717#issuecomment-570240785
2019-12-19sws: search for "Testno:" header uncondtionally if no testnoDaniel Stenberg
Even if the initial request line wasn't found. With the fix to 1455, the test number is now detected correctly. (Problem found when running tests in random order.) Closes #4744
2019-12-16tests: make sure checksrc runs on header files tooDaniel Stenberg
2019-12-03curl_setup: disable IPv6 resolver without `getaddrinfo`Marcel Raad
Also, use `CURLRES_IPV6` only for actual DNS resolution, not for IPv6 address support. This makes it possible to connect to IPv6 literals by setting `ENABLE_IPV6` even without `getaddrinfo` support. It also fixes the CMake build when using the synchronous resolver without `getaddrinfo` support. Closes https://github.com/curl/curl/pull/4662
2019-12-01build: Disable Visual Studio warning "conditional expression is constant"Jay Satiro
- Disable warning C4127 "conditional expression is constant" globally in curl_setup.h for when building with Microsoft's compiler. This mainly affects building with the Visual Studio project files found in the projects dir. Prior to this change the cmake and winbuild build systems already disabled 4127 globally for when building with Microsoft's compiler. Also, 4127 was already disabled for all build systems in the limited circumstance of the WHILE_FALSE macro which disabled the warning specifically for while(0). This commit removes the WHILE_FALSE macro and all other cruft in favor of disabling globally in curl_setup. Background: We have various macros that cause 0 or 1 to be evaluated, which would cause warning C4127 in Visual Studio. For example this causes it: #define Curl_resolver_asynch() 1 Full behavior is not clearly defined and inconsistent across versions. However it is documented that since VS 2015 Update 3 Microsoft has addressed this somewhat but not entirely, not warning on while(true) for example. Prior to this change some C4127 warnings occurred when I built with Visual Studio using the generated projects in the projects dir. Closes https://github.com/curl/curl/pull/4658
2019-11-09strerror: Fix an error looking up some Windows error stringsJay Satiro
- Use FORMAT_MESSAGE_IGNORE_INSERTS to ignore format specifiers in Windows error strings. Since we are not in control of the error code we don't know what information may be needed by the error string's format specifiers. Prior to this change Windows API error strings which contain specifiers (think specifiers like similar to printf specifiers) would not be shown. The FormatMessage Windows API call which turns a Windows error code into a string could fail and set error ERROR_INVALID_PARAMETER if that error string contained a format specifier. FormatMessage expects a va_list for the specifiers, unless inserts are ignored in which case no substitution is attempted. Ref: https://devblogs.microsoft.com/oldnewthing/20071128-00/?p=24353
2019-11-02copyrights: update all copyright notices to 2019 on files changed this yearVilhelm Prytz
Closes #4547
2019-09-30git: add tests/server/disabled to .gitignoreEmil Engler
Closes #4441