Skip to content

Commit

Permalink
[#803] Fix ActiveMQArtemis controller tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brusdev committed Feb 27, 2024
1 parent dffc903 commit 37d8dd1
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions controllers/activemqartemis_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ var _ = Describe("artemis controller", func() {
g.Expect(k8sClient.Get(ctx, ingKey, &ingress)).To(Succeed())

g.Expect(len(ingress.Spec.Rules)).To(Equal(1)) //artemis-broker-amqp-ssl-0-svc-ing.
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-amqp-ssl-0-svc-ing." + ingressHostDomainSubString))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-amqp-ssl-0-svc-ing-" + defaultNamespace + "." + ingressHostDomainSubString))
g.Expect(len(ingress.Spec.Rules[0].HTTP.Paths)).To(BeEquivalentTo(1))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Name).To(Equal(brokerCr.Name + "-amqp-ssl-0-svc"))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Port.Name).To(Equal("amqp-ssl-0"))
Expand All @@ -332,7 +332,7 @@ var _ = Describe("artemis controller", func() {

g.Expect(len(ingress.Spec.TLS)).To(BeEquivalentTo(1))
g.Expect(len(ingress.Spec.TLS[0].Hosts)).To(BeEquivalentTo(1))
g.Expect(ingress.Spec.TLS[0].Hosts[0]).To(Equal(brokerCr.Name + "-amqp-ssl-0-svc-ing." + ingressHostDomainSubString))
g.Expect(ingress.Spec.TLS[0].Hosts[0]).To(Equal(brokerCr.Name + "-amqp-ssl-0-svc-ing-" + defaultNamespace + "." + ingressHostDomainSubString))

}, existingClusterTimeout, existingClusterInterval).Should(Succeed())

