Skip to content

Commit 9480ff4

Browse files
committed
Test AEE volume mounts
Signed-off-by: Brendan Shephard <[email protected]>
1 parent e951699 commit 9480ff4

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/functional/dataplane/openstackdataplanenodeset_controller_test.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,4 +1344,39 @@ var _ = Describe("Dataplane NodeSet Test", func() {
13441344
})
13451345
})
13461346

1347+
When("A NodeSet and Deployment are created", func() {
1348+
BeforeEach(func() {
1349+
nodeSetSpec := DefaultDataPlaneNodeSetSpec("edpm-compute")
1350+
nodeSetSpec["preProvisioned"] = true
1351+
nodeSetSpec["services"] = []string{"bootstrap"}
1352+
DeferCleanup(th.DeleteInstance, CreateNetConfig(dataplaneNetConfigName, DefaultNetConfigSpec()))
1353+
DeferCleanup(th.DeleteInstance, CreateDNSMasq(dnsMasqName, DefaultDNSMasqSpec()))
1354+
DeferCleanup(th.DeleteInstance, CreateDataplaneNodeSet(dataplaneNodeSetName, nodeSetSpec))
1355+
DeferCleanup(th.DeleteInstance, CreateDataplaneDeployment(dataplaneDeploymentName, DefaultDataPlaneDeploymentSpec()))
1356+
CreateSSHSecret(dataplaneSSHSecretName)
1357+
SimulateDNSMasqComplete(dnsMasqName)
1358+
SimulateIPSetComplete(dataplaneNodeName)
1359+
SimulateDNSDataComplete(dataplaneNodeSetName)
1360+
1361+
})
1362+
It("Should have SSH and Inventory volume mounts", func() {
1363+
Eventually(func(g Gomega) {
1364+
const bootstrapName string = "bootstrap"
1365+
// Make an AnsibleEE name for each service
1366+
ansibleeeName := types.NamespacedName{
1367+
Name: fmt.Sprintf(
1368+
bootstrapName + "-" + dataplaneDeploymentName.Name + "-" + dataplaneNodeSetName.Name),
1369+
Namespace: namespace,
1370+
}
1371+
ansibleEE := GetAnsibleee(ansibleeeName)
1372+
g.Expect(ansibleEE.Spec.Template.Spec.Volumes).To(HaveLen(2))
1373+
g.Expect(ansibleEE.Spec.Template.Spec.Volumes[0].Name).To(Equal("ssh-key"))
1374+
g.Expect(ansibleEE.Spec.Template.Spec.Volumes[1].Name).To(Equal("inventory"))
1375+
g.Expect(ansibleEE.Spec.Template.Spec.Volumes[0].VolumeSource.Secret.SecretName).To(Equal("dataplane-ansible-ssh-private-key-secret"))
1376+
g.Expect(ansibleEE.Spec.Template.Spec.Volumes[0].VolumeSource.Secret.Items[0].Path).To(Equal("ssh_key"))
1377+
g.Expect(ansibleEE.Spec.Template.Spec.Volumes[0].VolumeSource.Secret.Items[0].Key).To(Equal("ssh-privatekey"))
1378+
1379+
}, th.Timeout, th.Interval).Should(Succeed())
1380+
})
1381+
})
13471382
})

0 commit comments

Comments
 (0)