Add assert.NotNil for test case

This commit is contained in:
xiangpengzhao 2016-05-24 10:04:36 -04:00
parent 01e79b88e1
commit 3caebba6d8
2 changed files with 2 additions and 1 deletions

View File

@ -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
}

View File

@ -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")