From cb8f5bffb84b34e2867ed744f1cf957e9103ad2d Mon Sep 17 00:00:00 2001 From: dkostic Date: Tue, 23 Apr 2024 22:39:05 -0700 Subject: [PATCH 1/2] Fix the NTP integration test (NTP website changed) --- tests/ci/integration/run_ntp_integration.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/ci/integration/run_ntp_integration.sh b/tests/ci/integration/run_ntp_integration.sh index 759c66193a..cb8345e6d4 100755 --- a/tests/ci/integration/run_ntp_integration.sh +++ b/tests/ci/integration/run_ntp_integration.sh @@ -15,8 +15,15 @@ source tests/ci/common_posix_setup.sh # Assumes script is executed from the root of aws-lc directory SCRATCH_FOLDER="${SRC_ROOT}/NTP_BUILD_ROOT" -NTP_DOWNLOAD_URL=$(curl -s https://www.ntp.org/downloads/ | grep -oP "\"https://archive.ntp.org/ntp.*?\.tar\.gz\"" | cut -d '"' -f2) -NTP_TAR=$(echo "$NTP_DOWNLOAD_URL" | cut -d '/' -f6) +NTP_WEBSITE_URL="https://downloads.nwtime.org/ntp" + +# - curl fetches the HTML content of the website, +# - the first grep searches for all occurrences of href attributes in anchor tags and outputs only the URLs, +# - sed removes the href=" and trailing " from the URLs, +# - the second grep filters only the links ending with .tar.gz, +# - cut strips "/ntp/" from the link and retains only the tar name. +NTP_TAR=$(curl -s ${NTP_WEBSITE_URL} | grep -o 'href="[^"]*"' | sed 's/href="//;s/"$//' | grep '.tar.gz$' | cut -d '/' -f3) +NTP_DOWNLOAD_URL="${NTP_WEBSITE_URL}/${NTP_TAR}" NTP_SRC_FOLDER="${SCRATCH_FOLDER}/ntp-src" NTP_PATCH_FOLDER="${SRC_ROOT}/tests/ci/integration/ntp_patch" AWS_LC_BUILD_FOLDER="${SCRATCH_FOLDER}/aws-lc-build" From 6866e33c438b4f38339106fb5cee14466d712ca4 Mon Sep 17 00:00:00 2001 From: dkostic Date: Tue, 23 Apr 2024 22:45:25 -0700 Subject: [PATCH 2/2] forgot / --- tests/ci/integration/run_ntp_integration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci/integration/run_ntp_integration.sh b/tests/ci/integration/run_ntp_integration.sh index cb8345e6d4..d457fe719b 100755 --- a/tests/ci/integration/run_ntp_integration.sh +++ b/tests/ci/integration/run_ntp_integration.sh @@ -15,7 +15,7 @@ source tests/ci/common_posix_setup.sh # Assumes script is executed from the root of aws-lc directory SCRATCH_FOLDER="${SRC_ROOT}/NTP_BUILD_ROOT" -NTP_WEBSITE_URL="https://downloads.nwtime.org/ntp" +NTP_WEBSITE_URL="https://downloads.nwtime.org/ntp/" # - curl fetches the HTML content of the website, # - the first grep searches for all occurrences of href attributes in anchor tags and outputs only the URLs,