|
From: Allister L. S. <all...@gm...> - 2008-08-09 14:30:39
|
Hi Dean,
I checked out your latest commit. Then I figured out to make the server run
in the background without xterm, and also how to make it stop in the end :-)
Here's the patch.
Index: libs/network/test/localhost_tests.cpp
===================================================================
--- libs/network/test/localhost_tests.cpp (revision 48)
+++ libs/network/test/localhost_tests.cpp (working copy)
@@ -57,7 +57,7 @@
BOOST_REQUIRE_MESSAGE(server_child >= 0, "Failed to fork!");
if( server_child == 0 ) { // child process
chdir("libs/network/test/server");
- BOOST_REQUIRE_MESSAGE(execlp("xterm", "xterm", "-e", "python
cgi_server.py", (char *)NULL) != -1,
+ BOOST_REQUIRE_MESSAGE(execlp("python", "python",
"cgi_server.py", (char *)NULL) != -1,
"Python server execution failed!\n");
} else { // parent
sleep(1);
@@ -221,7 +221,7 @@
// Windows Kill code not implemented
#else
// This code causes a "fatal error" report for this test case.
- //kill(server_child, SIGINT);
+ kill(server_child, SIGTERM);
//waitpid(server_child, 0, 0);
#endif
}
Cheers,
Allister
On Sat, Aug 9, 2008 at 3:44 PM, Dean Michael Berris
<mik...@gm...>wrote:
> Hi Guys,
>
> I've just checked in revision 48 which fixes the Python CGI script
> that returns incomplete headers. I had to make it print the http
> status line (which I'm not sure is required) and add the correct line
> endings to the printed header: instead of just '\n', I made it print
> "\r\n\r\n" in the end to signify that it was the last header responded
> to.
>
> Divye, please make sure that this is the correct way to do CGI scripts
> in Python -- I really have no idea how to do that, and I only hacked
> the script to make it not fail in just the CGI case. I haven't tried
> this in Windows yet, but I'm thinking it should be do-able.
>
> Another thing: maybe we should put the startup/shutdown of the server
> in a global fixture in the test suite for localhost_test? Has anybody
> done this with Boost.Test before? That way when we start the server,
> we should be able to stop it as well at the end of the whole test.
>
> HTH
>
> PS. I will only now be doing the refactoring to support HEAD requests.
> I'm pretty sure I'll be refactoring the client implementation to make
> it "cleaner" and make the actual 'get' body implementation shorter.
>
>
|