Skip to content

Commit 64c660c

Browse files
committed
itest: test "lnd --debuglevel=show" command
Tests that "lnd --debuglevel=show" command works and prints the list of supported subsystems.
1 parent 3360d28 commit 64c660c

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

itest/config.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//go:build integration
2+
3+
package itest
4+
5+
import (
6+
"os/exec"
7+
8+
"github.com/lightningnetwork/lnd/lntest"
9+
"github.com/stretchr/testify/require"
10+
)
11+
12+
// testDebuglevelShow tests that "lnd --debuglevel=show" command works and
13+
// prints the list of supported subsystems.
14+
func testDebuglevelShow(ht *lntest.HarnessTest) {
15+
// We can't use ht.NewNode, because it adds more arguments to the
16+
// command line (e.g. flags configuring bitcoin backend), but we want to
17+
// make sure that "lnd --debuglevel=show" works without any other flags.
18+
lndBinary := getLndBinary(ht.T)
19+
cmd := exec.Command(lndBinary, "--debuglevel=show")
20+
stdoutStderrBytes, err := cmd.CombinedOutput()
21+
require.NoError(ht, err, "failed to run 'lnd --debuglevel=show'")
22+
23+
// Make sure that the output contains the list of supported subsystems
24+
// and that the list is not empty. We search PEER subsystem.
25+
stdoutStderr := string(stdoutStderrBytes)
26+
require.Contains(ht, stdoutStderr, "Supported subsystems")
27+
require.Contains(ht, stdoutStderr, "PEER")
28+
}

itest/list_on_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,4 +702,8 @@ var allTestCases = []*lntest.TestCase{
702702
Name: "send to route failed htlc timeout",
703703
TestFunc: testSendToRouteFailHTLCTimeout,
704704
},
705+
{
706+
Name: "debuglevel show",
707+
TestFunc: testDebuglevelShow,
708+
},
705709
}

0 commit comments

Comments
 (0)