Skip to content

Commit

Permalink
Merge pull request #194 from shiftstack/OCPBUGS-43500
Browse files Browse the repository at this point in the history
OCPBUGS-43500: Change lbMethod check in dualstack LB tests
  • Loading branch information
openshift-merge-bot[bot] authored Oct 17, 2024
2 parents 7beda45 + d139f89 commit 70a6848
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/extended/openstack/dualstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ var _ = g.Describe("[sig-installer][Suite:openshift/openstack][lb][Serial] The O
availableLbProvidersUnderTests := [...]string{"Amphora", "OVN"}
ipFamilyPolicy := "PreferDualStack"
ipFamilies := [][]v1.IPFamily{{v1.IPv4Protocol, v1.IPv6Protocol}, {v1.IPv6Protocol, v1.IPv4Protocol}}
lbMethodsWithETPGlobal := map[string]string{
"OVN": "source_ip_port",
"Amphora": "round_robin",
}

g.BeforeEach(func(ctx g.SpecContext) {
network, err := oc.AdminConfigClient().ConfigV1().Networks().Get(ctx, "cluster", metav1.GetOptions{})
Expand Down Expand Up @@ -75,7 +79,6 @@ var _ = g.Describe("[sig-installer][Suite:openshift/openstack][lb][Serial] The O
for _, i := range availableLbProvidersUnderTests {
lbProviderUnderTest := i
protocolUnderTest := v1.Protocol("TCP")
var pods *v1.PodList = &v1.PodList{}

for _, ipFamiliesList := range ipFamilies {
g.It(fmt.Sprintf("should create a %s %s LoadBalancer when a %s svc with type:LoadBalancer and IP family policy %s and IP families %s is created on Openshift", protocolUnderTest, lbProviderUnderTest, protocolUnderTest, ipFamilyPolicy, ipFamiliesList), func(ctx g.SpecContext) {
Expand Down Expand Up @@ -141,11 +144,14 @@ var _ = g.Describe("[sig-installer][Suite:openshift/openstack][lb][Serial] The O
}
}
e2e.Logf("Pods accessed after 100 requests:\n%v\n", results)
pods, err = oc.KubeClient().CoreV1().Pods(oc.Namespace()).List(ctx, metav1.ListOptions{})
pods, err := oc.KubeClient().CoreV1().Pods(oc.Namespace()).List(ctx, metav1.ListOptions{})
o.Expect(err).NotTo(o.HaveOccurred())
e2e.Logf("Results: %v", results)
lbMethod, err := GetClusterLoadBalancerSetting("lb-method", cloudProviderConfig)
o.Expect(isLbMethodApplied(lbMethod, results, pods)).Should(o.BeTrue(), "%q lb-method not applied after 100 queries:\n%v\n", lbMethod, results)
o.Expect(err).NotTo(o.HaveOccurred())

// ETP:Local not configured so the defined lbMethod is not applied, but the one on 'lbMethodsWithETPGlobal' var.
// https://issues.redhat.com/browse/OCPBUGS-2350
o.Expect(isLbMethodApplied(lbMethodsWithETPGlobal[lbProviderUnderTest], results, pods)).Should(o.BeTrue(), "%q lb-method not applied after 100 queries:\n%v\n", lbMethod, results)
})
}
}
Expand Down

0 comments on commit 70a6848

Please sign in to comment.