--- bzrlib/tests/test_lockdir.py 2007-08-28 22:51:01.000000000 +0300 +++ bzrlib/tests/test_lockdir.py 2007-08-31 15:54:46.000000000 +0300 @@ -594,6 +594,8 @@ def test_lock_permission(self): if not osutils.supports_posix_readonly(): raise tests.TestSkipped('Cannot induce a permission failure') + if not os.getuid(): + raise tests.TestSkipped('Running as root') ld1 = self.get_lock() lock_path = ld1.transport.local_abspath('test_lock') os.mkdir(lock_path) --- bzrlib/tests/per_lock/test_lock.py 2007-08-28 22:51:00.000000000 +0300 +++ bzrlib/tests/per_lock/test_lock.py 2007-08-31 16:34:22.000000000 +0300 @@ -22,6 +22,7 @@ ) from bzrlib.tests.per_lock import TestCaseWithLock +from bzrlib.tests import TestSkipped class TestLock(TestCaseWithLock): @@ -62,6 +63,8 @@ But we shouldn't be able to take a write lock. """ + if not osutils.os.getuid(): + raise TestSkipped('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+')