-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The condition checking if reindex was needed was broken because `-v` switch of `grep` only inverts matched lines, not exit code. As a result reindex was triggerred even when not needed. As a part of this fix, the change contains two important improvements to tests: * Test that reindex is not triggerred when not needed * Ability to switch from which repository to test update Closes #108
- Loading branch information
Showing
10 changed files
with
121 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
MAINTAINER="Martin Habostiak <[email protected]>" | ||
|
||
UPGRADE_REPO=experimental | ||
SOURCE_DIR:=$(dir $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
BITCOIN_SOURCE_DIR=$(SOURCE_DIR)bitcoin/ | ||
# Forgetting to type this resulted in lot of time wasted. | ||
|
@@ -48,7 +49,7 @@ test-here: test-here-all-basic test-here-all-nonconfict-upgrade | |
test-in-qubes-dvm: test-split-$(SPLIT_STRATEGY) $(addprefix test-in-qubes-dvm-multi-package-,$(TEST_MULTI_PACKAGE)) | ||
|
||
test-split-none: | ||
$(SOURCE_DIR)/tests/qubes-tools/test-in-dispvm.sh "$(BUILD_DIR)" "$(SOURCE_DIR)" "TEST_ALL_PACKAGES=$(TEST_ALL_PACKAGES)" "DPKG_DEBUG_LEVEL=$(DPKG_DEBUG_LEVEL)" test-here | ||
$(SOURCE_DIR)/tests/qubes-tools/test-in-dispvm.sh "$(BUILD_DIR)" "$(SOURCE_DIR)" "TEST_ALL_PACKAGES=$(TEST_ALL_PACKAGES)" "DPKG_DEBUG_LEVEL=$(DPKG_DEBUG_LEVEL)" "UPGRADE_REPO=$(UPGRADE_REPO)" test-here | ||
|
||
test-split-upgrade: test-in-qubes-dvm-all-basic $(addprefix test-in-qubes-dvm-upgrade-,$(TEST_ALL_PACKAGES)) | ||
|
||
|
@@ -57,7 +58,7 @@ test-split-all: $(addprefix test-in-qubes-dvm-basic-,$(TEST_ALL_PACKAGES)) $(add | |
test-package-%: test-$(TEST_STRATEGY)-basic-% | ||
|
||
test-in-qubes-dvm-multi-package-%: tests/multi-package/%.sh | ||
$(SOURCE_DIR)/tests/qubes-tools/test-in-dispvm.sh "$(BUILD_DIR)" "$(SOURCE_DIR)" "TEST_MULTI_PACKAGE=$(TEST_MULTI_PACKAGE)" "DPKG_DEBUG_LEVEL=$(DPKG_DEBUG_LEVEL)" "test-here-multi-package-$*" | ||
$(SOURCE_DIR)/tests/qubes-tools/test-in-dispvm.sh "$(BUILD_DIR)" "$(SOURCE_DIR)" "TEST_MULTI_PACKAGE=$(TEST_MULTI_PACKAGE)" "DPKG_DEBUG_LEVEL=$(DPKG_DEBUG_LEVEL)" "UPGRADE_REPO=$(UPGRADE_REPO)" "test-here-multi-package-$*" | ||
|
||
test-here-multi-package-%: tests/multi-package/%.sh | ||
$(SOURCE_DIR)/tests/prepare_machine.sh "$(BUILD_DIR)" | ||
|
@@ -71,12 +72,12 @@ test-here-basic-%: test-here-prepare-machine | |
$(SOURCE_DIR)/tests/package_clean_install.sh "$(BUILD_DIR)" "$*" | ||
|
||
test-here-upgrade-%: | $(UPGRADE_DEPS) | ||
$(SOURCE_DIR)/tests/before_upgrade.sh "$(BUILD_DIR)" "$*" | ||
$(SOURCE_DIR)/tests/before_upgrade.sh "$(BUILD_DIR)" "$(UPGRADE_REPO)" "$*" | ||
$(SOURCE_DIR)/tests/prepare_machine.sh "$(BUILD_DIR)" | ||
$(SOURCE_DIR)/tests/upgrade_package.sh "$(BUILD_DIR)" "$*" | ||
|
||
test-here-prepare-all-nonconfict-upgrade: | $(UPGRADE_DEPS) | ||
$(SOURCE_DIR)/tests/before_upgrade.sh "$(BUILD_DIR)" "$(TEST_ALL_PACKAGES_NON_CONFLICT)" | ||
$(SOURCE_DIR)/tests/before_upgrade.sh "$(BUILD_DIR)" "$(UPGRADE_REPO)" "$(TEST_ALL_PACKAGES_NON_CONFLICT)" | ||
$(SOURCE_DIR)/tests/prepare_machine.sh "$(BUILD_DIR)" | ||
|
||
test-here-single-nonconfict-upgrade-%: test-here-prepare-all-nonconfict-upgrade | $(UPGRADE_DEPS) | ||
|
@@ -88,10 +89,10 @@ test-here-prepare-machine: | |
$(SOURCE_DIR)/tests/prepare_machine.sh "$(BUILD_DIR)" | ||
|
||
test-in-qubes-dvm-all-basic: | ||
$(SOURCE_DIR)/tests/qubes-tools/test-in-dispvm.sh "$(BUILD_DIR)" "$(SOURCE_DIR)" "TEST_ALL_PACKAGES=$(TEST_ALL_PACKAGES)" "DPKG_DEBUG_LEVEL=$(DPKG_DEBUG_LEVEL)" test-here-all-basic | ||
$(SOURCE_DIR)/tests/qubes-tools/test-in-dispvm.sh "$(BUILD_DIR)" "$(SOURCE_DIR)" "TEST_ALL_PACKAGES=$(TEST_ALL_PACKAGES)" "DPKG_DEBUG_LEVEL=$(DPKG_DEBUG_LEVEL)" "UPGRADE_REPO=$(UPGRADE_REPO)" test-here-all-basic | ||
|
||
test-in-qubes-dvm-basic-%: | ||
$(SOURCE_DIR)/tests/qubes-tools/test-in-dispvm.sh "$(BUILD_DIR)" "$(SOURCE_DIR)" "TEST_ALL_PACKAGES=$(TEST_ALL_PACKAGES)" "DPKG_DEBUG_LEVEL=$(DPKG_DEBUG_LEVEL)" "test-here-basic-$*" | ||
$(SOURCE_DIR)/tests/qubes-tools/test-in-dispvm.sh "$(BUILD_DIR)" "$(SOURCE_DIR)" "TEST_ALL_PACKAGES=$(TEST_ALL_PACKAGES)" "DPKG_DEBUG_LEVEL=$(DPKG_DEBUG_LEVEL)" "UPGRADE_REPO=$(UPGRADE_REPO)" "test-here-basic-$*" | ||
|
||
test-in-qubes-dvm-upgrade-%: | ||
$(SOURCE_DIR)/tests/qubes-tools/test-in-dispvm.sh "$(BUILD_DIR)" "$(SOURCE_DIR)" SPLIT_STRATEGY=upgrade "TEST_ALL_PACKAGES=$(TEST_ALL_PACKAGES)" "DPKG_DEBUG_LEVEL=$(DPKG_DEBUG_LEVEL)" "test-here-upgrade-$*" | ||
$(SOURCE_DIR)/tests/qubes-tools/test-in-dispvm.sh "$(BUILD_DIR)" "$(SOURCE_DIR)" SPLIT_STRATEGY=upgrade "TEST_ALL_PACKAGES=$(TEST_ALL_PACKAGES)" "DPKG_DEBUG_LEVEL=$(DPKG_DEBUG_LEVEL)" "UPGRADE_REPO=$(UPGRADE_REPO)" "test-here-upgrade-$*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
bitcoin (0.20.0-10) buster; urgency=medium | ||
|
||
* Fixed bug causing bitcoind to always reindex after upgrade/install | ||
|
||
-- Martin Habovstiak <[email protected]> Tue, 5 Jan 2021 15:12:21 +0100 | ||
|
||
bitcoin (0.20.0-9) buster; urgency=medium | ||
|
||
* Reindex when changing from pruned to non-pruned | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
deb https://deb.ln-ask.me/beta buster common local desktop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
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TiBhe5BQKg9G7mE2TSDiz+Xe27/DMKbWff4+tnEmqFXDCJwW+w | ||
HUnXcN+cNR3mcg6qTbqisEnu9xJo2RpxPWYH6rQBQvYIzdQg | ||
=KcGD | ||
-----END PGP PUBLIC KEY BLOCK----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
sleep 10 | ||
|
||
if ps aux | grep -v grep | grep -q 'bitcoind.*-reindex' || sudo journalctl --no-pager -u bitcoin-regtest | grep -q 'Reindexing'; | ||
then | ||
echo "Error: unneeded reindex" >&2 | ||
exit 1 | ||
fi | ||
|
||
if gen_addr="$(wget -O - --post-data='{"jsonrpc": "1.0", "id":"curltest0", "method": "getnewaddress", "params": [] }' --header 'content-type: text/plain;' --header 'Authorization: Basic '"`sudo cat /var/run/bitcoin-regtest/cookie | base64 | tr -d '\n'`" "http://127.0.0.1:`sudo grep '^rpcport=' /etc/bitcoin-regtest/bitcoin.conf | sed 's/^rpcport=//' | tr -d '\n'`" | sed 's/^.*"result" *: *"\([^"]*\)".*$/\1/')"; | ||
then | ||
echo Generating 150 blocks to address "$gen_addr" >&2 | ||
if wget -O - --post-data='{"jsonrpc": "1.0", "id":"curltest1", "method": "generatetoaddress", "params": [150, "'"$gen_addr"'"] }' --header 'content-type: text/plain;' --header 'Authorization: Basic '"`sudo cat /var/run/bitcoin-regtest/cookie | base64 | tr -d '\n'`" "http://127.0.0.1:`sudo grep '^rpcport=' /etc/bitcoin-regtest/bitcoin.conf | sed 's/^rpcport=//' | tr -d '\n'`"; | ||
then | ||
echo "Succcess generating 150 blocks" >&2 | ||
else | ||
echo "Failed to generate blocks" >&2 | ||
exit 1 | ||
fi | ||
else | ||
echo "Failed to get an address for generating coins" >&2 | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
if ps aux | grep -v grep | grep -q 'bitcoind.*-reindex' || sudo journalctl --no-pager -u bitcoin-regtest | grep -q 'Reindexing'; | ||
then | ||
echo "Error: unneeded reindex" >&2 | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters