MCPcopy Create free account
hub / github.com/apache/kvrocks / createInteractiveCli

Function createInteractiveCli

tests/gocase/integration/cli/cli_test.go:49–62  ·  view source on GitHub ↗
(t *testing.T, srv *util.KvrocksServer)

Source from the content-addressed store, hash-verified

47}
48
49func createInteractiveCli(t *testing.T, srv *util.KvrocksServer) *interactiveCli {
50 c := exec.Command(util.CLIPath())
51 c.Args = append(c.Args, "-h", srv.Host(), "-p", fmt.Sprintf("%d", srv.Port()))
52 w, err := c.StdinPipe()
53 require.NoError(t, err)
54 r, err := c.StdoutPipe()
55 require.NoError(t, err)
56 require.NoError(t, c.Start())
57 return &interactiveCli{
58 c: c,
59 r: bufio.NewReader(r),
60 w: bufio.NewWriter(w),
61 }
62}
63
64func (c *interactiveCli) Close() error {
65 if err := c.c.Process.Signal(syscall.SIGTERM); err != nil {

Callers 1

TestRedisCliFunction · 0.85

Calls 3

HostMethod · 0.80
PortMethod · 0.80
StartMethod · 0.45

Tested by

no test coverage detected