mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
e2e: support --strict-reconfig-check=false
This commit is contained in:
parent
e742ff331f
commit
aa9837e8ff
@ -24,8 +24,10 @@ import (
|
|||||||
"github.com/coreos/etcd/etcdserver/etcdserverpb"
|
"github.com/coreos/etcd/etcdserver/etcdserverpb"
|
||||||
)
|
)
|
||||||
|
|
||||||
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) }
|
||||||
|
|
||||||
|
@ -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 {
|
||||||
|
@ -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{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user