diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2010-08-07 00:09:09 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-18 21:42:04 +0200 |
commit | c91cfd19160be63e97f28dce8c9af421b61c9938 (patch) | |
tree | 697fa90ba2ce81ec93ca5653d2138791e777ce82 /t/test-lib.sh | |
parent | t/README: Document the predefined test prerequisites (diff) | |
download | git-c91cfd19160be63e97f28dce8c9af421b61c9938.tar.xz git-c91cfd19160be63e97f28dce8c9af421b61c9938.zip |
tests: A SANITY test prereq for testing if we're root
Some tests depend on not being able to write to files after chmod
-w. This doesn't work when running the tests as root.
Change test-lib.sh to test if this works, and if so it sets a new
SANITY test prerequisite. The tests that use this previously failed
when run under root.
There was already a test for this in t3600-rm.sh, added by Junio C
Hamano in 2283645 in 2006. That check now uses the new SANITY
prerequisite.
Some of this was resurrected from the "Tests in Cygwin" thread in May
2009:
http://thread.gmane.org/gmane.comp.version-control.git/116729/focus=118385
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | t/test-lib.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index 9ded0eee18..78c4874465 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -897,3 +897,7 @@ test -z "$NO_PYTHON" && test_set_prereq PYTHON # test whether the filesystem supports symbolic links ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS rm -f y + +# When the tests are run as root, permission tests will report that +# things are writable when they shouldn't be. +test -w / || test_set_prereq SANITY |