[PATCH] t0109: skip if strace is broken

Samuel Lidén Borell samuel at kodafritt.se
Tue Dec 11 21:23:59 CET 2018


The strace binary might not work even though it is available. For instance,
ptrace might be disabled in the kernel or might be unsupported (e.g. when
running qemu-user for cross-building to another cpu arch). This patch skips
the t0109 tests in this case.

Signed-off-by: Samuel Lidén Borell <samuel at kodafritt.se>
---
P.S. This is my first patch to cgit. Criticism is welcome :)

 tests/t0109-gitconfig.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/t0109-gitconfig.sh b/tests/t0109-gitconfig.sh
index 3ba6684..9d7f074 100755
--- a/tests/t0109-gitconfig.sh
+++ b/tests/t0109-gitconfig.sh
@@ -9,6 +9,12 @@ test -n "$(which strace 2>/dev/null)" || {
 	exit
 }
 
+strace true >/dev/null 2>&1 || {
+	skip_all='Skipping access validation tests: strace is not working'
+	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
-- 
2.17.1




More information about the CGit mailing list