mirror of https://github.com/docker/docs.git
add integration tests for cpu count (PR #879) in virtualbox driver
Signed-off-by: Ken Pepple <ken@solinea.com>
This commit is contained in:
parent
62388b0f50
commit
d80c47df88
|
@ -11,6 +11,7 @@ export DEFAULT_MEMSIZE=1024
|
|||
export DEFAULT_DISKSIZE=20000
|
||||
export CUSTOM_MEMSIZE=1536
|
||||
export CUSTOM_DISKSIZE=10000
|
||||
export CUSTOM_CPUCOUNT=1
|
||||
export BAD_URL="http://dev.null:9111/bad.iso"
|
||||
|
||||
function setup() {
|
||||
|
@ -31,6 +32,10 @@ findMemorySize() {
|
|||
run bash -c "VBoxManage showvminfo --machinereadable $NAME | grep memory= | cut -d'=' -f2"
|
||||
}
|
||||
|
||||
findCPUCount() {
|
||||
run bash -c "VBoxManage showvminfo --machinereadable $NAME | grep cpus= | cut -d'=' -f2"
|
||||
}
|
||||
|
||||
@test "$DRIVER: machine should not exist" {
|
||||
run machine active $NAME
|
||||
[ "$status" -eq 1 ]
|
||||
|
@ -56,7 +61,7 @@ findMemorySize() {
|
|||
[[ ${output} == "${DEFAULT_MEMSIZE}" ]]
|
||||
}
|
||||
|
||||
@test "$DRIVER: dheck default machine disksize" {
|
||||
@test "$DRIVER: check default machine disksize" {
|
||||
findDiskSize
|
||||
[[ ${output} == *"$DEFAULT_DISKSIZE"* ]]
|
||||
}
|
||||
|
@ -244,8 +249,8 @@ findMemorySize() {
|
|||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "$DRIVER: create with custom disk and memory size flags" {
|
||||
run machine create -d $DRIVER --virtualbox-disk-size $CUSTOM_DISKSIZE --virtualbox-memory $CUSTOM_MEMSIZE $NAME
|
||||
@test "$DRIVER: create with custom disk, cpu count and memory size flags" {
|
||||
run machine create -d $DRIVER --virtualbox-cpu-count $CUSTOM_CPUCOUNT --virtualbox-disk-size $CUSTOM_DISKSIZE --virtualbox-memory $CUSTOM_MEMSIZE $NAME
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
|
@ -259,6 +264,11 @@ findMemorySize() {
|
|||
[[ ${output} == *"$CUSTOM_DISKSIZE"* ]]
|
||||
}
|
||||
|
||||
@test "$DRIVER: check custom machine cpucount" {
|
||||
findCPUCount
|
||||
[[ ${output} == "${CUSTOM_CPUCOUNT}" ]]
|
||||
}
|
||||
|
||||
@test "$DRIVER: machine should show running after create" {
|
||||
run machine ls
|
||||
[ "$status" -eq 0 ]
|
||||
|
|
Loading…
Reference in New Issue