Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-16132: Smoketester stop gpg-agent after use (#1176)

Kevin Risden0cfef740617c
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: