Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 123852 | Differences between
and this patch

Collapse All | Expand All

(-)gentoo-3-2-8/test/httpdconf.py (+12 lines)
Lines 83-88 Link Here
83
    def __init__(self, val):
83
    def __init__(self, val):
84
        Directive.__init__(self, self.__class__.__name__, val)
84
        Directive.__init__(self, self.__class__.__name__, val)
85
85
86
class AllowOverride(Directive):
87
    def __init__(self, val):
88
        Directive.__init__(self, self.__class__.__name__, val)
89
86
class AuthBasicAuthoritative(Directive):
90
class AuthBasicAuthoritative(Directive):
87
    # New in Apache 2.2
91
    # New in Apache 2.2
88
    def __init__(self, val):
92
    def __init__(self, val):
Lines 121-126 Link Here
121
    def __init__(self, val):
125
    def __init__(self, val):
122
        Directive.__init__(self, self.__class__.__name__, val)
126
        Directive.__init__(self, self.__class__.__name__, val)
123
127
128
class Group(Directive):
129
    def __init__(self, val):
130
        Directive.__init__(self, self.__class__.__name__, val)
131
124
class IfModule(ContainerTag):
132
class IfModule(ContainerTag):
125
    def __init__(self, dir, *args):
133
    def __init__(self, dir, *args):
126
        ContainerTag.__init__(self, self.__class__.__name__, dir, args)
134
        ContainerTag.__init__(self, self.__class__.__name__, dir, args)
Lines 273-278 Link Here
273
    def __init__(self, val):
281
    def __init__(self, val):
274
        Directive.__init__(self, self.__class__.__name__, val)
282
        Directive.__init__(self, self.__class__.__name__, val)
275
283
284
class User(Directive):
285
    def __init__(self, val):
286
        Directive.__init__(self, self.__class__.__name__, val)
287
276
class PythonInterpPerDirectory(Directive):
288
class PythonInterpPerDirectory(Directive):
277
    def __init__(self, val='Off'):
289
    def __init__(self, val='Off'):
278
        Directive.__init__(self, self.__class__.__name__, val)
290
        Directive.__init__(self, self.__class__.__name__, val)
(-)gentoo-3-2-8/test/testconf.py.in (+3 lines)
Lines 18-23 Link Here
18
# Path to the mod_python.so file, should be in the apache modules directory.
18
# Path to the mod_python.so file, should be in the apache modules directory.
19
MOD_PYTHON_SO="@MOD_PYTHON_SO@"
19
MOD_PYTHON_SO="@MOD_PYTHON_SO@"
20
20
21
USER="@TEST_USER@"
22
GROUP="@TEST_GROUP@"
23
21
# makes emacs go into python mode
24
# makes emacs go into python mode
22
### Local Variables:
25
### Local Variables:
23
### mode:python
26
### mode:python
(-)gentoo-3-2-8/test/test.py (-10 / +31 lines)
Lines 128-134 Link Here
128
        "testconf.py and change the variables HTTPD, TESTHOME, MOD_PYTHON_SO "
128
        "testconf.py and change the variables HTTPD, TESTHOME, MOD_PYTHON_SO "
129
        "and LIBEXECDIR according to their description in the file.\n"
129
        "and LIBEXECDIR according to their description in the file.\n"
130
    )  
130
    )  
131
    sys.exit()
131
    sys.exit(1)
132
else:
132
else:
133
    def testpath(variable,isfile):
133
    def testpath(variable,isfile):
134
        value = getattr(testconf,variable,'<undefined>')
134
        value = getattr(testconf,variable,'<undefined>')
Lines 151-157 Link Here
151
    good = testpath('MOD_PYTHON_SO',True) and good
151
    good = testpath('MOD_PYTHON_SO',True) and good
152
    if not good:
152
    if not good:
153
        print "Please check your testconf.py file"
153
        print "Please check your testconf.py file"
154
        sys.exit()
154
        sys.exit(1)
155
155
156
    del testpath
156
    del testpath
157
    del good
157
    del good
