فهرست منبع

e2e: remove sh in spawnCmd

certain shells claim the ppid for expect processes which interferes with
signals
Anthony Romano 10 سال پیش
والد
کامیت
604a73c833
3فایلهای تغییر یافته به همراه3 افزوده شده و 4 حذف شده
  1. 1 1
      e2e/ctl_v2_test.go
  2. 1 1
      e2e/ctl_v3_test.go
  3. 1 2
      e2e/etcd_test.go

+ 1 - 1
e2e/ctl_v2_test.go

@@ -284,7 +284,7 @@ func etcdctlLs(clus *etcdProcessCluster, key string, quorum bool) error {
 }
 
 func etcdctlWatch(clus *etcdProcessCluster, key, value string, noSync bool) <-chan error {
-	cmdArgs := append(etcdctlPrefixArgs(clus), "watch", "--after-index 1", key)
+	cmdArgs := append(etcdctlPrefixArgs(clus), "watch", "--after-index=1", key)
 	if noSync {
 		cmdArgs = append(cmdArgs, "--no-sync")
 	}

+ 1 - 1
e2e/ctl_v3_test.go

@@ -513,7 +513,7 @@ func ctlV3Version(cx ctlCtx) error {
 }
 
 func ctlV3EpHealth(cx ctlCtx) error {
-	cmdArgs := append(cx.PrefixArgs(), "endpoint health")
+	cmdArgs := append(cx.PrefixArgs(), "endpoint", "health")
 	lines := make([]string, cx.epc.cfg.clusterSize)
 	for i := range lines {
 		lines[i] = "is healthy"

+ 1 - 2
e2e/etcd_test.go

@@ -416,8 +416,7 @@ func (epc *etcdProcessCluster) Close() (err error) {
 }
 
 func spawnCmd(args []string) (*expect.ExpectProcess, error) {
-	cmdargs := append([]string{"-c"}, strings.Join(args, " "))
-	return expect.NewExpect("/bin/sh", cmdargs...)
+	return expect.NewExpect(args[0], args[1:]...)
 }
 
 func spawnWithExpect(args []string, expected string) error {