Esempio 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
}
Esempio 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...)
}
Esempio n. 3
0
func spawnCmd(args []string) (*expect.ExpectProcess, error) {
	return expect.NewExpect(args[0], args[1:]...)
}
Esempio n. 4
0
func spawnCmd(args []string) (*expect.ExpectProcess, error) {
	cmdargs := append([]string{"-c"}, strings.Join(args, " "))
	return expect.NewExpect("/bin/sh", cmdargs...)
}