Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/_functions.bitcoincore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fi
function downloadBitcoinCore() {
# set version
# https://bitcoincore.org/en/download/
bitcoinVersion="29.2"
bitcoinVersion="31.1"

if bitcoin-cli --version | grep $bitcoinVersion >/dev/null; then
echo "# Bitcoin Core $bitcoinVersion is already installed"
Expand Down
2 changes: 2 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ file recursively - **to add tests, just drop a new `.bats` file here**, no CI
change needed.

Current coverage:
- `bitcoin-core-version.bats` - pinned Bitcoin Core release, signed manifest
URLs, supported Linux artifact matrix, and verification ordering
- `repository-contracts.bats` - syntax checks for every maintained shell and
Python script, systemd unit structure, and safe config-parser adoption
- `source-conf.bats` - safe parsing of config data, quoting, malformed lines,
Expand Down
27 changes: 27 additions & 0 deletions tests/bitcoin-core-version.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bats

SCRIPT="$BATS_TEST_DIRNAME/../scripts/_functions.bitcoincore.sh"

@test "standalone installer pins Bitcoin Core 31.1" {
grep -Fq 'bitcoinVersion="31.1"' "$SCRIPT"
! grep -Fq 'bitcoinVersion="29.2"' "$SCRIPT"
}

@test "release downloads use the pinned version for signed manifests and binaries" {
grep -Fq 'bitcoin-core-${bitcoinVersion}/SHA256SUMS' "$SCRIPT"
grep -Fq 'bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc' "$SCRIPT"
grep -Fq 'bitcoin-core-${bitcoinVersion}/${binaryName}' "$SCRIPT"
grep -Fq 'binaryName="bitcoin-${bitcoinVersion}-${bitcoinOSversion}.tar.gz"' "$SCRIPT"
}

@test "all v31.1 Linux architectures published upstream remain mapped" {
grep -Fq 'bitcoinOSversion="arm-linux-gnueabihf"' "$SCRIPT"
grep -Fq 'bitcoinOSversion="aarch64-linux-gnu"' "$SCRIPT"
grep -Fq 'bitcoinOSversion="x86_64-linux-gnu"' "$SCRIPT"
}

@test "signature verification precedes binary checksum acceptance" {
signature_line="$(grep -n 'gpg --verify SHA256SUMS.asc' "$SCRIPT" | head -n1 | cut -d: -f1)"
checksum_line="$(grep -n 'binaryChecksum=' "$SCRIPT" | head -n1 | cut -d: -f1)"
[ "$signature_line" -lt "$checksum_line" ]
}
Loading