@@ -856,6 +856,80 @@ var _ = Describe("Manila controller", func() {
856856 }, timeout , interval ).Should (Succeed ())
857857 })
858858 })
859+ When ("Manila CR instance is built with ExtraMounts" , func () {
860+ BeforeEach (func () {
861+ rawSpec := map [string ]interface {}{
862+ "secret" : SecretName ,
863+ "databaseInstance" : "openstack" ,
864+ "rabbitMqClusterName" : "rabbitmq" ,
865+ "extraMounts" : GetExtraMounts (),
866+ "manilaAPI" : map [string ]interface {}{
867+ "containerImage" : manilav1 .ManilaAPIContainerImage ,
868+ },
869+ "manilaScheduler" : map [string ]interface {}{
870+ "containerImage" : manilav1 .ManilaSchedulerContainerImage ,
871+ },
872+ "manilaShares" : map [string ]interface {}{
873+ "share0" : map [string ]interface {}{
874+ "containerImage" : manilav1 .ManilaShareContainerImage ,
875+ },
876+ },
877+ }
878+ DeferCleanup (th .DeleteInstance , CreateManila (manilaTest .Instance , rawSpec ))
879+ DeferCleanup (k8sClient .Delete , ctx , CreateManilaMessageBusSecret (manilaTest .Instance .Namespace , manilaTest .RabbitmqSecretName ))
880+ DeferCleanup (
881+ mariadb .DeleteDBService ,
882+ mariadb .CreateDBService (
883+ manilaTest .Instance .Namespace ,
884+ GetManila (manilaTest .Instance ).Spec .DatabaseInstance ,
885+ corev1.ServiceSpec {
886+ Ports : []corev1.ServicePort {{Port : 3306 }},
887+ },
888+ ),
889+ )
890+ infra .SimulateTransportURLReady (manilaTest .ManilaTransportURL )
891+ DeferCleanup (infra .DeleteMemcached , infra .CreateMemcached (namespace , manilaTest .MemcachedInstance , memcachedSpec ))
892+ infra .SimulateMemcachedReady (manilaTest .ManilaMemcached )
893+ keystoneAPIName := keystone .CreateKeystoneAPI (manilaTest .Instance .Namespace )
894+ DeferCleanup (keystone .DeleteKeystoneAPI , keystoneAPIName )
895+ keystoneAPI := keystone .GetKeystoneAPI (keystoneAPIName )
896+ keystoneAPI .Status .APIEndpoints ["internal" ] = "http://keystone-internal-openstack.testing"
897+ Eventually (func (g Gomega ) {
898+ g .Expect (k8sClient .Status ().Update (ctx , keystoneAPI .DeepCopy ())).Should (Succeed ())
899+ }, timeout , interval ).Should (Succeed ())
900+ mariadb .SimulateMariaDBDatabaseCompleted (manilaTest .ManilaDatabaseName )
901+ mariadb .SimulateMariaDBAccountCompleted (manilaTest .ManilaDatabaseAccount )
902+ th .SimulateJobSuccess (manilaTest .ManilaDBSync )
903+ keystone .SimulateKeystoneServiceReady (manilaTest .Instance )
904+ })
905+ It ("Check the extraMounts of the resulting StatefulSets" , func () {
906+ th .SimulateStatefulSetReplicaReady (manilaTest .ManilaAPI )
907+ th .SimulateStatefulSetReplicaReady (manilaTest .ManilaScheduler )
908+ th .SimulateStatefulSetReplicaReady (manilaTest .ManilaShares [0 ])
909+ keystone .SimulateKeystoneEndpointReady (manilaTest .ManilaKeystoneEndpoint )
910+ // Retrieve the generated resources
911+ share := manilaTest .ManilaShares [0 ]
912+ th .SimulateStatefulSetReplicaReady (share )
913+ ss := th .GetStatefulSet (share )
914+ // Check the resulting deployment fields
915+ Expect (int (* ss .Spec .Replicas )).To (Equal (1 ))
916+ Expect (ss .Spec .Template .Spec .Volumes ).To (HaveLen (7 ))
917+ Expect (ss .Spec .Template .Spec .Containers ).To (HaveLen (2 ))
918+ // Get the manila-share container
919+ container := ss .Spec .Template .Spec .Containers [1 ]
920+ // Fail if manila-share doesn't have the right number of
921+ // VolumeMounts entries
922+ Expect (container .VolumeMounts ).To (HaveLen (9 ))
923+ // Inspect VolumeMounts and make sure we have the Ceph MountPath
924+ // provided through extraMounts
925+ for _ , vm := range container .VolumeMounts {
926+ if vm .Name == "ceph" {
927+ Expect (vm .MountPath ).To (
928+ ContainSubstring (ManilaCephExtraMountsPath ))
929+ }
930+ }
931+ })
932+ })
859933
860934 // Run MariaDBAccount suite tests. these are pre-packaged ginkgo tests
861935 // that exercise standard account create / update patterns that should be
0 commit comments