Rev 37: All servers needs a directory to serve, data_dir instead of www_dir. in http://bazaar.launchpad.net/%7Evila/bzr/local-test-server
Vincent Ladeuil
v.ladeuil+lp at free.fr
Tue Jun 24 17:52:58 BST 2008
At http://bazaar.launchpad.net/%7Evila/bzr/local-test-server
------------------------------------------------------------
revno: 37
revision-id: v.ladeuil+lp at free.fr-20080624165255-qq035rl1krim1oi4
parent: v.ladeuil+lp at free.fr-20080624163828-2cfbhopdonwnuov7
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: local_test_server
timestamp: Tue 2008-06-24 18:52:55 +0200
message:
All servers needs a directory to serve, data_dir instead of www_dir.
* tests/test_config.py:
(TestConfig.test_config_defines_keywords): Use
data_dir instead of www_dir.
* tests/test_test_server.py:
(TestTestServer.test_server_setup_and_teardown): Use
data_dir instead of www_dir.
* test_server.py:
(LocalHTTPTestServer.setUp, LocalHTTPTestServer.tearDown): Use
data_dir instead of www_dir.
* configs/lighttpd.conf:
* configs/lighttpd-dav.conf:
* configs/cherokee.conf:
* configs/apache2.conf:
* configs/apache2-svn.conf:
* configs/apache2-dav.conf:
Use data_dir instead of www_dir.
* config.py:
(Config.__init__): Add data_dir to replace www_dir.
(HttpConfig): Simplified. Too much ?
modified:
config.py __init__.py-20080523170713-0c8mnxio9r41iyhk-1
configs/apache2-dav.conf apache2dav.conf-20080604211810-6j1dwqo255dl2bc6-1
configs/apache2-svn.conf apache2svn.conf-20080613143012-cf693bo3ev1cah0f-1
configs/apache2.conf apache2.conf-20080522095851-6eixwo2qv9brec67-1
configs/cherokee.conf cherokee.conf-20080602161043-hiehb0n7zkbabaec-1
configs/lighttpd-dav.conf lighttpddav.conf-20080606163133-imyg87zvcmugxs4p-1
configs/lighttpd.conf lighttpd.conf-20080604073047-7ngngi8xixi50ubv-1
test_server.py test_server.py-20080530070615-f555godexnk7frms-1
tests/test_config.py test_config.py-20080523170715-clr6vz0qdzefftob-1
tests/test_test_server.py test_test_server.py-20080530070620-xatqa0pbxvo7u2v0-1
-------------- next part --------------
=== modified file 'config.py'
--- a/config.py 2008-06-22 16:48:31 +0000
+++ b/config.py 2008-06-24 16:52:55 +0000
@@ -60,7 +60,7 @@
# We need at least a place to put the generated configuration file and
# the pidfile.
self.required_dirs = dict(etc_dir='etc', var_run_dir='var/run',
- var_log_dir='var/log')
+ var_log_dir='var/log', data_dir='data')
if required_dirs is not None:
self.required_dirs.update(required_dirs)
@@ -100,12 +100,7 @@
class HttpConfig(Config):
-
- def __init__(self, name, required_dirs=None, _base_dir=None):
- if required_dirs is None:
- required_dirs = {}
- required_dirs['www_dir'] = 'www'
- super(HttpConfig, self).__init__(name, required_dirs, _base_dir)
+ """Common base class for all http servers."""
class Apache2(HttpConfig):
=== modified file 'configs/apache2-dav.conf'
--- a/configs/apache2-dav.conf 2008-06-08 22:39:58 +0000
+++ b/configs/apache2-dav.conf 2008-06-24 16:52:55 +0000
@@ -33,7 +33,7 @@
# Tests will create symlinks in that directory to point to the
# appropriate location
-DocumentRoot %(www_dir)s
+DocumentRoot %(data_dir)s
# required for
#bzrlib.tests.test_transport_implementations.TransportTests.test_has_root_works
@@ -48,7 +48,7 @@
LoadModule dav_fs_module /usr/lib/apache2/modules/mod_dav_fs.so
DAVLockDB %(var_lock_dir)s/DAVLock
-<Directory %(www_dir)s>
+<Directory %(data_dir)s>
DAV On
# DirectorySlash tells apache to reply with redirections if
# directories miss their final '/'. It does not play well with
=== modified file 'configs/apache2-svn.conf'
--- a/configs/apache2-svn.conf 2008-06-13 15:10:45 +0000
+++ b/configs/apache2-svn.conf 2008-06-24 16:52:55 +0000
@@ -33,7 +33,7 @@
# Tests will create symlinks in that directory to point to the
# appropriate location
-DocumentRoot %(www_dir)s
+DocumentRoot %(data_dir)s
# required for
#bzrlib.tests.test_transport_implementations.TransportTests.test_has_root_works
@@ -47,7 +47,7 @@
LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so
-<Directory %(www_dir)s>
+<Directory %(data_dir)s>
DAV svn
SVNPath %(svn_dir)s
</Directory>
=== modified file 'configs/apache2.conf'
--- a/configs/apache2.conf 2008-06-04 19:23:36 +0000
+++ b/configs/apache2.conf 2008-06-24 16:52:55 +0000
@@ -33,7 +33,7 @@
# Tests will create symlinks in that directory to point to the
# appropriate location
-DocumentRoot %(www_dir)s
+DocumentRoot %(data_dir)s
# required for
#bzrlib.tests.test_transport_implementations.TransportTests.test_has_root_works
=== modified file 'configs/cherokee.conf'
--- a/configs/cherokee.conf 2008-06-04 19:23:36 +0000
+++ b/configs/cherokee.conf 2008-06-24 16:52:55 +0000
@@ -15,7 +15,7 @@
# Tests will create symlinks in that directory to point to the
# appropriate location
-DocumentRoot %(www_dir)s
+DocumentRoot %(data_dir)s
Log combined {
AccessLog %(var_log_dir)s/access.log
=== modified file 'configs/lighttpd-dav.conf'
--- a/configs/lighttpd-dav.conf 2008-06-07 13:51:50 +0000
+++ b/configs/lighttpd-dav.conf 2008-06-24 16:52:55 +0000
@@ -22,7 +22,7 @@
# Tests will create symlinks in that directory to point to the
# appropriate location
-server.document-root = "%(www_dir)s"
+server.document-root = "%(data_dir)s"
# required for
#bzrlib.tests.test_transport_implementations.TransportTests.test_has_root_works
=== modified file 'configs/lighttpd.conf'
--- a/configs/lighttpd.conf 2008-06-04 19:23:36 +0000
+++ b/configs/lighttpd.conf 2008-06-24 16:52:55 +0000
@@ -22,7 +22,7 @@
# Tests will create symlinks in that directory to point to the
# appropriate location
-server.document-root = "%(www_dir)s"
+server.document-root = "%(data_dir)s"
# required for
#bzrlib.tests.test_transport_implementations.TransportTests.test_has_root_works
=== modified file 'test_server.py'
--- a/test_server.py 2008-06-15 08:59:23 +0000
+++ b/test_server.py 2008-06-24 16:52:55 +0000
@@ -122,14 +122,14 @@
rnd_name = '%3d%9f' % (random.randint(0, 0x7FFFFFFF), time.time())
self._symlink_name = rnd_name
- www_dir = self._server.get_config_value('www_dir')
+ data_dir = self._server.get_config_value('data_dir')
os.symlink(self._base_dir,
- osutils.pathjoin(www_dir, self._symlink_name))
+ osutils.pathjoin(data_dir, self._symlink_name))
def tearDown(self):
"""See bzrlib.transport.Server.tearDown."""
- www_dir = self._server.get_config_value('www_dir')
- osutils.delete_any(osutils.pathjoin(www_dir, self._symlink_name))
+ data_dir = self._server.get_config_value('data_dir')
+ osutils.delete_any(osutils.pathjoin(data_dir, self._symlink_name))
def get_url(self):
"""See bzrlib.transport.Server.get_url."""
=== modified file 'tests/test_config.py'
--- a/tests/test_config.py 2008-06-04 11:15:13 +0000
+++ b/tests/test_config.py 2008-06-24 16:52:55 +0000
@@ -108,7 +108,7 @@
self._check_conf_path(conf, 'log_file', 'var/log/error.log')
self._check_conf_path(conf, 'pid_file',
'var/run/%s.pid' % self._server_name)
- self._check_conf_path(conf, 'www_dir', 'www')
+ self._check_conf_path(conf, 'data_dir', 'data')
class TestConfigApache2(tests.TestCaseInTempDir, test_utils.TestLocalServer,
=== modified file 'tests/test_test_server.py'
--- a/tests/test_test_server.py 2008-06-04 07:38:06 +0000
+++ b/tests/test_test_server.py 2008-06-24 16:52:55 +0000
@@ -71,8 +71,8 @@
self.addCleanup(ts._server.stop)
ts.setUp()
- www_dir = ts._server.get_config_value('www_dir')
- served_dir = osutils.pathjoin(www_dir, ts._symlink_name)
+ data_dir = ts._server.get_config_value('data_dir')
+ served_dir = osutils.pathjoin(data_dir, ts._symlink_name)
self.assertIsSameRealPath(served_dir, self.test_dir)
ts.tearDown()
More information about the bazaar-commits
mailing list