Skip to content

Commit

Permalink
SOLR-16132: Smoketester stop gpg-agent after use (#1176)
Browse files Browse the repository at this point in the history
  • Loading branch information
risdenk committed Nov 11, 2022
1 parent 5d91617 commit 0cfef74
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions dev-tools/scripts/smokeTestRelease.py
Expand Up @@ -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)

Expand Down Expand Up @@ -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...')
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0cfef74

Please sign in to comment.