[ostree: 30/70] tests: Make failing to kill the GPG agent non-fatal



commit bdf24cdc049b421d6e5a982ee9f25502407dceca
Author: Colin Walters <walters verbum org>
Date:   Thu Mar 31 13:46:16 2016 -0400

    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 3e4c4bd..03b498a 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 1b153e9..e469c0f 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 096c0e1..fa42d67 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 d5e27fc..49aa91a 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 dd2fcb0..40de0a6 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 aa90eb8..8d155f7 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"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]