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:
parent
1fa48e8c39
commit
07f78e1a7f
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user