Exemplo n.º 1
0
func startGateway(t *testing.T, endpoints string) *expect.ExpectProcess {
	p, err := expect.NewExpect(defaultBinPath, "gateway", "--endpoints="+endpoints, "start")
	if err != nil {
		t.Fatal(err)
	}
	_, err = p.Expect("tcpproxy: ready to proxy client requests to")
	if err != nil {
		t.Fatal(err)
	}
	return p
}
Exemplo n.º 2
0
func spawnCmd(args []string) (*expect.ExpectProcess, error) {
	// redirect stderr to stdout since expect only uses stdout
	cmdargs := append([]string{"-c"}, strings.Join(append(args, "2>&1"), " "))
	return expect.NewExpect("/bin/sh", cmdargs...)
}
Exemplo n.º 3
0
func spawnCmd(args []string) (*expect.ExpectProcess, error) {
	return expect.NewExpect(args[0], args[1:]...)
}
Exemplo n.º 4
0
func spawnCmd(args []string) (*expect.ExpectProcess, error) {
	cmdargs := append([]string{"-c"}, strings.Join(args, " "))
	return expect.NewExpect("/bin/sh", cmdargs...)
}