Lines 180-187 Link Here
180
CONFIG = os.path.join(TESTHOME, "conf", "test.conf")
180
CONFIG = os.path.join(TESTHOME, "conf", "test.conf")
181
DOCUMENT_ROOT = os.path.join(TESTHOME, "htdocs")
181
DOCUMENT_ROOT = os.path.join(TESTHOME, "htdocs")
182
PORT = 0 # this is set in fundUnusedPort()
182
PORT = 0 # this is set in fundUnusedPort()
183
 
183
184
    
184
SESSION_DIR = os.path.join(TESTHOME, 'session')
185
if os.path.exists(SESSION_DIR):
186
    shutil.rmtree(SESSION_DIR)
187
os.mkdir(SESSION_DIR)
188
os.chmod(SESSION_DIR, 0777)
189
185
# readBlockSize is required for the test_fileupload_* tests.
190
# readBlockSize is required for the test_fileupload_* tests.
186
# We can't import mod_python.util.readBlockSize from a cmd line
191
# We can't import mod_python.util.readBlockSize from a cmd line
187
# interpreter, so we'll hard code it here.
192
# interpreter, so we'll hard code it here.
Lines 303-308 Link Here
303
            IfModule("!mod_dir.c",
308
            IfModule("!mod_dir.c",
304
                     LoadModule("dir_module %s" %
309
                     LoadModule("dir_module %s" %
305
                                quoteIfSpace(os.path.join(modpath, "mod_dir.so")))),
310
                                quoteIfSpace(os.path.join(modpath, "mod_dir.so")))),
311
            Directory('/', AllowOverride('None')),
306
            ServerRoot(SERVER_ROOT),
312
            ServerRoot(SERVER_ROOT),
307
            ErrorLog("logs/error_log"),
313
            ErrorLog("logs/error_log"),
308
            LogLevel("debug"),
314
            LogLevel("debug"),
Lines 312-322 Link Here
312
            TypesConfig("conf/mime.types"),
318
            TypesConfig("conf/mime.types"),
313
            PidFile("logs/httpd.pid"),
319
            PidFile("logs/httpd.pid"),
314
            ServerName("127.0.0.1"),
320
            ServerName("127.0.0.1"),
315
            Listen(PORT),
321
            Listen("%s:%s" % ("127.0.0.1", PORT)),
316
            PythonOption('PythonOptionTest sample_value'),
322
            PythonOption('PythonOptionTest sample_value'),
317
            DocumentRoot(DOCUMENT_ROOT),
323
            DocumentRoot(DOCUMENT_ROOT),
318
            LoadModule("python_module %s" % quoteIfSpace(MOD_PYTHON_SO)))
324
            LoadModule("python_module %s" % quoteIfSpace(MOD_PYTHON_SO)))
319
325
326
        if testconf.USER:
327
            s.append(User(testconf.USER))
328
        if testconf.GROUP:
329
            s.append(Group(testconf.GROUP))
330
320
        if APACHE_VERSION == '2.2':
331
        if APACHE_VERSION == '2.2':
321
            # mod_auth has been split into mod_auth_basic and some other modules
332
            # mod_auth has been split into mod_auth_basic and some other modules
