Change test data generator to create string cpumasks.

Docker-DCO-1.1-Signed-off-by: Rohit Jnagal <jnagal@google.com> (github: rjnagal)
This commit is contained in:
Rohit Jnagal 2014-07-24 01:56:52 +00:00
parent 1fa48e8c39
commit 07f78e1a7f

View File

@ -16,7 +16,6 @@ package test
import (
"fmt"
"math"
"math/rand"
"time"
@ -59,12 +58,7 @@ func GenerateRandomContainerSpec(numCores int) *info.ContainerSpec {
}
ret.Cpu.Limit = uint64(1000 + rand.Int63n(2000))
ret.Cpu.MaxLimit = uint64(1000 + rand.Int63n(2000))
n := (numCores + 63) / 64
ret.Cpu.Mask.Data = make([]uint64, n)
for i := 0; i < n; i++ {
ret.Cpu.Mask.Data[i] = math.MaxUint64
}
ret.Cpu.Mask = fmt.Sprintf("0-%d", numCores-1)
ret.Memory.Limit = uint64(4096 + rand.Int63n(4096))
return ret
}