kubo/test/cli/stats_test.go
Andrew Gillis aa3c88dcdd
Some checks failed
CodeQL / codeql (push) Has been cancelled
Docker Check / lint (push) Has been cancelled
Docker Check / build (push) Has been cancelled
Gateway Conformance / gateway-conformance (push) Has been cancelled
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Has been cancelled
Go Build / go-build (push) Has been cancelled
Go Check / go-check (push) Has been cancelled
Go Lint / go-lint (push) Has been cancelled
Go Test / unit-tests (push) Has been cancelled
Go Test / cli-tests (push) Has been cancelled
Go Test / example-tests (push) Has been cancelled
Interop / interop-prep (push) Has been cancelled
Sharness / sharness-test (push) Has been cancelled
Spell Check / spellcheck (push) Has been cancelled
Interop / helia-interop (push) Has been cancelled
Interop / ipfs-webui (push) Has been cancelled
shutdown daemon after test (#11135)
2026-01-07 20:51:19 -08:00

26 lines
505 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()
defer nodes.StopDaemons()
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()))
})
}