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 (+6 lines)
Lines 12-23 Link Here
12
# Path to the current directory
12
# Path to the current directory
13
TESTHOME="@TEST_SERVER_ROOT@"
13
TESTHOME="@TEST_SERVER_ROOT@"
14
14
15
# Path to python libraries, to be set in the apache environment
16
PYTHONPATH="@TEST_PYTHON_PATH@"
17
15
# Path to the Apache modules directory
18
# Path to the Apache modules directory
16
LIBEXECDIR="@LIBEXECDIR@"
19
LIBEXECDIR="@LIBEXECDIR@"
17
20
18
# Path to the mod_python.so file, should be in the apache modules directory.
21
# Path to the mod_python.so file, should be in the apache modules directory.
19
MOD_PYTHON_SO="@MOD_PYTHON_SO@"
22
MOD_PYTHON_SO="@MOD_PYTHON_SO@"
20
23
24
USER="@TEST_USER@"
25
GROUP="@TEST_GROUP@"
26
21
# makes emacs go into python mode
27
# makes emacs go into python mode
22
### Local Variables:
28
### Local Variables:
23
### mode:python
29
### mode:python
(-)gentoo-3-2-8/test/test.py (-10 / +33 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 343-348 Link Here
343
        httpd = quoteIfSpace(HTTPD)
354
        httpd = quoteIfSpace(HTTPD)
344
        config = quoteIfSpace(CONFIG)
355
        config = quoteIfSpace(CONFIG)
345
        cmd = '%s %s -k start -f %s' % (httpd, extra, config)
356
        cmd = '%s %s -k start -f %s' % (httpd, extra, config)
357
        if testconf.PYTHONPATH:
358
            cmd = "PYTHONPATH='%s' %s" % (testconf.PYTHONPATH, cmd)
346
        print "    ", cmd
359
        print "    ", cmd
347
        os.system(cmd)
360
        os.system(cmd)
348
        time.sleep(1)
361
        time.sleep(1)
Lines 364-370 Link Here
364
        # Qemu will run about 1/10 the native speed, so 1 second may
377
        # Qemu will run about 1/10 the native speed, so 1 second may
365
        # not be long enough for apache to shut down.
378
        # not be long enough for apache to shut down.
366
        count = 0
379
        count = 0
367
        pid_file = os.path.join(os.getcwd(), 'logs/httpd.pid')
380
        pid_file = os.path.join(SERVER_ROOT, 'logs', 'httpd.pid')
368
        while os.path.exists(pid_file):
381
        while os.path.exists(pid_file):
369
            time.sleep(1)
382
            time.sleep(1)
370
            count += 1
383
            count += 1
Lines 1008-1023 Link Here
1008
            ugh = file('ugh.pdf','rb')
1021
            ugh = file('ugh.pdf','rb')
1009
            content = ugh.read()
1022
            content = ugh.read()
1010
            ugh.close()
1023
            ugh.close()
1024
            digest = md5.new(content).hexdigest()
1025
            if digest != '9e8c42be55aac825e7a34d448044d0fe':
1026
                raise Exception('bad ugh digest')
1011
        except:
1027
        except:
1012
            print "  * Skipping the test for The UNIX-HATERS handbook file upload."
1028
            print "  * Skipping the test for The UNIX-HATERS handbook file upload."
1013
            print "    To make this test, you need to download ugh.pdf from"
1029
            print "    To make this test, you need to download ugh.pdf from"
1014
            print "    http://research.microsoft.com/~daniel/uhh-download.html"
1030
            print "    http://research.microsoft.com/~daniel/uhh-download.html"
1015
            print "    into this script's directory."
1031
            print "    into this script's directory."
1032
1033
            if str(sys.exc_info()[1]) == 'bad ugh digest':
1034
                print "    (The file ugh.pdf that is currently present is not the "
1035
                print "    correct file; we're looking for a file with md5: "
1036
                print "    9e8c42be55aac825e7a34d448044d0fe.)"
1016
        else:
1037
        else:
1017
            print "  * Testing The UNIX-HATERS handbook file upload support"
1038
            print "  * Testing The UNIX-HATERS handbook file upload support"
1018
    
1039
    
1019
            digest = md5.new(content).hexdigest()
1020
    
1021
            rsp = self.vhost_post_multipart_form_data(
1040
            rsp = self.vhost_post_multipart_form_data(
1022
                "test_fileupload",
1041
                "test_fileupload",
1023
                variables={'test':'abcd'},
1042
                variables={'test':'abcd'},
Lines 1624-1629 Link Here
1624
                        ServerName("test_Session_Session"),
1643
                        ServerName("test_Session_Session"),
1625
                        DocumentRoot(DOCUMENT_ROOT),
1644
                        DocumentRoot(DOCUMENT_ROOT),
1626
                        Directory(DOCUMENT_ROOT,
1645
                        Directory(DOCUMENT_ROOT,
1646
                                  PythonOption('session_directory "%s"'%
1647
                                               SESSION_DIR),
1627
                                  SetHandler("mod_python"),
1648
                                  SetHandler("mod_python"),
1628
                                  PythonHandler("tests::Session_Session"),
1649
                                  PythonHandler("tests::Session_Session"),
1629
                                  PythonDebug("On")))
1650
                                  PythonDebug("On")))
Lines 1662-1667 Link Here
1662
                        ServerName("test_Session_Session"),
1683
                        ServerName("test_Session_Session"),
1663
                        DocumentRoot(DOCUMENT_ROOT),
1684
                        DocumentRoot(DOCUMENT_ROOT),
1664
                        Directory(DOCUMENT_ROOT,
1685
                        Directory(DOCUMENT_ROOT,
1686
                                  PythonOption('session_directory "%s"'%
1687
                                               SESSION_DIR),
1665
                                  SetHandler("mod_python"),
1688
                                  SetHandler("mod_python"),
1666
                                  PythonHandler("tests::Session_Session"),
1689
                                  PythonHandler("tests::Session_Session"),
1667
                                  PythonDebug("On")))
1690
                                  PythonDebug("On")))
Lines 2194-2198 Link Here
2194
    return mpTestSuite
2217
    return mpTestSuite
2195
2218
2196
tr = unittest.TextTestRunner()
2219
tr = unittest.TextTestRunner()
2197
tr.run(suite())
2220
result = tr.run(suite())
2198
2221
sys.exit(not result.wasSuccessful())
(-)gentoo-3-2-8/configure.in (-1 / +6 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_PYTHON_PATH)
287
AC_SUBST(TEST_USER)
288
AC_SUBST(TEST_GROUP)
284
AC_SUBST(MOD_PYTHON_SO)
289
AC_SUBST(MOD_PYTHON_SO)
285
MOD_PYTHON_SO="`pwd`/src/mod_python.so"
290
MOD_PYTHON_SO="`pwd`/src/mod_python.so"
286
291

Return to bug 123852