Implement temporary ImageStats in kuberuntime_manager, and

fix a bug in dockershim which causes summary api not working
properly.
This commit is contained in:
Random-Liu
2016-09-30 17:08:32 -07:00
parent 47b4c0e770
commit c3ce58b934
8 changed files with 75 additions and 19 deletions

View File

@@ -78,3 +78,18 @@ func TestRemoveImage(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, 0, len(fakeImageService.Images))
}
func TestImageStats(t *testing.T) {
_, fakeImageService, fakeManager, err := createTestRuntimeManager()
assert.NoError(t, err)
const imageSize = 64
fakeImageService.SetFakeImageSize(imageSize)
images := []string{"1111", "2222", "3333"}
fakeImageService.SetFakeImages(images)
actualStats, err := fakeManager.ImageStats()
assert.NoError(t, err)
expectedStats := &kubecontainer.ImageStats{TotalStorageBytes: imageSize * uint64(len(images))}
assert.Equal(t, expectedStats, actualStats)
}