daemon: fix up getinfo command, add it to tests.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2016-09-14 05:15:53 +09:30
parent dff50c3a5f
commit e5b2cacd3f
2 changed files with 4 additions and 0 deletions

View File

@ -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,

View File

@ -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'`