Skip to content
Open
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
20 changes: 2 additions & 18 deletions feature/gnoi/system/tests/ping_test/ping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ const (
minimumSent = 1
minimumReceived = 1
minimumMinTime = 1
minimumAvgTime = 1
minimumMaxTime = 1
// StdDeviation would be 0 if we only send 1 ping.
minimumStdDev = 1
minimumAvgTime = 1
minimumMaxTime = 1
)

func TestMain(m *testing.M) {
Expand Down Expand Up @@ -134,7 +132,6 @@ func TestGNOIPing(t *testing.T) {
MinTime: minimumMinTime,
AvgTime: minimumAvgTime,
MaxTime: minimumMaxTime,
StdDev: minimumStdDev,
}

cases := []struct {
Expand Down Expand Up @@ -266,7 +263,6 @@ func TestGNOIPing(t *testing.T) {
MinTime: minimumMinTime,
AvgTime: minimumAvgTime,
MaxTime: minimumMaxTime,
StdDev: minimumStdDev,
},
}, {
desc: "Check ping with IPv6 count",
Expand All @@ -285,7 +281,6 @@ func TestGNOIPing(t *testing.T) {
MinTime: minimumMinTime,
AvgTime: minimumAvgTime,
MaxTime: minimumMaxTime,
StdDev: minimumStdDev,
},
}, {
desc: "Check ping with IPv4 minimum packet size",
Expand Down Expand Up @@ -422,17 +417,9 @@ func TestGNOIPing(t *testing.T) {
t.Errorf("Number of responses to %v: got 0, want > 0", tc.pingRequest.Destination)
}

StdDevZero := true
pingTime := responses[len(responses)-1].Time

for i := 0; i < len(responses)-1; i++ {
t.Logf("Check each ping reply %v out of %v.\n %v\n", i+1, len(responses), responses[i])

// Check StdDev if ping time is different
if pingTime != responses[i].Time {
StdDevZero = false
}

if responses[i].Source != tc.expectedReply.Source {
t.Errorf("Ping reply source: got %v, want %v", responses[i].Source, tc.expectedReply.Source)
}
Expand Down Expand Up @@ -469,9 +456,6 @@ func TestGNOIPing(t *testing.T) {
if summary.MaxTime < tc.expectedStats.MaxTime {
t.Errorf("Ping MaxTime: got %v, want >= %v", summary.MaxTime, tc.expectedStats.MaxTime)
}
if summary.StdDev < tc.expectedStats.StdDev && !StdDevZero {
t.Errorf("Ping Standard Deviation: got %v, want >= %v", summary.StdDev, tc.expectedStats.StdDev)
}
})
}
}
Expand Down
Loading