Rev 40: Fix regression bug. in http://bazaar.launchpad.net/%7Evila/bzr/local-test-server

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Jun 25 19:36:49 BST 2008


At http://bazaar.launchpad.net/%7Evila/bzr/local-test-server

------------------------------------------------------------
revno: 40
revision-id: v.ladeuil+lp at free.fr-20080625183646-drh2cl7zn42hazwc
parent: v.ladeuil+lp at free.fr-20080624200635-u290d1dgy937ur93
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: local_test_server
timestamp: Wed 2008-06-25 20:36:46 +0200
message:
  Fix regression bug.
  
  * configs/vsftpd.conf: 
  Oops, forgoten file.
  
  * test_server.py:
  (LocalTestServer.setUp): Add backing_transport_server parameter.
  (LocalHTTPTestServer.setUp): Propagate backing_transport_server.
added:
  configs/vsftpd.conf            vsftpd.conf-20080625175438-q3dkee2la3emo8fo-1
modified:
  test_server.py                 test_server.py-20080530070615-f555godexnk7frms-1
-------------- next part --------------
=== added file 'configs/vsftpd.conf'
--- a/configs/vsftpd.conf	1970-01-01 00:00:00 +0000
+++ b/configs/vsftpd.conf	2008-06-25 18:36:46 +0000
@@ -0,0 +1,56 @@
+#
+# Based on /etc/vsftpd.conf in Ubuntu Gusty
+#
+
+# Run standalone?  vsftpd can run either from an inetd or as a standalone
+# daemon started from an initscript.
+listen=YES
+#background=YES
+run_as_launching_user=YES
+listen_port=%(port)s
+#
+# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
+anonymous_enable=YES
+no_anon_password=YES
+ftp_username=%(user)s
+anon_upload_enable=YES
+anon_mkdir_write_enable=YES
+anon_other_write_enable=YES
+#
+# Uncomment this to allow local users to log in.
+local_enable=YES
+#
+# Uncomment this to enable any form of FTP write command.
+write_enable=YES
+#
+# Default umask for local users is 077. You may wish to change this to 022,
+# if your users expect that (022 is used by most other ftpd's)
+local_umask=022
+#
+# Uncomment this to allow the anonymous FTP user to upload files. This only
+# has an effect if the above global write enable is activated. Also, you will
+# obviously need to create a directory writable by the FTP user.
+anon_upload_enable=YES
+#
+# Uncomment this if you want the anonymous FTP user to be able to create
+# new directories.
+anon_mkdir_write_enable=YES
+#
+# Activate directory messages - messages given to remote users when they
+# go into a certain directory.
+dirmessage_enable=YES
+#
+# Activate logging of uploads/downloads.
+xferlog_enable=YES
+vsftpd_log_file=%(log_file)s
+#
+# If you want, you can arrange for uploaded anonymous files to be owned by
+# a different user. Note! Using "root" for uploaded files is not
+# recommended!
+#chown_uploads=YES
+#chown_username=whoever
+# It is recommended that you define on your system a unique user which the
+# ftp server can use as a totally isolated and unprivileged user.
+#nopriv_user=ftpsecure
+#
+#

=== modified file 'test_server.py'
--- a/test_server.py	2008-06-24 20:06:35 +0000
+++ b/test_server.py	2008-06-25 18:36:46 +0000
@@ -31,7 +31,10 @@
     tests,
     transport,
     )
-from bzrlib.transport import ftp
+from bzrlib.transport import (
+    ftp,
+    local,
+    )
 from bzrlib.transport.http import (
     _urllib,
    )
@@ -119,9 +122,14 @@
         # etc
         return self._url_protocol + '://127.0.0.1:1/'
 
-    def setUp(self):
+    def setUp(self, backing_transport_server=None):
         """Build a specific directory to be served."""
         super(LocalTestServer, self).setUp()
+        if not (backing_transport_server is None or \
+                isinstance(backing_transport_server, local.LocalURLServer)):
+            raise AssertionError(
+                "LocalTestServer currently assumes local transport, got %s" % \
+                backing_transport_server)
         # Hard to believe, but the directory to be served is the current one at
         # setUp time...
         self._test_working_dir = os.getcwdu()
@@ -153,11 +161,11 @@
         os.symlink(self._test_working_dir,
                    osutils.pathjoin(data_dir, self._symlink_name))
 
-    def setUp(self):
+    def setUp(self, backing_transport_server=None):
         """Build a specific directory to be served."""
         # Hard to believe, but the directory to be served is the current one at
         # setUp time...
-        super(LocalHTTPTestServer, self).setUp()
+        super(LocalHTTPTestServer, self).setUp(backing_transport_server)
         self._build_symlink_under_data_dir()
 
     def tearDown(self):



More information about the bazaar-commits mailing list