cURL / Mailing Lists / curl-library / Single Mail

curl-library

sws test server with --fork

From: Joe Mason <jmason_at_rim.com>
Date: Tue, 31 Jul 2012 19:10:36 +0000

I've found out how to run sws with the --fork option by calling "runtests.pl -f". But when I do that, several copies of sws are left running after runtests.pl finishes (so if I run runtests.pl again without killing them, it complains the ports are already in use).

Is it a good idea to add code to runtests.pl to kill off all forked copies of sws that it started when it exists? (Or is there already a way to do this that I'm just missing?)

Is there a way I can have the test suite automatically add --fork for tests that require it? (A keyword, maybe.) If not, is there any interest in my adding this?

The reason I want it right now is because I wrote a test of NTLM auth, and found that because NTLM is connection oriented, curl will only reuse the same connection for requests with the exact same NTLM paramters. If you try to make two NTLM requests to the same host but with different usernames or passwords, curl will use a separate connection for each. Which is fine, but without the --fork option to sws, the test suite only listens on one connection at a time. With --fork, my new test seems to work.

It seems to me that curl needs a lot more tests that exercise the mapping of requests to connections (especially as we start improving pipelining) so it's important for the test server to support multiple connections. So --fork should be well supported by the test suite. But the code is full of comments that say things like, "This is NOT what you wanna do without knowing exactly why and for what," and that --fork is for, "if you feel wild and crazy and want to setup some more exotic tests". Honestly, it doesn't seem that complicated to me, and a test involving several requests in a row (which may or may not use multiple connections; impossible to tell without digging into the guts of curl, which shouldn't be necessary to write a functionl test) don't seem that exotic... does fork mode have a lot of hidden gotchas?

Ideally the server would support requests from multiple connections by default, so that the test authors wouldn't have to add "fork" keywords in a cargo-cult like way when writing tests that happen to create more than one connection. What would be the implications of turning --fork mode on by default for the test suite?

Joe

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-31