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