diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py index 5b6ae716876..f3b13640363 100755 --- a/dev-tools/scripts/smokeTestRelease.py +++ b/dev-tools/scripts/smokeTestRelease.py @@ -264,13 +264,15 @@ 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/lucene.gpg.import.log' % tmpDir) + gpgLogFile = '%s/lucene.gpg.import.log' % tmpDir + run('gpg --homedir %s --import %s' % (gpgHomeDir, keysFile), gpgLogFile) if mavenURL is None: + stopGpgAgent(gpgHomeDir, logFile) raise RuntimeError('lucene is missing maven') if changesURL is None: + stopGpgAgent(gpgHomeDir, logFile) raise RuntimeError('lucene is missing changes-%s' % version) testChanges(version, changesURL) @@ -308,6 +310,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...') @@ -857,6 +864,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: