Skip to content

Commit

Permalink
Skip e2e gateway failover tests on single node deployments
Browse files Browse the repository at this point in the history
Signed-Off-by: Sridhar Gaddam <sgaddam@redhat.com>
  • Loading branch information
sridhargaddam committed Dec 13, 2021
1 parent 8e0281c commit 964d973
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
4 changes: 2 additions & 2 deletions test/e2e/dataplane/tcp_gn_pod_connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ var _ = Describe("[dataplane-globalnet] Basic TCP connectivity tests across over
return
}

if subFramework.IsSingleNodeDeployment(fromClusterScheduling, toClusterScheduling, framework.ClusterA,
framework.ClusterB) {
if !subFramework.CanExecuteNonGatewayConnectivityTest(fromClusterScheduling, toClusterScheduling,
framework.ClusterA, framework.ClusterB) {
return
}

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/dataplane/tcp_pod_connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ var _ = Describe("[dataplane] Basic TCP connectivity tests across clusters witho
return
}

if subFramework.IsSingleNodeDeployment(fromClusterScheduling, toClusterScheduling, framework.ClusterA,
framework.ClusterB) {
if !subFramework.CanExecuteNonGatewayConnectivityTest(fromClusterScheduling, toClusterScheduling,
framework.ClusterA, framework.ClusterB) {
return
}

Expand Down
8 changes: 4 additions & 4 deletions test/e2e/framework/dataplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,21 +242,21 @@ func GetGlobalnetEgressParams(egressIP GlobalEgressIPType) GlobalnetTestParams {
}
}

func IsSingleNodeDeployment(sourceNode, destNode framework.NetworkPodScheduling,
func CanExecuteNonGatewayConnectivityTest(sourceNode, destNode framework.NetworkPodScheduling,
sourceCluster, destCluster framework.ClusterIndex) bool {
if sourceNode == framework.NonGatewayNode &&
framework.TestContext.NumNodesInCluster[sourceCluster] == 1 {
framework.Skipf("Skipping the test as cluster %q has only a single node...",
framework.TestContext.ClusterIDs[sourceCluster])
return true
return false
}

if destNode == framework.NonGatewayNode &&
framework.TestContext.NumNodesInCluster[destCluster] == 1 {
framework.Skipf("Skipping the test as cluster %q has only a single node...",
framework.TestContext.ClusterIDs[destCluster])
return true
return false
}

return false
return true
}
16 changes: 16 additions & 0 deletions test/e2e/redundancy/gateway_failover.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ func testGatewayPodRestartScenario(f *subFramework.Framework) {
ToEndpointType: defaultEndpointType(),
}, subFramework.GetGlobalnetEgressParams(subFramework.ClusterSelector))

if !subFramework.CanExecuteNonGatewayConnectivityTest(framework.NonGatewayNode, framework.NonGatewayNode,
framework.ClusterB, framework.ClusterA) {
return
}

By(fmt.Sprintf("Verifying TCP connectivity from non-gateway node on %q to non-gateway node on %q", clusterBName, clusterAName))
subFramework.VerifyDatapathConnectivity(tcp.ConnectivityTestParams{
Framework: f.Framework,
Expand Down Expand Up @@ -132,6 +137,12 @@ func defaultEndpointType() tcp.EndpointType {
}

func testGatewayFailOverScenario(f *subFramework.Framework) {
if framework.TestContext.NumNodesInCluster[framework.ClusterA] == 1 {
framework.Skipf("Skipping the test as cluster %q has only a single node...",
framework.TestContext.ClusterIDs[framework.ClusterA])
return
}

clusterAName := framework.TestContext.ClusterIDs[framework.ClusterA]
clusterBName := framework.TestContext.ClusterIDs[framework.ClusterB]

Expand Down Expand Up @@ -230,6 +241,11 @@ func testGatewayFailOverScenario(f *subFramework.Framework) {
ToEndpointType: defaultEndpointType(),
}, subFramework.GetGlobalnetEgressParams(subFramework.ClusterSelector))

if !subFramework.CanExecuteNonGatewayConnectivityTest(framework.NonGatewayNode, framework.NonGatewayNode,
framework.ClusterB, framework.ClusterA) {
return
}

By(fmt.Sprintf("Verifying TCP connectivity from non-gateway node on %q to non-gateway node on %q", clusterBName, clusterAName))
subFramework.VerifyDatapathConnectivity(tcp.ConnectivityTestParams{
Framework: f.Framework,
Expand Down

0 comments on commit 964d973

Please sign in to comment.