Expand All @@ -345,7 +345,7 @@ var _ = Describe("artemis controller", func() {
g.Expect(k8sClient.Get(ctx, ingKey, &ingress)).To(Succeed())

g.Expect(len(ingress.Spec.Rules)).To(Equal(1))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-connector-ssl-0-svc-ing." + ingressHostDomainSubString))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-connector-ssl-0-svc-ing-" + defaultNamespace + "." + ingressHostDomainSubString))
g.Expect(len(ingress.Spec.Rules[0].HTTP.Paths)).To(BeEquivalentTo(1))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Name).To(Equal(brokerCr.Name + "-connector-ssl-0-svc"))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Port.Name).To(Equal("connector-ssl-0"))
Expand All @@ -354,7 +354,7 @@ var _ = Describe("artemis controller", func() {

g.Expect(len(ingress.Spec.TLS)).To(BeEquivalentTo(1))
g.Expect(len(ingress.Spec.TLS[0].Hosts)).To(BeEquivalentTo(1))
g.Expect(ingress.Spec.TLS[0].Hosts[0]).To(Equal(brokerCr.Name + "-connector-ssl-0-svc-ing." + ingressHostDomainSubString))
g.Expect(ingress.Spec.TLS[0].Hosts[0]).To(Equal(brokerCr.Name + "-connector-ssl-0-svc-ing-" + defaultNamespace + "." + ingressHostDomainSubString))

}, existingClusterTimeout, existingClusterInterval).Should(Succeed())
}
Expand Down Expand Up @@ -1911,7 +1911,7 @@ var _ = Describe("artemis controller", func() {
Eventually(func(g Gomega) {
g.Expect(k8sClient.Get(ctx, routeKey, &route)).To(Succeed())

host = route.Name + "." + crd.Spec.IngressDomain
host = route.Name + "-" + defaultNamespace + "." + crd.Spec.IngressDomain
g.Expect(route.Spec.Port.TargetPort).To(Equal(intstr.FromString("wconsj-0")))
g.Expect(route.Spec.To.Kind).To(Equal("Service"))
g.Expect(route.Spec.To.Name).To(Equal(crd.Name + "-wconsj-0-svc"))
Expand All @@ -1930,7 +1930,7 @@ var _ = Describe("artemis controller", func() {
Eventually(func(g Gomega) {
g.Expect(k8sClient.Get(ctx, ingKey, &ingress)).To(Succeed())

host = ingress.Name + "." + crd.Spec.IngressDomain
host = ingress.Name + "-" + defaultNamespace + "." + crd.Spec.IngressDomain
g.Expect(ingress.Spec.Rules).To(HaveLen(1))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(host))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths).To(HaveLen(1))
Expand Down Expand Up @@ -2349,7 +2349,7 @@ var _ = Describe("artemis controller", func() {
}, existingClusterTimeout, existingClusterInterval).Should(Succeed())

if isOpenshift || isIngressSSLPassthroughEnabled {
host := ingress.Name + "." + brokerCr.Spec.IngressDomain
host := ingress.Name + "-" + defaultNamespace + "." + brokerCr.Spec.IngressDomain

By("check console is reachable")
httpClient := http.Client{Timeout: timeout, Transport: &http.Transport{
Expand All @@ -2372,7 +2372,7 @@ var _ = Describe("artemis controller", func() {
g.Expect(k8sClient.Get(ctx, ingKey, &ingress)).To(Succeed())

g.Expect(len(ingress.Spec.Rules)).To(Equal(1))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-acceptor-0-svc-ing." + defaultTestIngressDomain))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-acceptor-0-svc-ing-" + defaultNamespace + "." + defaultTestIngressDomain))
g.Expect(len(ingress.Spec.Rules[0].HTTP.Paths)).To(BeEquivalentTo(1))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Name).To(Equal(brokerCr.Name + "-acceptor-0-svc"))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Port.Name).To(Equal("acceptor-0"))
Expand All @@ -2390,7 +2390,7 @@ var _ = Describe("artemis controller", func() {
g.Expect(k8sClient.Get(ctx, ingKey, &ingress)).To(Succeed())

g.Expect(len(ingress.Spec.Rules)).To(Equal(1))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-connector-0-svc-ing." + defaultTestIngressDomain))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-connector-0-svc-ing-" + defaultNamespace + "." + defaultTestIngressDomain))
g.Expect(len(ingress.Spec.Rules[0].HTTP.Paths)).To(BeEquivalentTo(1))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Name).To(Equal(brokerCr.Name + "-connector-0-svc"))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Port.Name).To(Equal("connector-0"))
Expand Down Expand Up @@ -2473,7 +2473,7 @@ var _ = Describe("artemis controller", func() {
}, existingClusterTimeout, existingClusterInterval).Should(Succeed())

if isOpenshift || isIngressSSLPassthroughEnabled {
host := ingress.Name + "." + brokerCr.Spec.IngressDomain
host := ingress.Name + "-" + defaultNamespace + "." + brokerCr.Spec.IngressDomain

By("check console is reachable")
httpClient := http.Client{Timeout: timeout, Transport: &http.Transport{
Expand All @@ -2496,7 +2496,7 @@ var _ = Describe("artemis controller", func() {
g.Expect(k8sClient.Get(ctx, ingKey, &ingress)).To(Succeed())

g.Expect(len(ingress.Spec.Rules)).To(Equal(1))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-acceptor-0-svc-ing." + defaultTestIngressDomain))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-acceptor-0-svc-ing-" + defaultNamespace + "." + defaultTestIngressDomain))
g.Expect(len(ingress.Spec.Rules[0].HTTP.Paths)).To(BeEquivalentTo(1))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Name).To(Equal(brokerCr.Name + "-acceptor-0-svc"))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Port.Name).To(Equal("acceptor-0"))
Expand All @@ -2515,7 +2515,7 @@ var _ = Describe("artemis controller", func() {
}, existingClusterTimeout, existingClusterInterval).Should(Succeed())

if isOpenshift || isIngressSSLPassthroughEnabled {
host := ingress.Name + "." + brokerCr.Spec.IngressDomain
host := ingress.Name + "-" + defaultNamespace + "." + brokerCr.Spec.IngressDomain

By("check acceptor is reachable")
Eventually(func(g Gomega) {
Expand All @@ -2537,7 +2537,7 @@ var _ = Describe("artemis controller", func() {
g.Expect(k8sClient.Get(ctx, ingKey, &ingress)).To(Succeed())

g.Expect(len(ingress.Spec.Rules)).To(Equal(1))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-connector-0-svc-ing." + defaultTestIngressDomain))
g.Expect(ingress.Spec.Rules[0].Host).To(Equal(brokerCr.Name + "-connector-0-svc-ing-" + defaultNamespace + "." + defaultTestIngressDomain))
g.Expect(len(ingress.Spec.Rules[0].HTTP.Paths)).To(BeEquivalentTo(1))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Name).To(Equal(brokerCr.Name + "-connector-0-svc"))
g.Expect(ingress.Spec.Rules[0].HTTP.Paths[0].Backend.Service.Port.Name).To(Equal("connector-0"))
Expand Down

0 comments on commit 37d8dd1

Please sign in to comment.