@@ -3087,5 +3087,43 @@ var _ = Describe("OpenStackOperator controller galera and rabbitmq", func() {
30873087 })
30883088
30893089 })
3090+ })
3091+
3092+ var _ = Describe ("Application Credentials are enabled in control plane" , func () {
3093+ When ("global application credentials are enabled" , func () {
3094+ BeforeEach (func () {
3095+ spec := GetDefaultOpenStackControlPlaneSpec ()
3096+ spec ["applicationCredential" ] = map [string ]interface {}{"enabled" : true }
3097+ spec ["cinder" ] = map [string ]interface {}{
3098+ "enabled" : true ,
3099+ "applicationCredential" : map [string ]interface {}{
3100+ "enabled" : true ,
3101+ "expirationDays" : 100 ,
3102+ "gracePeriodDays" : 50 ,
3103+ "roles" : []string {"custom" , "role" },
3104+ "unrestricted" : true ,
3105+ },
3106+ }
30903107
3108+ DeferCleanup (th .DeleteInstance ,
3109+ CreateOpenStackControlPlane (names .OpenStackControlplaneName , spec ),
3110+ )
3111+ })
3112+
3113+ It ("should fill defaults" , func () {
3114+ cp := GetOpenStackControlPlane (names .OpenStackControlplaneName )
3115+ Expect (cp .Spec .ApplicationCredential .Enabled ).To (BeTrue ())
3116+ Expect (* cp .Spec .ApplicationCredential .ExpirationDays ).To (Equal (365 ))
3117+ Expect (* cp .Spec .ApplicationCredential .GracePeriodDays ).To (Equal (182 ))
3118+ Expect (cp .Spec .ApplicationCredential .Roles ).To (ConsistOf ("service" ))
3119+ Expect (* cp .Spec .ApplicationCredential .Unrestricted ).To (BeFalse ())
3120+
3121+ ac := cp .Spec .Cinder .ApplicationCredential
3122+ Expect (* ac .ExpirationDays ).To (Equal (100 ))
3123+ Expect (* ac .GracePeriodDays ).To (Equal (50 ))
3124+ Expect (ac .Roles ).To (ConsistOf ("custom" , "role" ))
3125+ Expect (* ac .Unrestricted ).To (BeTrue ())
3126+
3127+ })
3128+ })
30913129})
0 commit comments