summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2019-06-03 12:12:43 +0300
committerPanu Matilainen <pmatilai@redhat.com>2020-03-26 11:57:58 +0200
commit08a10f461eb53fd361a4086feb281f30eb877782 (patch)
tree74b41316fa6fc9d475d91569ec5d690c8a5f0ad3
parenta97b54b60b4944324a3c664fc60b31b8911f3b83 (diff)
downloadrpm-08a10f461eb53fd361a4086feb281f30eb877782.tar.gz
Fix defunct gpg-agents lingering around after test-suite
There appears to be a some sort of race inside make distcheck where the second run of the test-suite gets stuck trying to kill the gpg-agent of previous run, it seems to close the connection but then gets "connection reset by peer" error, drops into the gpg-connect-agent prompt and refuses to die. My theory is that this has to do with distcheck nuking the directory in between but that's just a theory, I can't reproduce this locally to debug properly. The simpler approach of "gpgconf --kill gpg-agent" appears to help it not getting tangled up in its own feet, but lets not leave those agents spying around after the test-suite completes to begin with. Leaving the initial gpg-agent shutdown in place to cope with situations where the test-suite is aborted (ctrl-c or such). (cherry picked from commit 7e4472159b173e09c7e6758eac61036d12dddbf7)
-rw-r--r--tests/Makefile.am6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f7a340d63..5f5207e56 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -121,10 +121,12 @@ atlocal: atlocal.in Makefile
DISTCLEANFILES = atlocal
EXTRA_DIST += atlocal.in
+KILLAGENT = gpgconf --kill gpg-agent
+
# Hack: Abusing testing$(bindir)/rpmbuild as stamp file
# The chmod is needed when copying from read-only sources (eg in distcheck)
testing$(bindir)/rpmbuild: ../rpmbuild
- HOME=$(abs_builddir)/testing gpg-connect-agent --no-autostart killagent bye ||:
+ HOME=$(abs_builddir)/testing $(KILLAGENT) ||:
rm -rf testing
mkdir -p testing/$(bindir)
ln -s ./$(bindir) testing/bin
@@ -148,6 +150,7 @@ check_DATA += testing$(bindir)/rpmbuild
if HAVE_FAKECHROOT
check-local: $(check_DATA)
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
+ HOME=$(abs_builddir)/testing $(KILLAGENT) ||:
else
check-local:
echo "you need to have fakechroot installed"
@@ -156,6 +159,7 @@ endif !HAVE_FAKECHROOT
installcheck-local: $(check_DATA)
$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' $(TESTSUITEFLAGS)
+ HOME=$(abs_builddir)/testing $(KILLAGENT) ||:
clean-local:
test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' --clean