Skip to content

Commit

Permalink
Add IPv4/v6 dual stack support in Flow aggregator
Browse files Browse the repository at this point in the history
Fix the e2e test failure in dual stack cluster of flow aggregator.
  • Loading branch information
Yongming Ding committed Mar 16, 2021
1 parent 0014815 commit 9fcff92
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/e2e/flowaggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ const (
)

func TestFlowAggregator(t *testing.T) {
skipIfDualStackCluster(t)
data, isIPv6, err := setupTestWithIPFIXCollector(t)
if err != nil {
t.Fatalf("Error when setting up test: %v", err)
Expand Down Expand Up @@ -170,7 +169,12 @@ func TestFlowAggregator(t *testing.T) {
if !isIPv6 {
checkRecordsForFlows(t, data, podAIP.ipv4.String(), svcB.Spec.ClusterIP, isIPv6, true, true, false, false)
} else {
checkRecordsForFlows(t, data, podAIP.ipv6.String(), svcB.Spec.ClusterIP, isIPv6, true, true, false, false)
// Perftest service may be assigned a IPv4 ClusterIP in dual stack cluster
if strings.Count(svcB.Spec.ClusterIP, ":") >= 2 {
checkRecordsForFlows(t, data, podAIP.ipv6.String(), svcB.Spec.ClusterIP, isIPv6, true, true, false, false)
} else {
checkRecordsForFlows(t, data, podAIP.ipv4.String(), svcB.Spec.ClusterIP, false, true, true, false, false)
}
}
})

Expand All @@ -180,7 +184,11 @@ func TestFlowAggregator(t *testing.T) {
if !isIPv6 {
checkRecordsForFlows(t, data, podAIP.ipv4.String(), svcC.Spec.ClusterIP, isIPv6, false, true, false, true)
} else {
checkRecordsForFlows(t, data, podAIP.ipv6.String(), svcC.Spec.ClusterIP, isIPv6, false, true, false, true)
if strings.Count(svcC.Spec.ClusterIP, ":") >= 2 {
checkRecordsForFlows(t, data, podAIP.ipv6.String(), svcC.Spec.ClusterIP, isIPv6, false, true, false, true)
} else {
checkRecordsForFlows(t, data, podAIP.ipv4.String(), svcC.Spec.ClusterIP, false, false, true, false, true)
}
}
})
}
Expand Down

0 comments on commit 9fcff92

Please sign in to comment.