From ce72635b10d49b0ca7a52635f6d283861cfc7716 Mon Sep 17 00:00:00 2001 From: Tanmay Jain Date: Wed, 24 Apr 2024 11:48:21 +0530 Subject: [PATCH] adding test for rf change --- test/cluster_test.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/cluster_test.go b/test/cluster_test.go index 37c1f1aa3..84da35a98 100644 --- a/test/cluster_test.go +++ b/test/cluster_test.go @@ -1146,6 +1146,35 @@ func UpdateClusterTest(ctx goctx.Context) { Expect(err).Should(HaveOccurred()) }, ) + + It( + "UpdateReplicationFactor: should fail for updating namespace"+ + "replication-factor on non-SC namespace. Cannot be updated", + func() { + By("RollingRestart By Adding Namespace Dynamically") + + err := rollingRestartClusterByAddingNamespaceDynamicallyTest( + k8sClient, ctx, dynamicNs, clusterNamespacedName, + ) + Expect(err).ToNot(HaveOccurred()) + + aeroCluster, err := getCluster( + k8sClient, ctx, + clusterNamespacedName, + ) + Expect(err).ToNot(HaveOccurred()) + + nsList := aeroCluster.Spec.AerospikeConfig.Value["namespaces"].([]interface{}) + namespaceConfig := nsList[len(nsList)-1].(map[string]interface{}) + namespaceConfig["replication-factor"] = 3 + aeroCluster.Spec.AerospikeConfig.Value["namespaces"].([]interface{})[len(nsList)-1] = namespaceConfig + + err = k8sClient.Update( + ctx, aeroCluster, + ) + Expect(err).Should(HaveOccurred()) + }, + ) }, )