Rev 4862: Merge bzr/2.1 in file:///home/vila/src/bzr/bugs/644855-test-isolation/

Vincent Ladeuil v.ladeuil+lp at free.fr
Sat Sep 25 11:41:08 BST 2010


At file:///home/vila/src/bzr/bugs/644855-test-isolation/

------------------------------------------------------------
revno: 4862 [merge]
revision-id: v.ladeuil+lp at free.fr-20100925104108-jpnuhmjsdeh0ny74
parent: v.ladeuil+lp at free.fr-20100923135255-klreg6r84zfnmqdi
parent: pqm at pqm.ubuntu.com-20100924043554-6vth0ppq1tyfsq8i
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 644855-test-isolation
timestamp: Sat 2010-09-25 12:41:08 +0200
message:
  Merge bzr/2.1
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/features.py       features.py-20090820042958-jglgza3wrn03ha9e-1
  bzrlib/tests/per_lock/test_lock.py test_lock.py-20070313190612-mfpoa7t8kvrgrhj2-1
  bzrlib/tests/test_lockdir.py   test_lockdir.py-20060220222025-33d4221569a3d600
  bzrlib/tests/test_osutils.py   test_osutils.py-20051201224856-e48ee24c12182989
  bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
  doc/en/user-guide/branching_a_project.txt branching_a_project.-20071122141511-0knao2lklsdsvb1q-2
  doc/en/user-guide/configuring_bazaar.txt configuring_bazaar.t-20071128000722-ncxiua259xwbdbg7-1
  doc/en/user-guide/plugins.txt  plugins.txt-20060314145616-525099a747f3ffdd
  doc/en/user-guide/sending_changes.txt sending_changes.txt-20071123154453-dk2mjhrg1vpjm5w2-4
  doc/en/user-guide/setting_up_email.txt setting_up_email.txt-20060314161707-fd242c8944346173
  doc/en/user-guide/specifying_revisions.txt specifying_revisions.txt-20060314161707-19deb139101bea33
  doc/en/user-guide/version_info.txt version_info.txt-20060921215543-gju6o5xdic8w25np-1
  doc/en/user-guide/writing_a_plugin.txt writing_a_plugin.txt-20071114035000-q36a9h57ps06uvnl-7
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2010-09-23 13:52:55 +0000
+++ b/NEWS	2010-09-25 10:41:08 +0000
@@ -23,6 +23,9 @@
   needed to succesfully run the test suite for installed versions.
   (Vincent Ladeuil, #644855).
 
+* Skip the tests that requires respecting the chmod bits when running as root.
+  (Vincent Ladeuil, #646133)
+
 Improvements
 ************
 

=== modified file 'bzrlib/tests/features.py'
--- a/bzrlib/tests/features.py	2010-02-17 17:11:16 +0000
+++ b/bzrlib/tests/features.py	2010-09-23 16:37:27 +0000
@@ -14,11 +14,27 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
+import os
 
 from bzrlib import tests
 from bzrlib.symbol_versioning import deprecated_in
 
 
+class _NotRunningAsRoot(tests.Feature):
+
+    def _probe(self):
+        try:
+            uid = os.getuid()
+        except AttributeError:
+            # If there is no uid, chances are there is no root either
+            return True
+        return uid != 0
+
+    def feature_name(self):
+        return 'Not running as root'
+
+
+not_running_as_root = _NotRunningAsRoot()
 apport = tests.ModuleAvailableFeature('apport')
 ApportFeature = tests._CompatabilityThunkFeature('bzrlib.tests.features',
     'ApportFeature', 'bzrlib.tests.features.apport', deprecated_in((2,1,0)))

=== modified file 'bzrlib/tests/per_lock/test_lock.py'
--- a/bzrlib/tests/per_lock/test_lock.py	2009-07-07 09:00:59 +0000
+++ b/bzrlib/tests/per_lock/test_lock.py	2010-09-23 16:37:27 +0000
@@ -21,7 +21,7 @@
     osutils,
     )
 
-from bzrlib.tests import UnicodeFilenameFeature
+from bzrlib.tests import (features, UnicodeFilenameFeature)
 from bzrlib.tests.per_lock import TestCaseWithLock
 
 
@@ -63,6 +63,7 @@
 
         But we shouldn't be able to take a write lock.
         """
+        self.requireFeature(features.not_running_as_root)
         osutils.make_readonly('a-file')
         # Make sure the file is read-only (on all platforms)
         self.assertRaises(IOError, open, 'a-file', 'rb+')

=== modified file 'bzrlib/tests/test_lockdir.py'
--- a/bzrlib/tests/test_lockdir.py	2010-09-10 05:13:57 +0000
+++ b/bzrlib/tests/test_lockdir.py	2010-09-23 16:37:27 +0000
@@ -39,7 +39,7 @@
     LockNotHeld,
     )
 from bzrlib.lockdir import LockDir
-from bzrlib.tests import TestCaseWithTransport
+from bzrlib.tests import (features, TestCaseWithTransport)
 from bzrlib.trace import note
 
 # These tests sometimes use threads to test the behaviour of lock files with
@@ -669,6 +669,7 @@
         ld1.unlock()
 
     def test_lock_permission(self):
+        self.requireFeature(features.not_running_as_root)
         if not osutils.supports_posix_readonly():
             raise tests.TestSkipped('Cannot induce a permission failure')
         ld1 = self.get_lock()

=== modified file 'bzrlib/tests/test_osutils.py'
--- a/bzrlib/tests/test_osutils.py	2010-05-27 04:00:01 +0000
+++ b/bzrlib/tests/test_osutils.py	2010-09-23 16:37:27 +0000
@@ -33,6 +33,7 @@
     win32utils,
     )
 from bzrlib.tests import (
+    features,
     file_utils,
     test__walkdirs_win32,
     )
@@ -1067,6 +1068,7 @@
         if sys.platform == 'win32':
             raise tests.TestNotApplicable(
                 "readdir IOError not tested on win32")
+        self.requireFeature(features.not_running_as_root)
         os.mkdir("test-unreadable")
         os.chmod("test-unreadable", 0000)
         # must chmod it back so that it can be removed

=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py	2010-02-17 17:11:16 +0000
+++ b/bzrlib/tests/test_selftest.py	2010-09-23 16:37:27 +0000
@@ -609,12 +609,13 @@
                 l.attempt_lock()
         test = TestDanglingLock('test_function')
         result = test.run()
+        total_failures = result.errors + result.failures
         if self._lock_check_thorough:
-            self.assertEqual(1, len(result.errors))
+            self.assertEqual(1, len(total_failures))
         else:
             # When _lock_check_thorough is disabled, then we don't trigger a
             # failure
-            self.assertEqual(0, len(result.errors))
+            self.assertEqual(0, len(total_failures))
 
 
 class TestTestCaseWithTransport(tests.TestCaseWithTransport):

=== modified file 'doc/en/user-guide/branching_a_project.txt'
--- a/doc/en/user-guide/branching_a_project.txt	2009-12-02 20:34:07 +0000
+++ b/doc/en/user-guide/branching_a_project.txt	2010-09-20 07:18:01 +0000
@@ -27,7 +27,7 @@
 prefix indicating the transfer technology. If no prefix is given,
 normal filenames are assumed. For a complete list of supported
 protocols, see the ``urlspec`` online help topic or the
-`URL Identifiers <../user-reference/bzr_man.html#url-identifiers>`_
+`URL Identifiers <../user-reference/urlspec-help.html>`_
 section of the Bazaar User Reference.
 
 A reminder about shared repositories

=== modified file 'doc/en/user-guide/configuring_bazaar.txt'
--- a/doc/en/user-guide/configuring_bazaar.txt	2009-12-02 20:34:07 +0000
+++ b/doc/en/user-guide/configuring_bazaar.txt	2010-09-20 07:18:01 +0000
@@ -44,7 +44,7 @@
   email = Your Name <email at example.com>
 
 For further details on the syntax and configuration settings supported, see
-`Configuration Settings <../user-reference/bzr_man.html#configuration-settings>`_
+`Configuration Settings <../user-reference/configuration-help.html>`_
 in the Bazaar User Reference.
 
 
@@ -56,5 +56,5 @@
 ``BZR_HOME/rules``.
 
 For further information on how rules are searched and the detailed syntax of
-the relevant files, see `Rules <../user-reference/bzr_man.html#rules>`_
+the relevant files, see `Rules <../user-reference/rules-help.html>`_
 in the Bazaar User Reference.

=== modified file 'doc/en/user-guide/plugins.txt'
--- a/doc/en/user-guide/plugins.txt	2009-12-02 20:34:07 +0000
+++ b/doc/en/user-guide/plugins.txt	2010-09-20 07:18:01 +0000
@@ -59,8 +59,8 @@
 If you have the necessary permissions, plugins can also be installed on a
 system-wide basis.  One can additionally override the personal plugins
 location by setting the environment variable ``BZR_PLUGIN_PATH`` (see `User
-Reference <../user-reference/bzr_man.html#bzr-plugin-path>`_ for a detailed
-explanation).
+Reference <../user-reference/configuration-help.html#bzr-plugin-path>`_ 
+for a detailed explanation).
 
 Listing the installed plugins
 -----------------------------

=== modified file 'doc/en/user-guide/sending_changes.txt'
--- a/doc/en/user-guide/sending_changes.txt	2009-12-02 20:34:07 +0000
+++ b/doc/en/user-guide/sending_changes.txt	2010-09-20 07:18:01 +0000
@@ -42,7 +42,7 @@
 ``send`` without options will create a merge directive, fire up your email
 tool and attach it, ready for you to add the explanatory text bit.
 (See the online help for ``send`` and
-`Configuration Settings <../user-reference/bzr_man.html#configuration-settings>`_
+`Configuration Settings <../user-reference/configuration-help.html>`_
 in the User Reference for further details on how to configure this.)
 
 Most projects like people to add some explanation to the mail along with

=== modified file 'doc/en/user-guide/setting_up_email.txt'
--- a/doc/en/user-guide/setting_up_email.txt	2009-12-02 20:34:07 +0000
+++ b/doc/en/user-guide/setting_up_email.txt	2010-09-20 07:18:01 +0000
@@ -74,7 +74,7 @@
 For more information on the ini file format, see `Configuration Settings`_ in
 the Bazaar User Reference.
 
-.. _Configuration Settings: ../user-reference/bzr_man.html#configuration-settings
+.. _Configuration Settings: ../user-reference/configuration-help.html
 
 Setting email on a per-branch basis
 -----------------------------------

=== modified file 'doc/en/user-guide/specifying_revisions.txt'
--- a/doc/en/user-guide/specifying_revisions.txt	2009-12-02 23:09:40 +0000
+++ b/doc/en/user-guide/specifying_revisions.txt	2010-09-20 07:18:01 +0000
@@ -65,7 +65,7 @@
 For complete details, see `Revision Identifiers`_ in the
 Bazaar User Reference.
 
-.. _Revision Identifiers: ../user-reference/bzr_man.html#revision-identifiers
+.. _Revision Identifiers: ../user-reference/revisionspec-help.html
 
 Numbers
 ~~~~~~~

=== modified file 'doc/en/user-guide/version_info.txt'
--- a/doc/en/user-guide/version_info.txt	2009-12-02 20:34:07 +0000
+++ b/doc/en/user-guide/version_info.txt	2010-09-20 07:18:01 +0000
@@ -87,7 +87,7 @@
 variables that can be used in templates, see `Version Info`_ in the
 Bazaar User Reference.
 
-.. _Version Info: ../user-reference/bzr_man.html#version-info
+.. _Version Info: ../user-reference/version-info-help.html
 
 Predefined formats for dumping version information in specific languages
 are currently in development. Please contact us on the mailing list about

=== modified file 'doc/en/user-guide/writing_a_plugin.txt'
--- a/doc/en/user-guide/writing_a_plugin.txt	2009-08-20 13:26:36 +0000
+++ b/doc/en/user-guide/writing_a_plugin.txt	2010-09-20 07:18:01 +0000
@@ -34,8 +34,8 @@
 
 Bzr will scan ``~/.bazaar/plugins``  and ``bzrlib/plugins`` for plugins
 by default.  You can override this with  ``BZR_PLUGIN_PATH``
-(see `User Reference <../user-reference/bzr_man.html#bzr-plugin-path>`_
-for details).
+(see `User Reference 
+<../user-reference/configuration-help.html#bzr-plugin-path>`_ for details).
 
 Plugins may be either modules or packages.  If your plugin is a single
 file, you can structure it as a module.  If it has multiple files, or if



More information about the bazaar-commits mailing list