| 1 | package cli |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/stretchr/testify/assert" |
| 7 | |
| 8 | "github.com/ipfs/kubo/test/cli/harness" |
| 9 | ) |
| 10 | |
| 11 | func TestStats(t *testing.T) { |
| 12 | t.Parallel() |
| 13 | |
| 14 | t.Run("stats dht", func(t *testing.T) { |
| 15 | t.Parallel() |
| 16 | nodes := harness.NewT(t).NewNodes(2).Init().StartDaemons().Connect() |
| 17 | defer nodes.StopDaemons() |
| 18 | node1 := nodes[0] |
| 19 | |
| 20 | res := node1.IPFS("stats", "dht") |
| 21 | assert.NoError(t, res.Err) |
| 22 | assert.Equal(t, 0, len(res.Stderr.Lines())) |
| 23 | assert.NotEqual(t, 0, len(res.Stdout.Lines())) |
| 24 | }) |
| 25 | } |