-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
itest: test "lnd --debuglevel=show" command
Tests that "lnd --debuglevel=show" command works and prints the list of supported subsystems.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package itest | ||
|
||
import ( | ||
"os/exec" | ||
|
||
"github.com/lightningnetwork/lnd/lntest" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
// testDebuglevelShow tests that "lnd --debuglevel=show" command works and | ||
// prints the list of supported subsystems. | ||
func testDebuglevelShow(ht *lntest.HarnessTest) { | ||
// We can't use ht.NewNode, because it adds more arguments to the | ||
// command line (e.g. flags configuring bitcoin backend), but we want to | ||
// make sure that "lnd --debuglevel=show" works without any other flags. | ||
lndBinary := getLndBinary(ht.T) | ||
cmd := exec.Command(lndBinary, "--debuglevel=show") | ||
stdoutStderrBytes, err := cmd.CombinedOutput() | ||
require.NoError(ht.T, err, "failed to run 'lnd --debuglevel=show'") | ||
|
||
// Make sure that the output contains the list of supported subsystems | ||
// and that the list is not empty. We search PEER subsystem. | ||
stdoutStderr := string(stdoutStderrBytes) | ||
require.Contains(ht.T, stdoutStderr, "Supported subsystems") | ||
require.Contains(ht.T, stdoutStderr, "PEER") | ||
} |