Skip to content
This repository was archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #880 from slashk/vb-cpu-tests
Browse files Browse the repository at this point in the history
add integration tests for cpu count in virtualbox driver
  • Loading branch information
ehazlett committed Mar 26, 2015
2 parents 62388b0 + d80c47d commit 45f08d9
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/integration/driver-virtualbox.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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 ]
Expand All @@ -56,7 +61,7 @@ findMemorySize() {
[[ ${output} == "${DEFAULT_MEMSIZE}" ]]
}

@test "$DRIVER: dheck default machine disksize" {
@test "$DRIVER: check default machine disksize" {
findDiskSize
[[ ${output} == *"$DEFAULT_DISKSIZE"* ]]
}
Expand Down Expand Up @@ -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 ]
}

Expand All @@ -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 ]
Expand Down

0 comments on commit 45f08d9

Please sign in to comment.