This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 8202d03d32226da35c68359c36b0d9b08fc44ca9 Author: Brian Neradt <[email protected]> AuthorDate: Mon May 25 21:41:21 2026 -0500 Single source of truth for Proxy Verifier metadata (#13200) references correctly, but missed the CMakeLists checksum. Currently, the version and checksums for the Proxy Verifier release are referenced in multiple places, making it easy to miss updating the various required locations. This is bad. This patch adds a checksum companion file next to the version file and teaches all the consumers to read the shared version/checksum sources when downloading Proxy Verifier. (cherry picked from commit ac9b5cf8fc5738fd080ee918a740ebf51d39132d) --- CMakeLists.txt | 7 +++++-- tests/prepare_proxy_verifier.sh | 23 +++++++++++------------ tests/proxy-verifier-checksum.txt | 1 + 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6fbddf3f5..24fe8c0fb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -638,8 +638,11 @@ if(ENABLE_AUTEST) # the autest command. The original AUTEST_OPTIONS string is used in the # autest.sh script. separate_arguments(AUTEST_OPTIONS_LIST UNIX_COMMAND "${AUTEST_OPTIONS}") - set(PROXY_VERIFIER_VERSION "v2.12.0") - set(PROXY_VERIFIER_HASH "SHA1=8e9adc6e0b31251ca8e6fc2064ae54e5d752bb72") + file(READ "${CMAKE_SOURCE_DIR}/tests/proxy-verifier-version.txt" PROXY_VERIFIER_VERSION) + string(STRIP "${PROXY_VERIFIER_VERSION}" PROXY_VERIFIER_VERSION) + file(READ "${CMAKE_SOURCE_DIR}/tests/proxy-verifier-checksum.txt" PROXY_VERIFIER_SHA1) + string(STRIP "${PROXY_VERIFIER_SHA1}" PROXY_VERIFIER_SHA1) + set(PROXY_VERIFIER_HASH "SHA1=${PROXY_VERIFIER_SHA1}") include(proxy-verifier) endif() diff --git a/tests/prepare_proxy_verifier.sh b/tests/prepare_proxy_verifier.sh index 729bf82aa9..e280d5182f 100755 --- a/tests/prepare_proxy_verifier.sh +++ b/tests/prepare_proxy_verifier.sh @@ -17,8 +17,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -fail() -{ +fail() { echo $1 exit 1 } @@ -30,9 +29,11 @@ ROOT=${ROOT:-${SCRIPT_DIR}} PV_VERSION_FILE="${ROOT}/tests/proxy-verifier-version.txt" [ -r "${PV_VERSION_FILE}" ] || fail "\"${PV_VERSION_FILE}\" does not exist." +PV_SUM_FILE="${ROOT}/tests/proxy-verifier-checksum.txt" +[ -r "${PV_SUM_FILE}" ] || fail "\"${PV_SUM_FILE}\" does not exist." pv_name="proxy-verifier" -pv_version=`cat ${ROOT}/tests/proxy-verifier-version.txt` +read -r pv_version <"${PV_VERSION_FILE}" pv_top_dir="${ROOT}/tests/proxy-verifier" pv_unpack_dir="${pv_top_dir}/unpack/${pv_version}" bin_dir="${pv_unpack_dir}/bin" @@ -40,29 +41,26 @@ pv_dir="${pv_name}-${pv_version}" pv_tar_filename="${pv_dir}.tar.gz" pv_tar="${pv_top_dir}/${pv_tar_filename}" pv_tar_url="https://ci.trafficserver.apache.org/bintray/${pv_tar_filename}" -expected_sha1="8e9adc6e0b31251ca8e6fc2064ae54e5d752bb72" +read -r expected_sha1 <"${PV_SUM_FILE}" pv_client="${bin_dir}/verifier-client" pv_server="${bin_dir}/verifier-server" TAR=${TAR:-tar} CURL=${CURL:-curl} # Check to see whether Proxy Verifier has already been unpacked. -if ! [ -x ${pv_client} -a -x ${pv_server} ] -then +if ! [ -x ${pv_client} -a -x ${pv_server} ]; then # 1. Get the tar file if it has not been retrieved already. # Note that the two spaces between the hash and ${ARCHIVE) is needed - if [ ! -e ${pv_tar} ] - then + if [ ! -e ${pv_tar} ]; then # default to using native sha1sum command when available - if [ $(which sha1sum) ] - then + if [ $(which sha1sum) ]; then SHASUM=${SHASUM:-sha1sum} else SHASUM=${SHASUM:-shasum} fi mkdir -p ${pv_top_dir} - ${CURL} -L --progress-bar -o ${pv_tar} ${pv_tar_url} || \ + ${CURL} -L --progress-bar -o ${pv_tar} ${pv_tar_url} || fail "Failed to download ${pv_tar_url}." - cat > ${pv_top_dir}/sha1 << EOF + cat >${pv_top_dir}/sha1 <<EOF ${expected_sha1} ${pv_tar} EOF ${SHASUM} -c ${pv_top_dir}/sha1 || fail "SHA1 mismatch for downloaded ${pv_tar_filename}." @@ -104,6 +102,7 @@ EOF ;; *) fail "We need to build proxy-verifier for $(uname -s)" + ;; esac # 4. Link the OS-specific binaries to the bin directory. diff --git a/tests/proxy-verifier-checksum.txt b/tests/proxy-verifier-checksum.txt new file mode 100644 index 0000000000..59315e96fc --- /dev/null +++ b/tests/proxy-verifier-checksum.txt @@ -0,0 +1 @@ +0a60c646cbc9326abb2fbc397cb9efa8c08a807a