322
            s.append(IfModule("!mod_auth_basic.c",
333
            s.append(IfModule("!mod_auth_basic.c",
Lines 364-370 Link Here
364
        # Qemu will run about 1/10 the native speed, so 1 second may
375
        # Qemu will run about 1/10 the native speed, so 1 second may
365
        # not be long enough for apache to shut down.
376
        # not be long enough for apache to shut down.
366
        count = 0
377
        count = 0
367
        pid_file = os.path.join(os.getcwd(), 'logs/httpd.pid')
378
        pid_file = os.path.join(SERVER_ROOT, 'logs', 'httpd.pid')
368
        while os.path.exists(pid_file):
379
        while os.path.exists(pid_file):
369
            time.sleep(1)
380
            time.sleep(1)
370
            count += 1
381
            count += 1
Lines 1008-1023 Link Here
1008
            ugh = file('ugh.pdf','rb')
1019
            ugh = file('ugh.pdf','rb')
1009
            content = ugh.read()
1020
            content = ugh.read()
1010
            ugh.close()
1021
            ugh.close()
1022
            digest = md5.new(content).hexdigest()
1023
            if digest != '9e8c42be55aac825e7a34d448044d0fe':
1024
                raise Exception('bad ugh digest')
1011
        except:
1025
        except:
1012
            print "  * Skipping the test for The UNIX-HATERS handbook file upload."
1026
            print "  * Skipping the test for The UNIX-HATERS handbook file upload."
1013
            print "    To make this test, you need to download ugh.pdf from"
1027
            print "    To make this test, you need to download ugh.pdf from"
1014
            print "    http://research.microsoft.com/~daniel/uhh-download.html"
1028
            print "    http://research.microsoft.com/~daniel/uhh-download.html"
1015
            print "    into this script's directory."
1029
            print "    into this script's directory."
1030
1031
            if str(sys.exc_info()[1]) == 'bad ugh digest':
1032
                print "    (The file ugh.pdf that is currently present is not the "
1033
                print "    correct file; we're looking for a file with md5: "
1034
                print "    9e8c42be55aac825e7a34d448044d0fe.)"
1016
        else:
1035
        else:
1017
            print "  * Testing The UNIX-HATERS handbook file upload support"
1036
            print "  * Testing The UNIX-HATERS handbook file upload support"
1018
    
1037
    
1019
            digest = md5.new(content).hexdigest()
1020
    
1021
            rsp = self.vhost_post_multipart_form_data(
1038
            rsp = self.vhost_post_multipart_form_data(
1022
                "test_fileupload",
1039
                "test_fileupload",
1023
                variables={'test':'abcd'},
1040
                variables={'test':'abcd'},
Lines 1624-1629 Link Here
1624
                        ServerName("test_Session_Session"),
1641
                        ServerName("test_Session_Session"),
1625
                        DocumentRoot(DOCUMENT_ROOT),
1642
                        DocumentRoot(DOCUMENT_ROOT),
1626
                        Directory(DOCUMENT_ROOT,
1643
                        Directory(DOCUMENT_ROOT,
1644
                                  PythonOption('session_directory "%s"'%
1645
                                               SESSION_DIR),
1627
                                  SetHandler("mod_python"),
1646
                                  SetHandler("mod_python"),
1628
                                  PythonHandler("tests::Session_Session"),
1647
                                  PythonHandler("tests::Session_Session"),
1629
                                  PythonDebug("On")))
1648
                                  PythonDebug("On")))
Lines 1662-1667 Link Here
1662
                        ServerName("test_Session_Session"),
1681
                        ServerName("test_Session_Session"),
1663
                        DocumentRoot(DOCUMENT_ROOT),
1682
                        DocumentRoot(DOCUMENT_ROOT),
1664
                        Directory(DOCUMENT_ROOT,
1683
                        Directory(DOCUMENT_ROOT,
1684
                                  PythonOption('session_directory "%s"'%
1685
                                               SESSION_DIR),
1665
                                  SetHandler("mod_python"),
1686
                                  SetHandler("mod_python"),
1666
                                  PythonHandler("tests::Session_Session"),
1687
                                  PythonHandler("tests::Session_Session"),
1667
                                  PythonDebug("On")))
1688
                                  PythonDebug("On")))
Lines 2194-2198 Link Here
2194
    return mpTestSuite
2215
    return mpTestSuite
2195
2216
2196
tr = unittest.TextTestRunner()
2217
tr = unittest.TextTestRunner()
2197
tr.run(suite())
2218
result = tr.run(suite())
2198
2219
sys.exit(not result.wasSuccessful())
(-)gentoo-3-2-8/configure.in (-1 / +5 lines)
Lines 280-286 Link Here
280
280
281
# this for the test.py script
281
# this for the test.py script
282
AC_SUBST(TEST_SERVER_ROOT)
282
AC_SUBST(TEST_SERVER_ROOT)
283
TEST_SERVER_ROOT="`pwd`/test"
283
if test -z "$TEST_SERVER_ROOT"; then
284
  TEST_SERVER_ROOT="`pwd`/test"
285
fi
286
AC_SUBST(TEST_USER)
287
AC_SUBST(TEST_GROUP)
284
AC_SUBST(MOD_PYTHON_SO)
288
AC_SUBST(MOD_PYTHON_SO)
285
MOD_PYTHON_SO="`pwd`/src/mod_python.so"
289
MOD_PYTHON_SO="`pwd`/src/mod_python.so"
286
290

Return to bug 123852