storage unit tests

This commit is contained in:
Nan Deng 2014-06-17 15:12:35 -07:00
parent 7dd1f031a6
commit ca65e11486
2 changed files with 5 additions and 4 deletions

View File

@ -33,5 +33,8 @@ type StorageDriver interface {
// should return at most numSamples samples.
Samples(containername string, numSamples int) ([]*info.ContainerStatsSample, error)
// Close will clear the state of the storage driver. The elements
// stored in the underlying storage may or may not be deleted depending
// on the implementation of the storage driver.
Close() error
}

View File

@ -59,10 +59,8 @@ func StorageDriverTestSampleCpuUsage(driver storage.StorageDriver, t *testing.T)
// We need N+1 observations to get N samples
for i := 0; i < N+1; i++ {
cpuusage := uint64(rand.Intn(1000))
memusage := uint64(rand.Intn(1000))
cpuTrace = append(cpuTrace, cpuusage)
memTrace = append(memTrace, memusage)
cpuTrace = append(cpuTrace, uint64(rand.Intn(1000)))
memTrace = append(memTrace, uint64(rand.Intn(1000)))
}
samplePeriod := 1 * time.Second