From 019a15c30b961c2c5e3c2e0f94f7c639afcea8f9 Mon Sep 17 00:00:00 2001 From: Dane LeBlanc Date: Tue, 3 Oct 2017 11:19:50 -0400 Subject: [PATCH] Add IPv6 option for e2e iPerf test The e2e iPerf test case currently only runs in IPv4 mode. This change add an option to run an iPerf test in IPv6 mode (i.e. by running iPerf with a "-V" command line flag), so that the test can be run on IPv6-only clusters. --- test/e2e/network/networking_perf.go | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/test/e2e/network/networking_perf.go b/test/e2e/network/networking_perf.go index c826bafcab6..e8a7b608ecb 100644 --- a/test/e2e/network/networking_perf.go +++ b/test/e2e/network/networking_perf.go @@ -36,9 +36,8 @@ const ( smallClusterTimeout = 200 * time.Second ) -// Declared as Flakey since it has not been proven to run in parallel on small nodes or slow networks in CI -// TODO jayunit100 : Retag this test according to semantics from #22401 -var _ = SIGDescribe("Networking IPerf [Experimental] [Slow] [Feature:Networking-Performance]", func() { +// networkingIPerf test runs iperf on a container in either IPv4 or IPv6 mode. +func networkingIPerfTest(isIPv6 bool) { f := framework.NewDefaultFramework("network-perf") @@ -49,6 +48,11 @@ var _ = SIGDescribe("Networking IPerf [Experimental] [Slow] [Feature:Networking- numServer := 1 maxBandwidthBits := gceBandwidthBitsEstimate + familyStr := "" + if isIPv6 { + familyStr = "-V " + } + It(fmt.Sprintf("should transfer ~ 1GB onto the service endpoint %v servers (maximum of %v clients)", numServer, numClient), func() { nodes := framework.GetReadySchedulableNodesOrDie(f.ClientSet) totalPods := len(nodes.Items) @@ -68,7 +72,7 @@ var _ = SIGDescribe("Networking IPerf [Experimental] [Slow] [Feature:Networking- Args: []string{ "/bin/sh", "-c", - "/usr/local/bin/iperf -s -p 8001 ", + "/usr/local/bin/iperf " + familyStr + "-s -p 8001 ", }, Ports: []v1.ContainerPort{{ContainerPort: 8001}}, }}, @@ -96,7 +100,7 @@ var _ = SIGDescribe("Networking IPerf [Experimental] [Slow] [Feature:Networking- Args: []string{ "/bin/sh", "-c", - "/usr/local/bin/iperf -c service-for-" + appName + " -p 8002 --reportstyle C && sleep 5", + "/usr/local/bin/iperf " + familyStr + "-c service-for-" + appName + " -p 8002 --reportstyle C && sleep 5", }, }, }, @@ -153,4 +157,16 @@ var _ = SIGDescribe("Networking IPerf [Experimental] [Slow] [Feature:Networking- framework.Logf("%v had bandwidth %v. Ratio to expected (%v) was %f", ipClient, bandwidth, expectedBandwidth, float64(bandwidth)/float64(expectedBandwidth)) } }) +} + +// Declared as Flakey since it has not been proven to run in parallel on small nodes or slow networks in CI +// TODO jayunit100 : Retag this test according to semantics from #22401 +var _ = SIGDescribe("Networking IPerf IPv4 [Experimental] [Feature:Networking-IPv4] [Slow] [Feature:Networking-Performance]", func() { + networkingIPerfTest(false) +}) + +// Declared as Flakey since it has not been proven to run in parallel on small nodes or slow networks in CI +// TODO jayunit100 : Retag this test according to semantics from #22401 +var _ = SIGDescribe("Networking IPerf IPv6 [Experimental] [Feature:Networking-IPv6] [Slow] [Feature:Networking-Performance]", func() { + networkingIPerfTest(true) })