Skip to content
Snippets Groups Projects
Commit 5fbd1959 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Coverage hack for test_switch_id.sh

This hack provides a way to make sure we can see coverage from
test-switch-id.  If you set OVERRIDE_GCDA_PERMISSIONS_HACK, we
temporarily make the .gcda files mode 0666 before we run the
test scripts, and then we set them to 0644 again afterwards.

That's necessary because the test_switch_id.sh script does a
setuid() to 'nobody' part way through, and drops the ability to
change its mind back.
parent 603cb712
Branches bug16937-02
No related tags found
No related merge requests found
......@@ -10,6 +10,10 @@ if test "`id -u nobody`" = ""; then
exit 1
fi
if test "$OVERRIDE_GCDA_PERMISSIONS_HACK" = "yes"; then
find src -type f -name '*gcda' -print0 | xargs -0 chmod 0666
fi
"${builddir:-.}/src/test/test-switch-id" nobody setuid || exit 1
"${builddir:-.}/src/test/test-switch-id" nobody root-bind-low || exit 1
"${builddir:-.}/src/test/test-switch-id" nobody setuid-strict || exit 1
......@@ -19,6 +23,9 @@ fi
"${builddir:-.}/src/test/test-switch-id" nobody have-caps || exit 1
"${builddir:-.}/src/test/test-switch-id" nobody setuid-keepcaps || exit 1
if test "$OVERRIDE_GCDA_PERMISSIONS_HACK" = "yes"; then
find src -type f -name '*gcda' -print0 | xargs -0 chmod 0644
fi
echo "All okay"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment