@@ -863,6 +863,68 @@ var _ = Describe("Cinder controller", func() {
863
863
864
864
})
865
865
866
+ When ("Cinder CR instance is built with ExtraMounts" , func () {
867
+ BeforeEach (func () {
868
+ rawSpec := map [string ]interface {}{
869
+ "secret" : SecretName ,
870
+ "databaseInstance" : "openstack" ,
871
+ "rabbitMqClusterName" : "rabbitmq" ,
872
+ "extraMounts" : GetExtraMounts (),
873
+ "cinderAPI" : map [string ]interface {}{
874
+ "containerImage" : cinderv1 .CinderAPIContainerImage ,
875
+ },
876
+ "cinderScheduler" : map [string ]interface {}{
877
+ "containerImage" : cinderv1 .CinderSchedulerContainerImage ,
878
+ },
879
+ "cinderVolumes" : map [string ]interface {}{
880
+ "volume1" : map [string ]interface {}{
881
+ "containerImage" : cinderv1 .CinderVolumeContainerImage ,
882
+ },
883
+ },
884
+ }
885
+
886
+ DeferCleanup (th .DeleteInstance , CreateCinder (cinderTest .Instance , rawSpec ))
887
+ DeferCleanup (k8sClient .Delete , ctx , CreateCinderMessageBusSecret (cinderTest .Instance .Namespace , cinderTest .RabbitmqSecretName ))
888
+ DeferCleanup (
889
+ mariadb .DeleteDBService ,
890
+ mariadb .CreateDBService (
891
+ cinderTest .Instance .Namespace ,
892
+ GetCinder (cinderTest .Instance ).Spec .DatabaseInstance ,
893
+ corev1.ServiceSpec {
894
+ Ports : []corev1.ServicePort {{Port : 3306 }},
895
+ },
896
+ ),
897
+ )
898
+ infra .SimulateTransportURLReady (cinderTest .CinderTransportURL )
899
+ DeferCleanup (infra .DeleteMemcached , infra .CreateMemcached (namespace , cinderTest .MemcachedInstance , memcachedSpec ))
900
+ infra .SimulateMemcachedReady (cinderTest .CinderMemcached )
901
+ keystoneAPIName := keystone .CreateKeystoneAPI (cinderTest .Instance .Namespace )
902
+ DeferCleanup (keystone .DeleteKeystoneAPI , keystoneAPIName )
903
+ mariadb .SimulateMariaDBAccountCompleted (cinderTest .Database )
904
+ mariadb .SimulateMariaDBDatabaseCompleted (cinderTest .Database )
905
+ th .SimulateJobSuccess (cinderTest .CinderDBSync )
906
+ keystone .SimulateKeystoneEndpointReady (cinderTest .CinderKeystoneEndpoint )
907
+ })
908
+
909
+ It ("Check the extraMounts of the resulting StatefulSets" , func () {
910
+ th .SimulateStatefulSetReplicaReady (cinderTest .CinderAPI )
911
+ th .SimulateStatefulSetReplicaReady (cinderTest .CinderScheduler )
912
+ // Retrieve the generated resources
913
+ volume := cinderTest .CinderVolumes [0 ]
914
+ th .SimulateStatefulSetReplicaReady (volume )
915
+ ss := th .GetStatefulSet (volume )
916
+ // Check the resulting deployment replicas
917
+ Expect (int (* ss .Spec .Replicas )).To (Equal (1 ))
918
+ // Assert Volume exists in the StatefulSet
919
+ th .AssertVolumeExists (CinderCephExtraMountsSecretName , ss .Spec .Template .Spec .Volumes )
920
+ // Get the cinder-volume container
921
+ Expect (ss .Spec .Template .Spec .Containers ).To (HaveLen (2 ))
922
+ container := ss .Spec .Template .Spec .Containers [1 ]
923
+ // Inspect VolumeMounts and make sure we have the Ceph MountPath
924
+ // provided through extraMounts
925
+ th .AssertVolumeMountExists (CinderCephExtraMountsSecretName , "" , container .VolumeMounts )
926
+ })
927
+ })
866
928
// Run MariaDBAccount suite tests. these are pre-packaged ginkgo tests
867
929
// that exercise standard account create / update patterns that should be
868
930
// common to all controllers that ensure MariaDBAccount CRs.
0 commit comments