You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by kr...@apache.org on 2022/11/11 19:06:14 UTC

[solr] branch branch_9x updated: SOLR-16132: Smoketester stop gpg-agent after use (#1176)

This is an automated email from the ASF dual-hosted git repository.

krisden pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new d7f3659a9d3 SOLR-16132: Smoketester stop gpg-agent after use (#1176)
d7f3659a9d3 is described below

commit d7f3659a9d35e21c77136d1f131cc4c846d5a8c6
Author: Kevin Risden <ri...@users.noreply.github.com>
AuthorDate: Fri Nov 11 14:02:13 2022 -0500

    SOLR-16132: Smoketester stop gpg-agent after use (#1176)
---
 dev-tools/scripts/smokeTestRelease.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py
index 00fd2b16e75..5a78213d298 100755
--- a/dev-tools/scripts/smokeTestRelease.py
+++ b/dev-tools/scripts/smokeTestRelease.py
@@ -277,16 +277,19 @@ def checkSigs(urlString, version, tmpDir, isSigned, keysFile):
   if os.path.exists(gpgHomeDir):
     shutil.rmtree(gpgHomeDir)
   os.makedirs(gpgHomeDir, 0o700)
-  run('gpg --homedir %s --import %s' % (gpgHomeDir, keysFile),
-      '%s/solr.gpg.import.log' % tmpDir)
+  gpgLogFile = '%s/solr.gpg.import.log' % tmpDir
+  run('gpg --homedir %s --import %s' % (gpgHomeDir, keysFile), gpgLogFile)
 
   if mavenURL is None:
+    stopGpgAgent(gpgHomeDir, logFile)
     raise RuntimeError('solr is missing maven')
 
   if dockerURL is None:
+    stopGpgAgent(gpgHomeDir, logFile)
     raise RuntimeError('solr is missing docker')
 
   if changesURL is None:
+    stopGpgAgent(gpgHomeDir, logfile)
     raise RuntimeError('solr is missing changes-%s' % version)
   testChanges(version, changesURL)
 
@@ -324,6 +327,11 @@ def checkSigs(urlString, version, tmpDir, isSigned, keysFile):
           if line.lower().find('warning') != -1:
             print('      GPG: %s' % line.strip())
 
+      # Make sure to shutdown the GPG agent at the end
+      stopGpgAgent(gpgHomeDir, logFile)
+
+def stopGpgAgent(gpgHomeDir, logFile):
+  run('gpgconf --homedir %s --kill gpg-agent' % (gpgHomeDir), logFile)
 
 def testChanges(version, changesURLString):
   print('  check changes HTML...')
@@ -923,6 +931,8 @@ def verifyMavenSigs(tmpDir, artifacts, keysFile):
     sys.stdout.write('.')
   print()
 
+  # Make sure to shutdown the GPG agent at the end
+  stopGpgAgent(gpgHomeDir, logFile)
 
 def print_warnings_in_file(file):
   with open(file) as f: