kubo/test/cli/stats_test.go
Antonio Navarro Perez 3bc9b675a0
fix: stats dht command when Routing.Type=auto (#9538)
Fixes default auto mode, but Routing.Type=custom needs more work.
Continued in https://github.com/ipfs/kubo/issues/9482
2023-01-13 00:38:38 +01:00

25 lines
477 B
Go

package cli
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/ipfs/kubo/test/cli/harness"
)
func TestStats(t *testing.T) {
t.Parallel()
t.Run("stats dht", func(t *testing.T) {
t.Parallel()
nodes := harness.NewT(t).NewNodes(2).Init().StartDaemons().Connect()
node1 := nodes[0]
res := node1.IPFS("stats", "dht")
assert.NoError(t, res.Err)
assert.Equal(t, 0, len(res.Stderr.Lines()))
assert.NotEqual(t, 0, len(res.Stdout.Lines()))
})
}