Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Yongming Ding <dyongming@vmware.com>
  • Loading branch information
dreamtalen committed Jul 18, 2022
1 parent e6e079d commit ecbf2dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
10 changes: 0 additions & 10 deletions test/e2e/flowvisibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ func testHelper(t *testing.T, data *TestData, podAIPs, podBIPs, podCIPs, podDIPs
if err != nil {
t.Fatalf("Error when creating perftest Services: %v", err)
}
defer deletePerftestServices(t, data)
// Wait for the Service to be realized.
time.Sleep(3 * time.Second)

Expand Down Expand Up @@ -1062,15 +1061,6 @@ func createPerftestServices(data *TestData, isIPv6 bool) (svcB *corev1.Service,
return svcB, svcC, nil
}

func deletePerftestServices(t *testing.T, data *TestData) {
for _, serviceName := range []string{"perftest-b", "perftest-c"} {
err := data.deleteService(testNamespace, serviceName)
if err != nil {
t.Logf("Error when deleting %s Service: %v", serviceName, err)
}
}
}

// getBandwidthAndPorts parses iperf commands output and returns bandwidth,
// source port and destination port. Bandwidth is returned as a slice containing
// two strings (bandwidth value and bandwidth unit).
Expand Down
13 changes: 3 additions & 10 deletions test/e2e/policyrecommendation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func TestPolicyRecommendation(t *testing.T) {
if err != nil {
t.Fatalf("Error when creating perftest-b Service: %v", err)
}
defer deleteTestService(t, data)
// Wait for the Service to be realized.
time.Sleep(3 * time.Second)
// In dual stack cluster, Service IP can be assigned as different IP family from specified.
Expand All @@ -93,9 +92,10 @@ func TestPolicyRecommendation(t *testing.T) {

if v4Enabled {
srcIP := podAIPs.ipv4.String()
dstIP := podBIPs.ipv4.String()
testFlowPodToPod := testFlow{
srcIP: srcIP,
dstIP: podBIPs.ipv4.String(),
dstIP: dstIP,
srcPodName: "perftest-a",
dstPodName: "perftest-b",
}
Expand Down Expand Up @@ -210,7 +210,7 @@ func testPolicyRecommendationFailed(t *testing.T, data *TestData) {
})
require.NoError(t, err)
assert := assert.New(t)
assert.Containsf(stdout, "Error message: driver", "stdout: %s", stdout)
assert.Truef(strings.Contains(stdout, "Error message: driver pod not found") || strings.Contains(stdout, "Error message: driver container failed"), "stdout: %s", stdout)
}

// Example output:
Expand Down Expand Up @@ -394,10 +394,3 @@ func createTestService(data *TestData, isIPv6 bool) (svcB *corev1.Service, err e

return svcB, nil
}

func deleteTestService(t *testing.T, data *TestData) {
err := data.deleteService(testNamespace, "perftest-b")
if err != nil {
t.Logf("Error when deleting perftest-b Service: %v", err)
}
}

0 comments on commit ecbf2dd

Please sign in to comment.