test: improved kubelet disk_manager coverage.

This commit is contained in:
Steve Milner
2015-08-26 11:36:56 -04:00
parent 986d37d145
commit 3181e5b913
2 changed files with 238 additions and 56 deletions

View File

@@ -28,6 +28,9 @@ import (
// Manages policy for diskspace management for disks holding docker images and root fs.
// mb is used to easily convert an int to an mb
const mb = 1024 * 1024
// Implementation is thread-safe.
type diskSpaceManager interface {
// Checks the available disk space
@@ -107,8 +110,6 @@ func (dm *realDiskSpaceManager) isSpaceAvailable(fsType string, threshold int, f
return true, fmt.Errorf("wrong available space for %q: %+v", fsType, fsInfo)
}
const mb = int64(1024 * 1024)
if fsInfo.Available < int64(threshold)*mb {
glog.Infof("Running out of space on disk for %q: available %d MB, threshold %d MB", fsType, fsInfo.Available/mb, threshold)
return false, nil