Test v3 storage configuration validation

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
Marek Siarkowicz 2023-11-27 12:00:12 +01:00
parent e1d79097d5
commit fbdf65f101

View File

@ -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)
}