ci: pass Valgrind options safely

This commit is contained in:
Zen Dodd committed 2026-10-10 12:03:02 +10:00
1 parent a36ade8776
commit 0a8db75394
2 files changed
+7 -7

No files matched your search

+6 -6
View File
@@ -73,14 +73,14 @@ jobs:
- name: run testsuite under valgrind
run: |
mkdir -p test-results/valgrind-logs
SUDO=
[ "${{ matrix.privilege }}" = root ] && SUDO="sudo -E"
TCP=
[ "${{ matrix.transport }}" = tcp ] && TCP="--use-tcp --daemon-tests-only"
$SUDO env RSYNC_TEST_PROFILES=${{ matrix.profiles }} scratchbase="$VALGRIND_SCRATCH" \
SUDO=()
[ "${{ matrix.privilege }}" = root ] && SUDO=(sudo -E)
TCP=()
[ "${{ matrix.transport }}" = tcp ] && TCP=(--use-tcp --daemon-tests-only)
"${SUDO[@]}" env RSYNC_TEST_PROFILES=${{ matrix.profiles }} scratchbase="$VALGRIND_SCRATCH" \
./testsuite/runtests.py --valgrind \
--valgrind-opts="--leak-check=no --error-exitcode=0" \
$TCP -j2 --timeout=600 --preserve-scratch \
"${TCP[@]}" -j2 --timeout=600 --preserve-scratch \
--receipt=test-results/valgrind-${{ matrix.privilege }}-${{ matrix.transport }}.json
- name: scan for unsuppressed valgrind errors
+1 -1
View File
@@ -131,7 +131,7 @@ for path in workflows:
if ('VALGRIND_SCRATCH: /tmp/' not in workflow
or 'scratchbase="$VALGRIND_SCRATCH"' not in workflow):
test_fail('valgrind.yml: scratch is not accessible after dropping privileges')
if 'TCP="--use-tcp --daemon-tests-only"' not in workflow:
if 'TCP=(--use-tcp --daemon-tests-only)' not in workflow:
test_fail('valgrind.yml: TCP pass repeats transport-independent tests')
if 'find testtmp' in workflow or 'testtmp/**/' in workflow:
test_fail('valgrind.yml: evidence collection traverses test fixtures')