From bdf24cdc049b421d6e5a982ee9f25502407dceca Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 31 Mar 2016 13:46:16 -0400 Subject: [PATCH] tests: Make failing to kill the GPG agent non-fatal It's not working for me in `make check` on a RHEL 7 Workstation, apparently because no GPG agent is spawned. I'm guessing this has something to do with the GPG version? The downside of this is we will be less likely to notice if GPG changes again and we start leaking agents like we're in The Matrix Reloaded. But the real solution to that is containers anyways. Closes: #233 Approved by: smcv --- tests/libtest.sh | 4 ++++ tests/test-commit-sign.sh | 2 +- tests/test-gpg-signed-commit.sh | 2 +- tests/test-pull-mirror-summary.sh | 2 +- tests/test-pull-summary-sigs.sh | 2 +- tests/test-remote-gpg-import.sh | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/libtest.sh b/tests/libtest.sh index 3e4c4bd6..03b498aa 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -349,3 +349,7 @@ skip_without_fuse () { exit 0 fi } + +libtest_cleanup_gpg () { + gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye || true +} diff --git a/tests/test-commit-sign.sh b/tests/test-commit-sign.sh index 1b153e9a..e469c0f9 100755 --- a/tests/test-commit-sign.sh +++ b/tests/test-commit-sign.sh @@ -132,6 +132,6 @@ if ${CMD_PREFIX} ostree --repo=repo show main | grep -o 'Found [[:digit:]] signa fi rm -rf repo gnomerepo-files -gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye +libtest_cleanup_gpg echo "ok" diff --git a/tests/test-gpg-signed-commit.sh b/tests/test-gpg-signed-commit.sh index 096c0e1c..fa42d677 100755 --- a/tests/test-gpg-signed-commit.sh +++ b/tests/test-gpg-signed-commit.sh @@ -78,6 +78,6 @@ if ${OSTREE} show test2 | grep -o 'Found [[:digit:]] signature'; then assert_not_reached fi -gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye +libtest_cleanup_gpg echo "ok" diff --git a/tests/test-pull-mirror-summary.sh b/tests/test-pull-mirror-summary.sh index d5e27fc8..49aa91ad 100755 --- a/tests/test-pull-mirror-summary.sh +++ b/tests/test-pull-mirror-summary.sh @@ -122,4 +122,4 @@ echo "ok pull mirror with invalid summary sig and no verification" # echo "ok pull mirror with signed summary covering static deltas" -gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye +libtest_cleanup_gpg diff --git a/tests/test-pull-summary-sigs.sh b/tests/test-pull-summary-sigs.sh index dd2fcb0f..40de0a66 100755 --- a/tests/test-pull-summary-sigs.sh +++ b/tests/test-pull-summary-sigs.sh @@ -134,4 +134,4 @@ grep static-deltas summary.txt > static-deltas.txt assert_file_has_content static-deltas.txt \ $(${OSTREE} --repo=repo rev-parse origin:main) -gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye +libtest_cleanup_gpg diff --git a/tests/test-remote-gpg-import.sh b/tests/test-remote-gpg-import.sh index aa90eb89..8d155f79 100755 --- a/tests/test-remote-gpg-import.sh +++ b/tests/test-remote-gpg-import.sh @@ -143,5 +143,5 @@ if ${OSTREE} pull R2:main >/dev/null 2>&1; then fi ${OSTREE} pull R3:main >/dev/null -gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye +libtest_cleanup_gpg echo "ok"