# HG changeset patch # User Matt Mackall # Date 1384474063 21600 # Node ID 94e35118a7561d0f1608358de473046c742cd5a0 # Parent 761641fc16a63cdc1aa633f91147a939b912a135 tests: skip tests that require not having root (issue4089) This adds a new root hghave to test against. Almost all of these are a subset of unix-permissions, but that is also used for checking exec bit handling. [ original upstream message ] diff -r 761641fc16a6 -r 94e35118a756 tests/hghave.py --- a/tests/hghave.py Sat Oct 05 01:02:22 2013 +0900 +++ b/tests/hghave.py Thu Nov 14 18:07:43 2013 -0600 @@ -233,6 +233,9 @@ finally: os.rmdir(d) +def has_root(): + return os.geteuid() == 0 + def has_pyflakes(): return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"", r":1: 're' imported but unused", @@ -312,6 +315,7 @@ "p4": (has_p4, "Perforce server and client"), "pyflakes": (has_pyflakes, "Pyflakes python linter"), "pygments": (has_pygments, "Pygments source highlighting library"), + "root": (has_root, "root permissions"), "serve": (has_serve, "platform and python can manage 'hg serve -d'"), "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"), "svn": (has_svn, "subversion client and admin tools"),