test_lock_permission selftest fails when run as root

Bug #172893 reported by Thomas Klausner
This bug report is a duplicate of:  Bug #646133: Can't run the full test suite as root. Edit Remove
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

On 4.99.36/amd64, the bzr-0.92 selftests report one failure:
test_lockdir.TestLockDir.test_lock_permission FAIL 4ms
    LockFailed not raised

======================================================================
FAIL: test_lock_permission (bzrlib.tests.test_lockdir.TestLockDir)

vvvv[log from bzrlib.tests.test_lockdir.TestLockDir.test_lock_permission]-----
opening working tree '/tmp/testbzr-BH-TRe.tmp'

^^^^[log from bzrlib.tests.test_lockdir.TestLockDir.test_lock_permission]-----
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/obj/devel/bzr/work.x86_64/bzr-0.92/bzrlib/tests/test_lockdir.py", line 605, in test_lock_permission
    self.assertRaises(errors.LockFailed, ld1.attempt_lock)
AssertionError: LockFailed not raised

----------------------------------------------------------------------
Ran 1460 tests in 131.705s

FAILED (failures=1)
58 tests skipped
Missing feature '_UnicodeFilename' skipped 2 tests.

Revision history for this message
Thomas Klausner (tk-giga) wrote :

I meant, on NetBSD-4.99.36/amd64.

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 172893] test_lock_permission selftest fails

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas Klausner wrote:
> Public bug reported:
>
> On 4.99.36/amd64, the bzr-0.92 selftests report one failure:
> test_lockdir.TestLockDir.test_lock_permission FAIL 4ms
> LockFailed not raised

Are you running as root?

Aaron

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHTxx10F+nu1YWqI0RAtTNAJ9oNbRnscui0Mhnk7mp5sfZq8QckwCfeSU0
C/J+0YxrYT+SQNRyLKin1+8=
=oTxJ
-----END PGP SIGNATURE-----

Revision history for this message
Thomas Klausner (tk-giga) wrote : Re: test_lock_permission selftest fails

Yes, the tests are running as root.

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 172893] Re: test_lock_permission selftest fails

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas Klausner wrote:
> Yes, the tests are running as root.
>

That is why the test is failing.

We are testing that when a directories permissions are set to readonly, that
the process cannot lock the directory.

However, when running as root, the readonly flag doesn't mean anything. (root
can create files in a readonly directory without any problems.)

I suppose we could have the test check geteuid() == 0 and just skip/known
failure/missing feature (not root).

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHTyQNJdeBCYSNAAMRAo7OAKCeqpxq3yRzjQlGiexJ10qGF4ufpACdFXEU
NSXrI1pB+XriGObmGL5KrFg=
=g72p
-----END PGP SIGNATURE-----

Revision history for this message
Aaron Bentley (abentley) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas Klausner wrote:
> Yes, the tests are running as root.

That's why. Those tests are exercising bazaar's interaction with
filesystem permissions, but since you're running as root, you're
clobbering them.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHTySY0F+nu1YWqI0RApNNAJ9dj7k8EOc88T8FGdpxxhDJse+JngCfcHO2
JsvmRAtIBBxmioSlVqiYd4w=
=Ig1M
-----END PGP SIGNATURE-----

Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Martin Packman (gz) wrote :

This test and other similar ones have now been fixed in the 2.1 series onwards as part of the later bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.