mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Test v3 storage configuration validation
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
parent
e1d79097d5
commit
fbdf65f101
@ -276,8 +276,17 @@ func TestClusterValidateAndAssignIDs(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestClusterValidateConfigurationChange(t *testing.T) {
|
||||
func TestClusterValidateConfigurationChangeV3(t *testing.T) {
|
||||
testClusterValidateConfigurationChange(t, true)
|
||||
}
|
||||
func TestClusterValidateConfigurationChangeV2(t *testing.T) {
|
||||
testClusterValidateConfigurationChange(t, false)
|
||||
}
|
||||
|
||||
func testClusterValidateConfigurationChange(t *testing.T, shouldApplyV3 ShouldApplyV3) {
|
||||
cl := NewCluster(zaptest.NewLogger(t), WithMaxLearners(1))
|
||||
be := newMembershipBackend()
|
||||
cl.SetBackend(be)
|
||||
cl.SetStore(v2store.New())
|
||||
for i := 1; i <= 4; i++ {
|
||||
var isLearner bool
|
||||
@ -455,7 +464,7 @@ func TestClusterValidateConfigurationChange(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for i, tt := range tests {
|
||||
err := cl.ValidateConfigurationChange(tt.cc, false)
|
||||
err := cl.ValidateConfigurationChange(tt.cc, shouldApplyV3)
|
||||
if err != tt.werr {
|
||||
t.Errorf("#%d: validateConfigurationChange error = %v, want %v", i, err, tt.werr)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user