diff --git a/tests/e2e/ctl_v3_auth_test.go b/tests/e2e/ctl_v3_auth_test.go index de1c9f8d915a..cf4b7d916a45 100644 --- a/tests/e2e/ctl_v3_auth_test.go +++ b/tests/e2e/ctl_v3_auth_test.go @@ -41,7 +41,7 @@ func TestCtlV3AuthTxnJWT(t *testing.T) { testCtl(t, authTestTxn, wi func TestCtlV3AuthPrefixPerm(t *testing.T) { testCtl(t, authTestPrefixPerm) } func TestCtlV3AuthMemberAdd(t *testing.T) { testCtl(t, authTestMemberAdd) } func TestCtlV3AuthMemberRemove(t *testing.T) { - testCtl(t, authTestMemberRemove, withQuorum(), withNoStrictReconfig()) + testCtl(t, authTestMemberRemove, withQuorum(), withDisableStrictReconfig()) } func TestCtlV3AuthMemberUpdate(t *testing.T) { testCtl(t, authTestMemberUpdate) } func TestCtlV3AuthRevokeWithDelete(t *testing.T) { testCtl(t, authTestRevokeWithDelete) } diff --git a/tests/e2e/ctl_v3_member_test.go b/tests/e2e/ctl_v3_member_test.go index a80642398dd3..61e7957eb66a 100644 --- a/tests/e2e/ctl_v3_member_test.go +++ b/tests/e2e/ctl_v3_member_test.go @@ -29,16 +29,16 @@ import ( func TestCtlV3MemberList(t *testing.T) { testCtl(t, memberListTest) } func TestCtlV3MemberListWithHex(t *testing.T) { testCtl(t, memberListWithHexTest) } func TestCtlV3MemberRemove(t *testing.T) { - testCtl(t, memberRemoveTest, withQuorum(), withNoStrictReconfig()) + testCtl(t, memberRemoveTest, withQuorum(), withDisableStrictReconfig()) } func TestCtlV3MemberRemoveNoTLS(t *testing.T) { - testCtl(t, memberRemoveTest, withQuorum(), withNoStrictReconfig(), withCfg(*e2e.NewConfigNoTLS())) + testCtl(t, memberRemoveTest, withQuorum(), withDisableStrictReconfig(), withCfg(*e2e.NewConfigNoTLS())) } func TestCtlV3MemberRemoveClientTLS(t *testing.T) { - testCtl(t, memberRemoveTest, withQuorum(), withNoStrictReconfig(), withCfg(*e2e.NewConfigClientTLS())) + testCtl(t, memberRemoveTest, withQuorum(), withDisableStrictReconfig(), withCfg(*e2e.NewConfigClientTLS())) } func TestCtlV3MemberRemoveClientAutoTLS(t *testing.T) { - testCtl(t, memberRemoveTest, withQuorum(), withNoStrictReconfig(), withCfg( + testCtl(t, memberRemoveTest, withQuorum(), withDisableStrictReconfig(), withCfg( // default ClusterSize is 1 e2e.EtcdProcessClusterConfig{ ClusterSize: 3, @@ -48,7 +48,7 @@ func TestCtlV3MemberRemoveClientAutoTLS(t *testing.T) { })) } func TestCtlV3MemberRemovePeerTLS(t *testing.T) { - testCtl(t, memberRemoveTest, withQuorum(), withNoStrictReconfig(), withCfg(*e2e.NewConfigPeerTLS())) + testCtl(t, memberRemoveTest, withQuorum(), withDisableStrictReconfig(), withCfg(*e2e.NewConfigPeerTLS())) } func TestCtlV3MemberAdd(t *testing.T) { testCtl(t, memberAddTest) } func TestCtlV3MemberAddNoTLS(t *testing.T) { testCtl(t, memberAddTest, withCfg(*e2e.NewConfigNoTLS())) } diff --git a/tests/e2e/ctl_v3_test.go b/tests/e2e/ctl_v3_test.go index 2c3867a48ead..c4566383de4c 100644 --- a/tests/e2e/ctl_v3_test.go +++ b/tests/e2e/ctl_v3_test.go @@ -122,11 +122,12 @@ func dialWithSchemeTest(cx ctlCtx) { } type ctlCtx struct { - t *testing.T - apiPrefix string - cfg e2e.EtcdProcessClusterConfig - corruptFunc func(string) error - noStrictReconfig bool + t *testing.T + apiPrefix string + cfg e2e.EtcdProcessClusterConfig + + corruptFunc func(string) error + disableStrictReconfigCheck bool epc *e2e.EtcdProcessCluster @@ -185,8 +186,8 @@ func withCorruptFunc(f func(string) error) ctlOption { return func(cx *ctlCtx) { cx.corruptFunc = f } } -func withNoStrictReconfig() ctlOption { - return func(cx *ctlCtx) { cx.noStrictReconfig = true } +func withDisableStrictReconfig() ctlOption { + return func(cx *ctlCtx) { cx.disableStrictReconfigCheck = true } } func withApiPrefix(p string) ctlOption { @@ -226,7 +227,7 @@ func testCtlWithOffline(t *testing.T, testFunc func(ctlCtx), testOfflineFunc fun if !ret.quorum { ret.cfg = *e2e.ConfigStandalone(ret.cfg) } - ret.cfg.NoStrictReconfig = ret.noStrictReconfig + ret.cfg.DisableStrictReconfigCheck = ret.disableStrictReconfigCheck if ret.initialCorruptCheck { ret.cfg.InitialCorruptCheck = ret.initialCorruptCheck } diff --git a/tests/framework/config/cluster.go b/tests/framework/config/cluster.go index cd7f50f39b90..22eeaae12cd6 100644 --- a/tests/framework/config/cluster.go +++ b/tests/framework/config/cluster.go @@ -27,8 +27,9 @@ const ( ) type ClusterConfig struct { - ClusterSize int - PeerTLS TLSConfig - ClientTLS TLSConfig - QuotaBackendBytes int64 + ClusterSize int + PeerTLS TLSConfig + ClientTLS TLSConfig + QuotaBackendBytes int64 + DisableStrictReconfigCheck bool } diff --git a/tests/framework/e2e.go b/tests/framework/e2e.go index db54018d0451..e113249b641e 100644 --- a/tests/framework/e2e.go +++ b/tests/framework/e2e.go @@ -43,9 +43,10 @@ func (e e2eRunner) BeforeTest(t testing.TB) { func (e e2eRunner) NewCluster(ctx context.Context, t testing.TB, cfg config.ClusterConfig) Cluster { e2eConfig := e2e.EtcdProcessClusterConfig{ - InitialToken: "new", - ClusterSize: cfg.ClusterSize, - QuotaBackendBytes: cfg.QuotaBackendBytes, + InitialToken: "new", + ClusterSize: cfg.ClusterSize, + QuotaBackendBytes: cfg.QuotaBackendBytes, + DisableStrictReconfigCheck: cfg.DisableStrictReconfigCheck, } switch cfg.ClientTLS { case config.NoTLS: diff --git a/tests/framework/e2e/cluster.go b/tests/framework/e2e/cluster.go index e8d202c5b677..61706136c5c8 100644 --- a/tests/framework/e2e/cluster.go +++ b/tests/framework/e2e/cluster.go @@ -166,14 +166,14 @@ type EtcdProcessClusterConfig struct { CipherSuites []string - ForceNewCluster bool - InitialToken string - QuotaBackendBytes int64 - NoStrictReconfig bool - EnableV2 bool - InitialCorruptCheck bool - AuthTokenOpts string - V2deprecation string + ForceNewCluster bool + InitialToken string + QuotaBackendBytes int64 + DisableStrictReconfigCheck bool + EnableV2 bool + InitialCorruptCheck bool + AuthTokenOpts string + V2deprecation string RollingStart bool @@ -317,7 +317,7 @@ func (cfg *EtcdProcessClusterConfig) EtcdServerProcessConfigs(tb testing.TB) []* "--quota-backend-bytes", fmt.Sprintf("%d", cfg.QuotaBackendBytes), ) } - if cfg.NoStrictReconfig { + if cfg.DisableStrictReconfigCheck { args = append(args, "--strict-reconfig-check=false") } if cfg.EnableV2 { diff --git a/tests/framework/integration.go b/tests/framework/integration.go index f2f4e8b8b14b..05b3bceb9d6f 100644 --- a/tests/framework/integration.go +++ b/tests/framework/integration.go @@ -48,6 +48,7 @@ func (e integrationRunner) NewCluster(ctx context.Context, t testing.TB, cfg con integrationCfg.Size = cfg.ClusterSize integrationCfg.ClientTLS, err = tlsInfo(t, cfg.ClientTLS) integrationCfg.QuotaBackendBytes = cfg.QuotaBackendBytes + integrationCfg.DisableStrictReconfigCheck = cfg.DisableStrictReconfigCheck if err != nil { t.Fatalf("ClientTLS: %s", err) } diff --git a/tests/framework/integration/cluster.go b/tests/framework/integration/cluster.go index d9a21645348d..82d4a7b41bbb 100644 --- a/tests/framework/integration/cluster.go +++ b/tests/framework/integration/cluster.go @@ -169,7 +169,7 @@ type ClusterConfig struct { WatchProgressNotifyInterval time.Duration ExperimentalMaxLearners int - StrictReconfigCheck bool + DisableStrictReconfigCheck bool CorruptCheckTime time.Duration } @@ -283,7 +283,7 @@ func (c *Cluster) mustNewMember(t testutil.TB) *Member { LeaseCheckpointPersist: c.Cfg.LeaseCheckpointPersist, WatchProgressNotifyInterval: c.Cfg.WatchProgressNotifyInterval, ExperimentalMaxLearners: c.Cfg.ExperimentalMaxLearners, - StrictReconfigCheck: c.Cfg.StrictReconfigCheck, + DisableStrictReconfigCheck: c.Cfg.DisableStrictReconfigCheck, CorruptCheckTime: c.Cfg.CorruptCheckTime, }) m.DiscoveryURL = c.Cfg.DiscoveryURL @@ -604,7 +604,7 @@ type MemberConfig struct { LeaseCheckpointPersist bool WatchProgressNotifyInterval time.Duration ExperimentalMaxLearners int - StrictReconfigCheck bool + DisableStrictReconfigCheck bool CorruptCheckTime time.Duration } @@ -720,7 +720,7 @@ func MustNewMember(t testutil.TB, mcfg MemberConfig) *Member { m.V2Deprecation = config.V2_DEPR_DEFAULT m.GrpcServerRecorder = &grpc_testing.GrpcRecorder{} m.Logger = memberLogger(t, mcfg.Name) - m.StrictReconfigCheck = mcfg.StrictReconfigCheck + m.StrictReconfigCheck = !mcfg.DisableStrictReconfigCheck if err := m.listenGRPC(); err != nil { t.Fatalf("listenGRPC FAILED: %v", err) } diff --git a/tests/integration/cluster_test.go b/tests/integration/cluster_test.go index c938f8ea138b..4f61493cc84f 100644 --- a/tests/integration/cluster_test.go +++ b/tests/integration/cluster_test.go @@ -333,7 +333,7 @@ func TestIssue3699(t *testing.T) { // TestRejectUnhealthyAdd ensures an unhealthy cluster rejects adding members. func TestRejectUnhealthyAdd(t *testing.T) { integration.BeforeTest(t) - c := integration.NewCluster(t, &integration.ClusterConfig{Size: 3, UseBridge: true, StrictReconfigCheck: true}) + c := integration.NewCluster(t, &integration.ClusterConfig{Size: 3, UseBridge: true}) defer c.Terminate(t) // make Cluster unhealthy and wait for downed peer @@ -373,7 +373,7 @@ func TestRejectUnhealthyAdd(t *testing.T) { // if quorum will be lost. func TestRejectUnhealthyRemove(t *testing.T) { integration.BeforeTest(t) - c := integration.NewCluster(t, &integration.ClusterConfig{Size: 5, UseBridge: true, StrictReconfigCheck: true}) + c := integration.NewCluster(t, &integration.ClusterConfig{Size: 5, UseBridge: true}) defer c.Terminate(t) // make cluster unhealthy and wait for downed peer; (3 up, 2 down) @@ -418,11 +418,11 @@ func TestRestartRemoved(t *testing.T) { integration.BeforeTest(t) // 1. start single-member Cluster - c := integration.NewCluster(t, &integration.ClusterConfig{Size: 1, StrictReconfigCheck: true}) + c := integration.NewCluster(t, &integration.ClusterConfig{Size: 1}) defer c.Terminate(t) // 2. add a new member - c.Cfg.StrictReconfigCheck = false + c.Cfg.DisableStrictReconfigCheck = true c.AddMember(t) c.WaitLeader(t)