From dac2c10ce9df2c1ba3670224606beebdad8a3b8e Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Thu, 25 May 2017 15:14:06 -0700 Subject: [PATCH] etcdctl, e2e: use 0xe7cd as argument separator in cov-enabled etcdctl Fixes #7980 --- e2e/etcd_spawn_cov.go | 3 ++- etcdctl/ctlv2/ctl_cov.go | 2 +- etcdctl/ctlv3/ctl_cov.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/e2e/etcd_spawn_cov.go b/e2e/etcd_spawn_cov.go index 840cde493..6032ef201 100644 --- a/e2e/etcd_spawn_cov.go +++ b/e2e/etcd_spawn_cov.go @@ -56,7 +56,8 @@ func spawnCmd(args []string) (*expect.ExpectProcess, error) { } // avoid test flag conflicts in coverage enabled etcdctl by putting flags in ETCDCTL_ARGS ctl_cov_env := []string{ - "ETCDCTL_ARGS" + "=" + strings.Join(args, "\xff"), + // was \xff, but that's used for testing boundary conditions; 0xe7cd should be safe + "ETCDCTL_ARGS=" + strings.Join(args, "\xe7\xcd"), } // when withFlagByEnv() is used in testCtl(), env variables for ctl is set to os.env. // they must be included in ctl_cov_env. diff --git a/etcdctl/ctlv2/ctl_cov.go b/etcdctl/ctlv2/ctl_cov.go index f76125dce..e9f22f25d 100644 --- a/etcdctl/ctlv2/ctl_cov.go +++ b/etcdctl/ctlv2/ctl_cov.go @@ -24,5 +24,5 @@ import ( ) func runCtlV2(app *cli.App) error { - return app.Run(strings.Split(os.Getenv("ETCDCTL_ARGS"), "\xff")) + return app.Run(strings.Split(os.Getenv("ETCDCTL_ARGS"), "\xe7\xcd")) } diff --git a/etcdctl/ctlv3/ctl_cov.go b/etcdctl/ctlv3/ctl_cov.go index 79cf93cdc..1ce1f524a 100644 --- a/etcdctl/ctlv3/ctl_cov.go +++ b/etcdctl/ctlv3/ctl_cov.go @@ -26,7 +26,7 @@ import ( func Start() { // ETCDCTL_ARGS=etcdctl_test arg1 arg2... // SetArgs() takes arg1 arg2... - rootCmd.SetArgs(strings.Split(os.Getenv("ETCDCTL_ARGS"), "\xff")[1:]) + rootCmd.SetArgs(strings.Split(os.Getenv("ETCDCTL_ARGS"), "\xe7\xcd")[1:]) if err := rootCmd.Execute(); err != nil { command.ExitWithError(command.ExitError, err) }