From ad1c64a67e787da8169f408b9fbb28e554816e03 Mon Sep 17 00:00:00 2001 From: Brendan Shephard Date: Tue, 10 Sep 2024 14:26:41 +1000 Subject: [PATCH] Test AEE volume mounts Signed-off-by: Brendan Shephard --- ...enstackdataplanenodeset_controller_test.go | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/functional/dataplane/openstackdataplanenodeset_controller_test.go b/tests/functional/dataplane/openstackdataplanenodeset_controller_test.go index 8d5ad0457..d222903eb 100644 --- a/tests/functional/dataplane/openstackdataplanenodeset_controller_test.go +++ b/tests/functional/dataplane/openstackdataplanenodeset_controller_test.go @@ -1344,4 +1344,37 @@ var _ = Describe("Dataplane NodeSet Test", func() { }) }) + When("A NodeSet and Deployment are created", func() { + BeforeEach(func() { + nodeSetSpec := DefaultDataPlaneNodeSetSpec("edpm-compute") + nodeSetSpec["preProvisioned"] = true + nodeSetSpec["services"] = []string{"bootstrap"} + DeferCleanup(th.DeleteInstance, CreateNetConfig(dataplaneNetConfigName, DefaultNetConfigSpec())) + DeferCleanup(th.DeleteInstance, CreateDNSMasq(dnsMasqName, DefaultDNSMasqSpec())) + DeferCleanup(th.DeleteInstance, CreateDataplaneNodeSet(dataplaneNodeSetName, nodeSetSpec)) + DeferCleanup(th.DeleteInstance, CreateDataplaneDeployment(dataplaneDeploymentName, DefaultDataPlaneDeploymentSpec())) + CreateSSHSecret(dataplaneSSHSecretName) + SimulateDNSMasqComplete(dnsMasqName) + SimulateIPSetComplete(dataplaneNodeName) + SimulateDNSDataComplete(dataplaneNodeSetName) + + }) + It("Should have SSH and Inventory volume mounts", func() { + Eventually(func(g Gomega) { + const bootstrapName string = "bootstrap" + // Make an AnsibleEE name for each service + ansibleeeName := types.NamespacedName{ + Name: fmt.Sprintf( + bootstrapName + "-" + dataplaneDeploymentName.Name + "-" + dataplaneNodeSetName.Name), + Namespace: namespace, + } + ansibleEE := GetAnsibleee(ansibleeeName) + g.Expect(ansibleEE.Spec.Template.Spec.Volumes).To(HaveLen(2)) + g.Expect(ansibleEE.Spec.Template.Spec.Volumes[0].Name).To(Equal("ssh-key")) + g.Expect(ansibleEE.Spec.Template.Spec.Volumes[1].Name).To(Equal("inventory")) + g.Expect(ansibleEE.Spec.Template.Spec.Volumes[0].VolumeSource.Secret.SecretName).To(Equal("dataplane-ansible-ssh-private-key-secret")) + + }, th.Timeout, th.Interval).Should(Succeed()) + }) + }) })