Skip to content

Commit

Permalink
Modifying test case
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayja committed Mar 26, 2024
1 parent dd8412f commit 5fdde7c
Showing 1 changed file with 23 additions and 31 deletions.
54 changes: 23 additions & 31 deletions test/dynamic_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,6 @@ var _ = Describe(
aeroCluster.Spec.AerospikeConfig.Value["service"].(map[string]interface{})["proto-fd-max"] = 18000

aeroCluster.Spec.AerospikeConfig.Value["security"].(map[string]interface{})["log"] = log
dc := map[string]interface{}{
"name": "dc2",
"auth-mode": "internal",
"auth-user": "admin",
"node-address-ports": []string{
"aeroclusterdst-0-0 3000",
},
"auth-password-file": "/etc/aerospike/secret/password_DC1.txt",
"namespaces": []map[string]interface{}{
{
"name": "test",
},
},
}

aeroCluster.Spec.AerospikeConfig.Value["xdr"].(map[string]interface{})["dcs"] = append(
aeroCluster.Spec.AerospikeConfig.Value["xdr"].(map[string]interface{})["dcs"].([]interface{}), dc)

err = updateCluster(k8sClient, ctx, aeroCluster)
Expect(err).ToNot(HaveOccurred())
Expand All @@ -126,12 +109,6 @@ var _ = Describe(

Expect(reportDataOp).To(Equal("test"))

conf, err = getAerospikeConfigFromNode(logger, k8sClient, ctx, clusterNamespacedName,
"xdr", &pod)
Expect(err).ToNot(HaveOccurred())

Expect(conf["dcs"]).To(HaveLen(2))

By("Verify no warm/cold restarts in Pods")
validateServerRestart(ctx, aeroCluster, podPIDMap, false)

Expand All @@ -146,8 +123,6 @@ var _ = Describe(

delete(aeroCluster.Spec.AerospikeConfig.Value["service"].(map[string]interface{}), "proto-fd-max")
delete(aeroCluster.Spec.AerospikeConfig.Value["security"].(map[string]interface{}), "log")
aeroCluster.Spec.AerospikeConfig.Value["xdr"].(map[string]interface{})["dcs"] =
aeroCluster.Spec.AerospikeConfig.Value["xdr"].(map[string]interface{})["dcs"].([]interface{})[:1]

err = updateCluster(k8sClient, ctx, aeroCluster)
Expect(err).ToNot(HaveOccurred())
Expand All @@ -169,12 +144,6 @@ var _ = Describe(
_, ok = conf["log.report-data-op[0]"].(string)
Expect(ok).ToNot(BeTrue())

conf, err = getAerospikeConfigFromNode(logger, k8sClient, ctx, clusterNamespacedName,
"xdr", &pod)
Expect(err).ToNot(HaveOccurred())

Expect(conf["dcs"]).To(HaveLen(1))

By("Verify no warm/cold restarts in Pods")
validateServerRestart(ctx, aeroCluster, podPIDMap, false)

Expand All @@ -195,6 +164,23 @@ var _ = Describe(
Expect(err).ToNot(HaveOccurred())

aeroCluster.Spec.AerospikeConfig.Value["security"].(map[string]interface{})["enable-quotas"] = false
dc := map[string]interface{}{
"name": "dc2",
"auth-mode": "internal",
"auth-user": "admin",
"node-address-ports": []string{
"aeroclusterdst-0-0 3000",
},
"auth-password-file": "/etc/aerospike/secret/password_DC1.txt",
"namespaces": []map[string]interface{}{
{
"name": "test",
},
},
}

aeroCluster.Spec.AerospikeConfig.Value["xdr"].(map[string]interface{})["dcs"] = append(
aeroCluster.Spec.AerospikeConfig.Value["xdr"].(map[string]interface{})["dcs"].([]interface{}), dc)

err = updateCluster(k8sClient, ctx, aeroCluster)
Expect(err).ToNot(HaveOccurred())
Expand All @@ -210,6 +196,12 @@ var _ = Describe(

Expect(enableQuotas).To(BeFalse())

conf, err = getAerospikeConfigFromNode(logger, k8sClient, ctx, clusterNamespacedName,
"xdr", &pod)
Expect(err).ToNot(HaveOccurred())

Expect(conf["dcs"]).To(HaveLen(2))

By("Verify warm restarts in Pods")
validateServerRestart(ctx, aeroCluster, podPIDMap, true)
},
Expand Down

0 comments on commit 5fdde7c

Please sign in to comment.