mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
test: do version check during setup.
Waiting until lightningd is up is too long: do a --version test in setup, and then check that all reported versions match later on. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
35b2ee9c42
commit
d8892c4dda
2 changed files with 11 additions and 3 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
. `dirname $0`/vars.sh
|
||||
|
||||
VERSION=$(`dirname $0`/../../lightning-cli --version | head -n1)
|
||||
[ $VERSION = `git describe --always --dirty` ] || (echo Wrong version $VERSION >&2; exit 1)
|
||||
|
||||
if $CLI getinfo 2>/dev/null; then
|
||||
echo $DAEMON already running >&2
|
||||
exit 1
|
||||
|
|
|
@ -441,9 +441,14 @@ if ! check "$LCLI3 getlog 2>/dev/null | $FGREP Hello"; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Version should be correct
|
||||
VERSION=`$LCLI1 getinfo | sed -n 's/.*"version" : "\([^"]*\)".*/\1/p'`
|
||||
[ $VERSION = `git describe --always --dirty` ] || (echo Wrong version $VERSION >&2; exit 1)
|
||||
# Version should match binary version
|
||||
GETINFO_VERSION=`$LCLI1 getinfo | sed -n 's/.*"version" : "\([^"]*\)".*/\1/p'`
|
||||
LCLI_VERSION=$($LCLI1 --version | head -n1)
|
||||
LDAEMON_VERSION=$($LIGHTNINGD1 --version | head -n1)
|
||||
if [ $GETINFO_VERSION != $LCLI_VERSION -o $GETINFO_VERSION != $LDAEMON_VERSION ]; then
|
||||
echo Wrong versions: getinfo gave $GETINFO_VERSION, cli gave $LCLI_VERSION, daemon gave $LDAEMON_VERSION >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ID1=`$LCLI1 getlog | sed -n 's/.*"ID: \([0-9a-f]*\)".*/\1/p'`
|
||||
[ `$LCLI1 getinfo | sed -n 's/.*"id" : "\([0-9a-f]*\)".*/\1/p'` = $ID1 ]
|
||||
|
|
Loading…
Add table
Reference in a new issue