Issue Details (XML | Word | Printable)

Key: MODPYTHON-119
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jim Gallacher
Reporter: Graham Dumpleton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

DBM Session test shouldn't use default database.

Created: 05/Feb/06 07:46 AM   Updated: 05/Apr/07 11:40 AM
Return to search
Component/s: core
Affects Version/s: 3.2.7
Fix Version/s: 3.2.10, 3.3.1

Time Tracking:
Not Specified

Resolution Date: 06/Mar/06 08:17 AM


 Description  « Hide
The test_Session_Session_conf() of test/test.py doesn't override the default DBM session database name that would be used for prefork/worker MPM variants. This means that if there is already an instance of Apache running as its designated user which has already created the session database and the tests are run as a different user, the test will fail. Further, if mod_python has never previously been used and no session database exists, the test will succeed, but when someone goes to use sessions in the installed mod_python, it will fail in the case where the session database created by the test was as a different user to that which Apache runs as.

The test suite should ensure that it overrides any defaults and stores such databases in test suite document tree. It should possibly also ensure that such transient files are removed so as not to create a problem on subsequent tests.

Test might therefore be changed to:

    def test_Session_Session_conf(self):

        database = os.path.join(TESTHOME,"mp_sess_test.dbm")

        c = VirtualHost("*",
                        ServerName("test_Session_Session"),
                        DocumentRoot(DOCUMENT_ROOT),
                        Directory(DOCUMENT_ROOT,
                                  PythonOption('session_dbm "%s"' % database),
                                  SetHandler("mod_python"),
                                  PythonHandler("tests::Session_Session"),
                                  PythonDebug("On")))
        return str(c)


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jim Gallacher made changes - 26/Feb/06 04:02 AM
Field Original Value New Value
Assignee Jim Gallacher [ jgallacher ]
Repository Revision Date User Message
ASF #383437 Mon Mar 06 00:04:27 UTC 2006 jgallacher Fixed DbmSession unit test to not use the default location for the
dbm file. (MODPYTHON-119)
Files Changed
MODIFY /httpd/mod_python/trunk/test/test.py
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex

Repository Revision Date User Message
ASF #383438 Mon Mar 06 00:15:48 UTC 2006 jgallacher Backported DbmSession dbm file location fix. (MODPYTHON-119)
Files Changed
MODIFY /httpd/mod_python/branches/3.2.x/test/test.py
MODIFY /httpd/mod_python/branches/3.2.x/Doc/appendixc.tex

Jim Gallacher made changes - 06/Mar/06 08:17 AM
Fix Version/s 3.3 [ 12310101 ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Jim Gallacher made changes - 06/Mar/06 08:33 AM
Fix Version/s 3.2.x [ 12310860 ]
Fix Version/s 3.3 [ 12310101 ]
Graham Dumpleton made changes - 12/Aug/06 07:51 AM
Fix Version/s 3.2.10 [ 12312029 ]
Fix Version/s 3.3 [ 12310101 ]
Fix Version/s 3.2.x [ 12310860 ]
Repository Revision Date User Message
ASF #466169 Fri Oct 20 16:19:10 UTC 2006 jgallacher (MODPYTHON-119) test_psp_error was automagically creating a dbm file session
file, but the configuration for the test did not include a PythonOption
for the session_directory. Thus the mp_sess.dbm file was being created
in the default location. Running the tests could interfer with another
Apache mod_python instance running on the same host.
Files Changed
MODIFY /httpd/mod_python/trunk/test/test.py

Repository Revision Date User Message
ASF #473093 Thu Nov 09 22:15:52 UTC 2006 jgallacher Fixed regession for MODPYTHON-119 in tests. One of the unittests was missed
when PythonOption namespace changes were implemented.
Files Changed
MODIFY /httpd/mod_python/trunk/test/test.py

Graham Dumpleton made changes - 05/Apr/07 11:40 AM
Status Resolved [ 5 ] Closed [ 6 ]