Skip to content

Commit bd9c83e

Browse files
committed
Add envTests for notificationsBusInstance interface lifecycle
Add comprehensive envTests covering the "notificationsBusInstance" parameter lifecycle and its propagation to implementing services. The tests validate three key scenarios: - Base use case: parameter is properly referenced and used - Override use case: service overrides with a custom/dedicated rabbitmq instance - Removal use case: services disable notifications when parameter is removed This demonstrates the flexibility of referencing non-default rabbit instances and ensures consistent interface implementation across different services. Signed-off-by: Francesco Pantano <[email protected]>
1 parent 37cad6e commit bd9c83e

File tree

2 files changed

+288
-61
lines changed

2 files changed

+288
-61
lines changed

tests/functional/ctlplane/base_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
manilav1 "github.com/openstack-k8s-operators/manila-operator/api/v1beta1"
3838
mariadbv1 "github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1"
3939
neutronv1 "github.com/openstack-k8s-operators/neutron-operator/api/v1beta1"
40+
novav1 "github.com/openstack-k8s-operators/nova-operator/api/v1beta1"
4041
openstackclientv1 "github.com/openstack-k8s-operators/openstack-operator/apis/client/v1beta1"
4142
corev1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1"
4243
dataplanev1 "github.com/openstack-k8s-operators/openstack-operator/apis/dataplane/v1beta1"
@@ -69,6 +70,8 @@ type Names struct {
6970
RabbitMQCertName types.NamespacedName
7071
RabbitMQCell1Name types.NamespacedName
7172
RabbitMQCell1CertName types.NamespacedName
73+
RabbitMQNotificationsName types.NamespacedName
74+
RabbitMQNotificationsCertName types.NamespacedName
7275
NoVNCProxyCell1CertPublicRouteName types.NamespacedName
7376
NoVNCProxyCell1CertPublicSvcName types.NamespacedName
7477
NoVNCProxyCell1CertVencryptName types.NamespacedName
@@ -223,6 +226,14 @@ func CreateNames(openstackControlplaneName types.NamespacedName) Names {
223226
Namespace: openstackControlplaneName.Namespace,
224227
Name: "cert-rabbitmq-cell1-svc",
225228
},
229+
RabbitMQNotificationsName: types.NamespacedName{
230+
Namespace: openstackControlplaneName.Namespace,
231+
Name: "rabbitmq-notifications",
232+
},
233+
RabbitMQNotificationsCertName: types.NamespacedName{
234+
Namespace: openstackControlplaneName.Namespace,
235+
Name: "cert-rabbitmq-notifications-svc",
236+
},
226237
NoVNCProxyCell1CertPublicRouteName: types.NamespacedName{
227238
Name: "cert-nova-novncproxy-cell1-public-route",
228239
Namespace: openstackControlplaneName.Namespace,
@@ -535,6 +546,9 @@ func GetDefaultOpenStackControlPlaneSpec() map[string]interface{} {
535546
names.RabbitMQCell1Name.Name: map[string]interface{}{
536547
"replicas": 1,
537548
},
549+
names.RabbitMQNotificationsName.Name: map[string]interface{}{
550+
"replicas": 1,
551+
},
538552
}
539553
galeraTemplate := map[string]interface{}{
540554
names.DBName.Name: map[string]interface{}{
@@ -876,6 +890,15 @@ func GetNeutron(name types.NamespacedName) *neutronv1.NeutronAPI {
876890
return instance
877891
}
878892

893+
// GetNova
894+
func GetNova(name types.NamespacedName) *novav1.Nova {
895+
instance := &novav1.Nova{}
896+
Eventually(func(g Gomega) {
897+
g.Expect(k8sClient.Get(ctx, name, instance)).Should(Succeed())
898+
}, timeout, interval).Should(Succeed())
899+
return instance
900+
}
901+
879902
// GetManila
880903
func GetManila(name types.NamespacedName) *manilav1.Manila {
881904
instance := &manilav1.Manila{}

0 commit comments

Comments
 (0)