mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Add assert.NotNil for test case
This commit is contained in:
parent
01e79b88e1
commit
3caebba6d8
@ -344,7 +344,7 @@ func (sb *summaryBuilder) containerInfoV2ToNetworkStats(name string, info *cadvi
|
||||
}
|
||||
}
|
||||
}
|
||||
glog.Warningf("Missing default interface %q for s", network.DefaultInterfaceName, name)
|
||||
glog.Warningf("Missing default interface %q for %s", network.DefaultInterfaceName, name)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -321,6 +321,7 @@ func testTime(base time.Time, seed int) time.Time {
|
||||
}
|
||||
|
||||
func checkNetworkStats(t *testing.T, label string, seed int, stats *kubestats.NetworkStats) {
|
||||
assert.NotNil(t, stats)
|
||||
assert.EqualValues(t, testTime(timestamp, seed).Unix(), stats.Time.Time.Unix(), label+".Net.Time")
|
||||
assert.EqualValues(t, seed+offsetNetRxBytes, *stats.RxBytes, label+".Net.RxBytes")
|
||||
assert.EqualValues(t, seed+offsetNetRxErrors, *stats.RxErrors, label+".Net.RxErrors")
|
||||
|
Loading…
Reference in New Issue
Block a user