Apache Lucene open-source search software
LUCENE-8500: Fix release smoke test to always use the downloaded KEYS file
Jim Ferenczia02959c87e13
diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.pyindex af26ae195b1..70bea24af20 100644--- a/dev-tools/scripts/smokeTestRelease.py+++ b/dev-tools/scripts/smokeTestRelease.py@@ -285,7 +285,7 @@ def checkAllJARs(topDir, project, gitRevision, version, tmpDir, baseURL):% (fullPath, luceneDistFilenames[jarFilename]))-def checkSigs(project, urlString, version, tmpDir, isSigned, local_keys):+def checkSigs(project, urlString, version, tmpDir, isSigned, keysFile):print(' test basics...')ents = getDirEntries(urlString)@@ -344,16 +344,6 @@ def checkSigs(project, urlString, version, tmpDir, isSigned, local_keys):actual = [x[0] for x in artifacts]if expected != actual:raise RuntimeError('%s: wrong artifacts: expected %s but got %s' % (project, expected, actual))-- print(' get KEYS')- if local_keys is not None:- print(" Using local KEYS file %s" % local_keys)- keysFile = local_keys- else:- keysFileURL = "https://archive.apache.org/dist/lucene/KEYS"- print(" Downloading online KEYS file %s" % keysFileURL)- download('KEYS', keysFileURL, tmpDir)- keysFile = '%s/KEYS' % (tmpDir)# Set up clean gpg world; import keys file:gpgHomeDir = '%s/%s.gpg' % (tmpDir, project)@@ -978,7 +968,7 @@ def testDemo(run_java, isSrc, version, jdk):def removeTrailingZeros(version):return re.sub(r'(\.0)*$', '', version)-def checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSigned):+def checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSigned, keysFile):POMtemplates = defaultdict()getPOMtemplates(solrSrcUnpackPath, POMtemplates, tmpDir)print(' download artifacts')@@ -996,7 +986,7 @@ def checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSignecheckJavadocAndSourceArtifacts(artifacts, version)verifyDeployedPOMsCoordinates(artifacts, version)if isSigned:- verifyMavenSigs(baseURL, tmpDir, artifacts)+ verifyMavenSigs(baseURL, tmpDir, artifacts, keysFile)distFiles = getBinaryDistFilesForMavenChecks(tmpDir, version, baseURL)checkIdenticalMavenArtifacts(distFiles, artifacts, version)@@ -1118,13 +1108,9 @@ def getPOMcoordinate(treeRoot):packaging = 'jar' if packaging is None else packaging.text.strip()return groupId, artifactId, packaging, version-def verifyMavenSigs(baseURL, tmpDir, artifacts):+def verifyMavenSigs(baseURL, tmpDir, artifacts, keysFile):print(' verify maven artifact sigs', end=' ')for project in ('lucene', 'solr'):- keysFile = '%s/%s.KEYS' % (tmpDir, project)- if not os.path.exists(keysFile):- keysURL = '%s/%s/KEYS' % (baseURL, project)- download('%s.KEYS' % project, keysURL, tmpDir, quiet=True)# Set up clean gpg world; import keys file:gpgHomeDir = '%s/%s.gpg' % (tmpDir, project)@@ -1504,16 +1490,27 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys,if solrPath is None:raise RuntimeError('could not find solr subdir')+ print()+ print('Get KEYS...')+ if local_keys is not None:+ print(" Using local KEYS file %s" % local_keys)+ keysFile = local_keys+ else:+ keysFileURL = "https://archive.apache.org/dist/lucene/KEYS"+ print(" Downloading online KEYS file %s" % keysFileURL)+ download('KEYS', keysFileURL, tmpDir)+ keysFile = '%s/KEYS' % (tmpDir)+print()print('Test Lucene...')- checkSigs('lucene', lucenePath, version, tmpDir, isSigned, local_keys)+ checkSigs('lucene', lucenePath, version, tmpDir, isSigned, keysFile)for artifact in ('lucene-%s.tgz' % version, 'lucene-%s.zip' % version):unpackAndVerify(java, 'lucene', tmpDir, artifact, gitRevision, version, testArgs, baseURL)unpackAndVerify(java, 'lucene', tmpDir, 'lucene-%s-src.tgz' % version, gitRevision, version, testArgs, baseURL)print()print('Test Solr...')- checkSigs('solr', solrPath, version, tmpDir, isSigned, local_keys)+ checkSigs('solr', solrPath, version, tmpDir, isSigned, keysFile)for artifact in ('solr-%s.tgz' % version, 'solr-%s.zip' % version):unpackAndVerify(java, 'solr', tmpDir, artifact, gitRevision, version, testArgs, baseURL)solrSrcUnpackPath = unpackAndVerify(java, 'solr', tmpDir, 'solr-%s-src.tgz' % version,@@ -1521,7 +1518,7 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys,print()print('Test Maven artifacts for Lucene and Solr...')- checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSigned)+ checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSigned, keysFile)print('\nSUCCESS! [%s]\n' % (datetime.datetime.now() - startTime))