This generalized script is useful for running tests on bitcoind "to completion" where
the indication of such comes from looking at the logs.
Details
- Reviewers
deadalnix Fabien - Group Reviewers
Restricted Project - Commits
- rSTAGINGe4747a18e925: Generalized ibd.sh to provide a logging tool for running similar types of tests
rABCe4747a18e925: Generalized ibd.sh to provide a logging tool for running similar types of tests
./bitcoind-exit-on-log.sh -h # shows help message ./bitcoind-exit-on-log.sh --grep "Loading banlist" # success LOG_FILE=~/.bitcoin/testnet3/debug.log ./bitcoind-exit-on-log.sh --grep "Loading banlist" --params "-testnet" # success mycallback(){ ./bitcoin-cli getbestblockhash; } export -f mycallback ./bitcoind-exit-on-log.sh --grep "Leaving InitialBlockDownload" --callback mycallback # success, with best block hash output
Also test IBD on this diff via TeamCity.
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- exit-on-log
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 7391 Build 12825: Bitcoin ABC Buildbot (legacy) Build 12824: arc lint + arc unit
Event Timeline
What is the use case apart from the IBD script ?
Some examples that I plan to use it for include testing time-to-completion for various features (initial spin-up, reindexing, etc).
If you want my opinion I would have simply set -x from the very beginning of the script (set -euxo pipefail) and only disable it around the sleep loop.
This script is intended to be run by the CI server, so every trace can be useful in case there is a bug in the script, and the detected parameters are no exception. This has a different purpose than an echo statement which is more of a UI for the script.
contrib/devtools/bitcoind-exit-on-log.sh | ||
---|---|---|
119 โ | (On Diff #11184) | Oups, you replaced LOG_PID with IBD_PID during the rebase ! |
Disable verbose logging while printing the help message, otherwise it's impossible to read.