From: Dean M. B. <mik...@gm...> - 2008-09-23 22:08:06
|
Hi Divye, On Wed, Sep 24, 2008 at 12:37 AM, Divye Kapoor <div...@gm...> wrote: > Hello Dean, > > On Tue, Sep 23, 2008 at 4:22 PM, Dean Michael Berris > <mik...@gm...> wrote: >> >> I've only now been able to run the localhost test scripts in Linux and >> after trying to remedy the situation on my own, I recognize that I >> don't have enough Python kung fu to deal with this. >> >> Apparently HTTP_ALL_HEADERS is not set when the echo_headers and >> echo_body script executes in Linux. > > Do all python scripts in the cgi-bin directory have execute permissions for > *all* users? I seem to remember that the linux version of CGIHTTPServer runs > the CGI scripts with a uid of nobody and that might create permission issues > in some cases. Also, are there any errors in the python log window? > Yes, they do. Let me paste the log of the errors below: gcc.compile.c++ bin/gcc-4.2.3/debug/link-static/localhost_tests.o gcc.link bin/gcc-4.2.3/debug/link-static/localhost_tests testing.unit-test bin/gcc-4.2.3/debug/link-static/localhost_tests.passed localhost - - [24/Sep/2008 06:04:28] "GET / HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET / HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /boost.jpg HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /test.xml HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /test.xml HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /boost.jpg HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /cgi-bin/requestinfo.py?query=1 HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /cgi-bin/multiline-header.py?query=1 HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] code 404, message File not found localhost - - [24/Sep/2008 06:04:28] "GET /file_not_found HTTP/1.0" 404 - localhost - - [24/Sep/2008 06:04:28] "HEAD /test.xml HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", line 17, in <module> hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 11, in __init__ self.parse(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 24, in parse self.headers = self.__parse_headers(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 31, in __parse_headers lines = str.split('\n') AttributeError: 'NoneType' object has no attribute 'split' localhost - - [24/Sep/2008 06:04:28] CGI script exit status 0x100 Running 15 test cases... localhost_tests.cpp(272): error in "post_with_explicit_headers": check headers["content-length"] == content_length failed [ != 5] localhost_tests.cpp(273): error in "post_with_explicit_headers": check headers["content-type"] == content_type failed [ != application/x-www-form-urlencoded] localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", line 17, in <module> hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 11, in __init__ self.parse(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 24, in parse self.headers = self.__parse_headers(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 31, in __parse_headers lines = str.split('\n') AttributeError: 'NoneType' object has no attribute 'split' localhost - - [24/Sep/2008 06:04:28] CGI script exit status 0x100 localhost_tests.cpp(290): error in "post_with_implicit_headers": check headers["content-length"] == get_content_length(postdata) failed [ != 5] localhost_tests.cpp(291): error in "post_with_implicit_headers": check headers["content-type"] == "x-application/octet-stream" failed [ != x-application/octet-stream] localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", line 17, in <module> hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 11, in __init__ self.parse(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 24, in parse self.headers = self.__parse_headers(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 31, in __parse_headers lines = str.split('\n') AttributeError: 'NoneType' object has no attribute 'split' localhost - - [24/Sep/2008 06:04:28] CGI script exit status 0x100 localhost_tests.cpp(309): error in "post_with_explicit_content_type": check headers["content-length"] == get_content_length(postdata) failed [ != 5] localhost_tests.cpp(310): error in "post_with_explicit_content_type": check headers["content-type"] == content_type failed [ != application/x-my-content-type] localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_body.py HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", line 17, in <module> hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 11, in __init__ self.parse(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 24, in parse self.headers = self.__parse_headers(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 31, in __parse_headers lines = str.split('\n') AttributeError: 'NoneType' object has no attribute 'split' localhost - - [24/Sep/2008 06:04:28] CGI script exit status 0x100 localhost_tests.cpp(342): error in "post_with_custom_headers": check headers["x-cpp-netlib"] == "rocks!" failed [ != rocks!] *** 7 failures detected in test suite "http 1.0 localhost tests" LD_LIBRARY_PATH=/usr/bin:/usr/lib:/usr/lib32:/usr/lib64:$LD_LIBRARY_PATH export LD_LIBRARY_PATH bin/gcc-4.2.3/debug/link-static/localhost_tests && touch bin/gcc-4.2.3/debug/link-static/localhost_tests.passed ...failed testing.unit-test bin/gcc-4.2.3/debug/link-static/localhost_tests.passed... ...failed updating 1 target... ...updated 2 targets... >> >> Can we fix this before I merge to trunk and release 0.3? > > Hopefully yes, > Sounds promising. You don't encounter this problem in Linux? -- Dean Michael C. Berris Software Engineer, Friendster, Inc. |