]> git.cameronkatri.com Git - cgit.git/commitdiff
tests: skip tests if strace is not functional
authorChristian Hesse <mail@eworm.de>
Wed, 11 Dec 2019 09:55:24 +0000 (10:55 +0100)
committerChristian Hesse <mail@eworm.de>
Wed, 11 Dec 2019 10:04:02 +0000 (11:04 +0100)
Chances are that strace is available but not functional due to
restricted permissions:

strace: test_ptrace_get_syscall_info: PTRACE_TRACEME: Operation not permitted
strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted
+++ exited with 1 +++

Just skip the tests then.

Signed-off-by: Christian Hesse <mail@eworm.de>
tests/t0109-gitconfig.sh

index 3ba668490d977876f223b5d6262bb16f35e8f52b..8cee75cd00b3a2a947b238263b24fa80cd4da417 100755 (executable)
@@ -9,6 +9,12 @@ test -n "$(which strace 2>/dev/null)" || {
        exit
 }
 
+strace true 2>/dev/null || {
+       skip_all='Skipping access validation tests: strace not functional'
+       test_done
+       exit
+}
+
 test_no_home_access () {
        non_existent_path="/path/to/some/place/that/does/not/possibly/exist"
        while test -d "$non_existent_path"; do