Skip to content

Commit

Permalink
Add a test for the snapshot links
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Jul 15, 2024
1 parent 37f4b69 commit acf8833
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -597,3 +597,27 @@ steps:
system: x86_64-linux
concurrency: 1
concurrency_group: 'docker'

- group: Links
key: links-validity
steps:
- block: Snapshot Links
depends_on: linux-nix
if: build.env("RELEASE_CANDIDATE") == null
key: snapshot-links

- label: Check Mainnet Snapshot Link
depends_on: snapshot-links
command: |
cd run/mainnet/docker
LINK_TEST=1 ./snapshot.sh
agents:
system: ${linux}

- label: Check Preprod Snapshot Link
depends_on: snapshot-links
command: |
cd run/preprod/docker
LINK_TEST=1 ./snapshot.sh
agents:
system: ${linux}
8 changes: 8 additions & 0 deletions run/common/snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ esac

echo "Downloading the snapshot..."

if [ -n "${LINK_TEST:-}" ]; then
echo "Link test enabled"
echo "Snapshot URL: $SNAPSHOT_URL"
curl -f -LI "$SNAPSHOT_URL" > /dev/null
curl -r 0-1000000 -SL "$SNAPSHOT_URL" > /dev/null
exit 0
fi

curl -SL "$SNAPSHOT_URL" | lz4 -c -d - | tar -x -C "$NODE_DB"

mv -f "$NODE_DB"/db/* "$NODE_DB"/
Expand Down

0 comments on commit acf8833

Please sign in to comment.