Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated backport of #3122: Update multiple GWs failover test to support ROKS as well #3137

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions test/e2e/redundancy/gateway_failover.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,14 @@ func testGatewayFailOverScenario(f *subFramework.Framework) {
Expect(initialGWPod).ToNot(BeNil(), "Did not find an active gateway pod")

By(fmt.Sprintf("Ensure active gateway node %q has established connections", initialGWPod.Name))
gwConnection := f.AwaitGatewayWithStatus(framework.ClusterIndex(primaryCluster), initialGWPod.Spec.NodeName, subv1.HAStatusActive)
Expect(gwConnection.Status.Connections).NotTo(BeEmpty(), "The active gateway must have established connections")

submEndpoint := f.AwaitSubmarinerEndpoint(framework.ClusterIndex(primaryCluster), subFramework.NoopCheckEndpoint)
By(fmt.Sprintf("Found submariner endpoint for %q: %#v", clusterAName, submEndpoint))

gwConnection := f.AwaitGatewayWithStatus(framework.ClusterIndex(primaryCluster),
resource.EnsureValidName(submEndpoint.Spec.Hostname), subv1.HAStatusActive)
Expect(gwConnection.Status.Connections).NotTo(BeEmpty(), "The active gateway must have established connections")

By("Performing fail-over to passive gateway")
f.DoFailover(context.TODO(), framework.ClusterIndex(primaryCluster), initialGWPod.Spec.NodeName, initialGWPod.Name)

Expand All @@ -197,14 +199,15 @@ func testGatewayFailOverScenario(f *subFramework.Framework) {
Expect(newGWPod).ToNot(BeNil(), "Did not find a new active gateway pod running on a different node")
By(fmt.Sprintf("Found new submariner gateway pod %q", newGWPod.Name))

By(fmt.Sprintf("Waiting for the new pod %q to report as fully connected", newGWPod.Name))
f.AwaitGatewayFullyConnected(framework.ClusterIndex(primaryCluster), resource.EnsureValidName(newGWPod.Spec.NodeName))

// Verify a new Endpoint instance is created by the new gateway instance. This is a bit whitebox but it's a sanity check
// and also gives it a bit more of a cushion to avoid premature timeout in the connectivity test.
newSubmEndpoint := f.AwaitNewSubmarinerEndpoint(framework.ClusterIndex(primaryCluster), submEndpoint.ObjectMeta.UID)
By(fmt.Sprintf("Found new submariner endpoint for %q: %#v", clusterAName, newSubmEndpoint))

By(fmt.Sprintf("Waiting for the new pod %q to report as fully connected", newGWPod.Name))
f.AwaitGatewayFullyConnected(framework.ClusterIndex(primaryCluster),
resource.EnsureValidName(resource.EnsureValidName(newSubmEndpoint.Spec.Hostname)))

By(fmt.Sprintf("Waiting for the previous submariner endpoint %q to be removed on %q", newGWPod.Name, clusterBName))
f.AwaitSubmarinerEndpointRemoved(framework.ClusterIndex(secondaryCluster), submEndpoint.Name)

Expand Down
Loading