Skip to content

Commit

Permalink
IVT: Add check for source archive when Linux/x64 is in the release
Browse files Browse the repository at this point in the history
Signed-off-by: Stewart X Addison <[email protected]>
  • Loading branch information
sxa committed May 8, 2024
1 parent 4d1779f commit 205b441
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions tooling/release_download_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ WORKSPACE=${WORKSPACE:-"$PWD"}
KEEP_STAGING=false
SKIP_DOWNLOADING=false
USE_ANSI=false
VERBOSE=false

MAJOR_VERSION=""

Expand Down Expand Up @@ -210,7 +211,7 @@ verify_gpg_signatures() {

# Note: This will run into problems if there are no tar.gz files
# e.g. if only windows has been uploaded to the release
for A in OpenJDK*.tar.gz OpenJDK*.zip *.msi *.pkg *sbom*[0-9].json; do
for A in `ls -1d OpenJDK*.tar.gz OpenJDK*.zip *.msi *.pkg *sbom*[0-9].json`; do
print_verbose "IVT : Verifying signature of file ${A}"

if ! gpg -q --verify "${A}.sig" "${A}" 2> /dev/null; then
Expand Down Expand Up @@ -267,6 +268,26 @@ verify_valid_archives() {
fi
done
fi

# If there was an x64 linux version in the release, check for source archive
if ls OpenJDK*-jdk_x64_linux_hotspot_*.tar.gz > /dev/null; then
if ls OpenJDK*-jdk-sources*.tar.gz > /dev/null; then
for A in OpenJDK*-jdk-sources*.tar.gz; do
print_verbose "IVT : Counting files in source ${A}"
if ! tar tfz "${A}" > /dev/null; then
print_error "Failed to verify that ${A} can be extracted"
RC=4
fi
if [ "$(tar tfz "${A}" | wc -l)" -lt 45000 ]; then
print_error "less than 45000 files in source archive ${A} - that does not seem correct"
RC=4
fi
done
else
print_error "IVT: x64 linux tarballs present but no source archive - they should be published together"
fi
fi

}

########################################################################################################################
Expand Down Expand Up @@ -335,10 +356,14 @@ verify_working_executables() {
#
########################################################################################################################
verify_glibc_version() {
print_verbose "IVT : Detected GLIBC version '$(strings tarballtest/bin/java | grep ^GLIBC)'"
if ! strings tarballtest/bin/java | grep ^GLIBC_2.17 > /dev/null; then
print_error "GLIBC version detected in the JDK java executable is not the expected 2.17"
RC=4
if ! ls OpenJDK*-jre_"${ARCH}"_"${OS}"_hotspot_*.tar.gz > /dev/null 2>&1; then
print_verbose "IVT: Release does not contain a JRE for $OS/$ARCH so not running glibc version checks"
else
print_verbose "IVT : Detected GLIBC version '$(strings tarballtest/bin/java | grep ^GLIBC)'"
if ! strings tarballtest/bin/java | grep ^GLIBC_2.17 > /dev/null; then
print_error "GLIBC version detected in the JDK java executable is not the expected 2.17"
RC=4
fi
fi
}

Expand Down

0 comments on commit 205b441

Please sign in to comment.