e2e: support --strict-reconfig-check=false

This commit is contained in:
Anthony Romano 2016-08-11 11:13:04 -07:00
parent e742ff331f
commit aa9837e8ff
3 changed files with 14 additions and 2 deletions

View File

@ -25,7 +25,9 @@ import (
) )
func TestCtlV3MemberList(t *testing.T) { testCtl(t, memberListTest) } func TestCtlV3MemberList(t *testing.T) { testCtl(t, memberListTest) }
func TestCtlV3MemberRemove(t *testing.T) { testCtl(t, memberRemoveTest, withQuorum()) } func TestCtlV3MemberRemove(t *testing.T) {
testCtl(t, memberRemoveTest, withQuorum(), withNoStrictReconfig())
}
func TestCtlV3MemberAdd(t *testing.T) { testCtl(t, memberAddTest) } func TestCtlV3MemberAdd(t *testing.T) { testCtl(t, memberAddTest) }
func TestCtlV3MemberUpdate(t *testing.T) { testCtl(t, memberUpdateTest) } func TestCtlV3MemberUpdate(t *testing.T) { testCtl(t, memberUpdateTest) }

View File

@ -41,6 +41,7 @@ type ctlCtx struct {
t *testing.T t *testing.T
cfg etcdProcessClusterConfig cfg etcdProcessClusterConfig
quotaBackendBytes int64 quotaBackendBytes int64
noStrictReconfig bool
epc *etcdProcessCluster epc *etcdProcessCluster
@ -88,6 +89,10 @@ func withCompactPhysical() ctlOption {
return func(cx *ctlCtx) { cx.compactPhysical = true } return func(cx *ctlCtx) { cx.compactPhysical = true }
} }
func withNoStrictReconfig() ctlOption {
return func(cx *ctlCtx) { cx.noStrictReconfig = true }
}
func testCtl(t *testing.T, testFunc func(ctlCtx), opts ...ctlOption) { func testCtl(t *testing.T, testFunc func(ctlCtx), opts ...ctlOption) {
defer testutil.AfterTest(t) defer testutil.AfterTest(t)
@ -106,6 +111,7 @@ func testCtl(t *testing.T, testFunc func(ctlCtx), opts ...ctlOption) {
if ret.quotaBackendBytes > 0 { if ret.quotaBackendBytes > 0 {
ret.cfg.quotaBackendBytes = ret.quotaBackendBytes ret.cfg.quotaBackendBytes = ret.quotaBackendBytes
} }
ret.cfg.noStrictReconfig = ret.noStrictReconfig
epc, err := newEtcdProcessCluster(&ret.cfg) epc, err := newEtcdProcessCluster(&ret.cfg)
if err != nil { if err != nil {

View File

@ -165,6 +165,7 @@ type etcdProcessClusterConfig struct {
forceNewCluster bool forceNewCluster bool
initialToken string initialToken string
quotaBackendBytes int64 quotaBackendBytes int64
noStrictReconfig bool
} }
// newEtcdProcessCluster launches a new cluster from etcd processes, returning // newEtcdProcessCluster launches a new cluster from etcd processes, returning
@ -285,6 +286,9 @@ func (cfg *etcdProcessClusterConfig) etcdProcessConfigs() []*etcdProcessConfig {
"--quota-backend-bytes", fmt.Sprintf("%d", cfg.quotaBackendBytes), "--quota-backend-bytes", fmt.Sprintf("%d", cfg.quotaBackendBytes),
) )
} }
if cfg.noStrictReconfig {
args = append(args, "--strict-reconfig-check=false")
}
args = append(args, cfg.tlsArgs()...) args = append(args, cfg.tlsArgs()...)
etcdCfgs[i] = &etcdProcessConfig{ etcdCfgs[i] = &etcdProcessConfig{