Nicolas Lehuen wrote:
Hi David,

One thing I don't understand is why you have "foreign" PythonOption
definitions in your test setup. Are you sure you have re-created a
clean testconf.py file from testconf.py.in ? I've write a little bit
of documentation in test/README, please try to follow it.
Hi Nicolas

I don't understand this either. I followed the docs in test/README (I've checked and did that right).

I just repeated the test using my patch to use a different service name (attached). This only generated one segfault and failed on the second cleanup test, but not the first... This behaviour seems repeatable (running the tests twice produced exactly the same results)
It seems to me that the test failures all come from this strange test
configuration. It looks like mod_python is interfering with some
already existing filters, like MultiView.
Yes, it does indeed seem that way. So from the point of view, these errors shouldn't hold up the release, as they seem to be problems in the test framework. I just thought I'd like to run them, so it seems a good time to try and solve them.
Note that there is a bug under Win32 which I should have reported way
before... In some situation, when an exception is raised in mod_python
during normal operation, Apache will segfault the next time is is
stopped or restarted. It only occurs with a specific exception is
raised, maybe when a handler module fails to load.
The reason why I haven't reported it yet is that it only occured on my
development computer, not my production servers, so I thought it was
something caused by my setup. Apparently you have the same problem,
hence the segfault when the Apache server is stopped. I'll have to
investigate this problem more thoroughly.
Interesting that it seems to make a difference running under a different service name. I can try help track this down.
So please try to re-run the test in a clean slate environment. It'd be
interesting to see why and how your current configuration
"contaminates" the test configuration, though.
OK I'm busy setting up VMWare to try this - pretty sure it'll pass, so I'll try investigate whats getting the situation confused...

Thanks for your feedback
David
Index: test/testconf.py.in
===================================================================
--- test/testconf.py.in	(revision 375881)
+++ test/testconf.py.in	(working copy)
@@ -18,6 +18,9 @@
 # Path to the mod_python.so file, should be in the apache modules directory.
 MOD_PYTHON_SO="@MOD_PYTHON_SO@"
 
+# Set SVCNAME if you want to test via the given service
+SVCNAME=""
+
 # makes emacs go into python mode
 ### Local Variables:
 ### mode:python
Index: test/test.py
===================================================================
--- test/test.py	(revision 375881)
+++ test/test.py	(working copy)
@@ -176,6 +176,7 @@
 TESTHOME = testconf.TESTHOME
 MOD_PYTHON_SO = testconf.MOD_PYTHON_SO
 LIBEXECDIR = testconf.LIBEXECDIR
+SVCNAME = testconf.SVCNAME
 SERVER_ROOT = TESTHOME
 CONFIG = os.path.join(TESTHOME, "conf", "test.conf")
 DOCUMENT_ROOT = os.path.join(TESTHOME, "htdocs")
@@ -299,12 +300,38 @@
         f.write("\n# --APPENDED-- \n\n"+append)
         f.close()
 
+    def installService(self,extra=''):
+
+        print "  Installing Test Apache Service...."
+        httpd = quoteIfSpace(HTTPD)
+        config = quoteIfSpace(CONFIG)
+        cmd = '%s %s -k install -n %s -f %s' % (httpd, extra, SVCNAME, config)
+        print "    ", cmd
+        os.system(cmd)
+        time.sleep(1)
+        self.httpd_installed = 1
+
+    def uninstallService(self,extra=''):
+
+        print "  Uninstalling Test Apache Service...."
+        httpd = quoteIfSpace(HTTPD)
+        cmd = '%s -k uninstall -n %s' % (httpd, SVCNAME)
+        print "    ", cmd
+        os.system(cmd)
+        time.sleep(1)
+        self.httpd_installed = 0
+
     def startHttpd(self,extra=''):
 
+        if SVCNAME:
+            self.installService(extra)
         print "  Starting Apache...."
         httpd = quoteIfSpace(HTTPD)
         config = quoteIfSpace(CONFIG)
-        cmd = '%s %s -k start -f %s' % (httpd, extra, config)
+	if SVCNAME:
+            cmd = '%s %s -k start -n %s' % (httpd, extra, SVCNAME)
+        else:
+            cmd = '%s %s -k start -f %s' % (httpd, extra, config)
         print "    ", cmd
         os.system(cmd)
         time.sleep(1)
@@ -315,7 +342,10 @@
         print "  Stopping Apache..."
         httpd = quoteIfSpace(HTTPD)
         config = quoteIfSpace(CONFIG)
-        cmd = '%s -k stop -f %s' % (httpd, config)
+	if SVCNAME:
+            cmd = '%s -k stop -n %s' % (httpd, SVCNAME)
+        else:
+            cmd = '%s -k stop -f %s' % (httpd, config)
         print "    ", cmd
         os.system(cmd)
         time.sleep(1)
@@ -337,6 +367,9 @@
 
         self.httpd_running = 0
 
+        if SVCNAME:
+            self.uninstallService()
+
 class PerRequestTestCase(unittest.TestCase):
 
     appendConfig = "\nNameVirtualHost *\n\n"
@@ -1872,6 +1905,8 @@
     def tearDown(self):
         if self.httpd_running:
             self.stopHttpd()
+        if SVCNAME and self.httpd_installed:
+            self.uninstallService()
 
     def testLoadModule(self):
 
Index: test/README
===================================================================
--- test/README	(revision 375881)
+++ test/README	(working copy)
@@ -15,6 +15,8 @@
 does not revert back to showing the status of your Apache server. The server
 itself is still running, though.
 
+- To run under a different service name, set SVCNAME to something in testconf.py (e.g. "Apache2TestModPy".
+
 2) Setting up mod_python source code
 ------------------------------------
 

Reply via email to