From e5b2cacd3f71cabf1271e3f16a371b313584053f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 14 Sep 2016 05:15:53 +0930 Subject: [PATCH] daemon: fix up getinfo command, add it to tests. Signed-off-by: Rusty Russell --- daemon/jsonrpc.c | 1 + daemon/test/test.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/daemon/jsonrpc.c b/daemon/jsonrpc.c index 4902ae3db..602a9cfdc 100644 --- a/daemon/jsonrpc.c +++ b/daemon/jsonrpc.c @@ -292,6 +292,7 @@ static const struct json_command *cmdlist[] = { &waitinvoice_command, &getroute_command, &sendpay_command, + &getinfo_command, /* Developer/debugging options. */ &dev_newhtlc_command, &dev_fulfillhtlc_command, diff --git a/daemon/test/test.sh b/daemon/test/test.sh index 512603b1d..c21906236 100755 --- a/daemon/test/test.sh +++ b/daemon/test/test.sh @@ -440,8 +440,11 @@ if ! check "$LCLI3 getlog 2>/dev/null | $FGREP Hello"; then 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 ] ID2=`$LCLI2 getlog | sed -n 's/.*"ID: \([0-9a-f]*\)".*/\1/p'` +[ `$LCLI2 getinfo | sed -n 's/.*"id" : "\([0-9a-f]*\)".*/\1/p'` = $ID2 ] ID3=`$LCLI3 getlog | sed -n 's/.*"ID: \([0-9a-f]*\)".*/\1/p'` +[ `$LCLI3 getinfo | sed -n 's/.*"id" : "\([0-9a-f]*\)".*/\1/p'` = $ID3 ] PORT2=`$LCLI2 getlog | sed -n 's/.*on port \([0-9]*\).*/\1/p'` PORT3=`$LCLI3 getlog | sed -n 's/.*on port \([0-9]*\).*/\1/p'`