Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 45f08d9

Browse files
committed
Merge pull request #880 from slashk/vb-cpu-tests
add integration tests for cpu count in virtualbox driver
2 parents 62388b0 + d80c47d commit 45f08d9

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

test/integration/driver-virtualbox.bats

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export DEFAULT_MEMSIZE=1024
1111
export DEFAULT_DISKSIZE=20000
1212
export CUSTOM_MEMSIZE=1536
1313
export CUSTOM_DISKSIZE=10000
14+
export CUSTOM_CPUCOUNT=1
1415
export BAD_URL="http://dev.null:9111/bad.iso"
1516

1617
function setup() {
@@ -31,6 +32,10 @@ findMemorySize() {
3132
run bash -c "VBoxManage showvminfo --machinereadable $NAME | grep memory= | cut -d'=' -f2"
3233
}
3334

35+
findCPUCount() {
36+
run bash -c "VBoxManage showvminfo --machinereadable $NAME | grep cpus= | cut -d'=' -f2"
37+
}
38+
3439
@test "$DRIVER: machine should not exist" {
3540
run machine active $NAME
3641
[ "$status" -eq 1 ]
@@ -56,7 +61,7 @@ findMemorySize() {
5661
[[ ${output} == "${DEFAULT_MEMSIZE}" ]]
5762
}
5863

59-
@test "$DRIVER: dheck default machine disksize" {
64+
@test "$DRIVER: check default machine disksize" {
6065
findDiskSize
6166
[[ ${output} == *"$DEFAULT_DISKSIZE"* ]]
6267
}
@@ -244,8 +249,8 @@ findMemorySize() {
244249
[ "$status" -eq 0 ]
245250
}
246251

247-
@test "$DRIVER: create with custom disk and memory size flags" {
248-
run machine create -d $DRIVER --virtualbox-disk-size $CUSTOM_DISKSIZE --virtualbox-memory $CUSTOM_MEMSIZE $NAME
252+
@test "$DRIVER: create with custom disk, cpu count and memory size flags" {
253+
run machine create -d $DRIVER --virtualbox-cpu-count $CUSTOM_CPUCOUNT --virtualbox-disk-size $CUSTOM_DISKSIZE --virtualbox-memory $CUSTOM_MEMSIZE $NAME
249254
[ "$status" -eq 0 ]
250255
}
251256

@@ -259,6 +264,11 @@ findMemorySize() {
259264
[[ ${output} == *"$CUSTOM_DISKSIZE"* ]]
260265
}
261266

267+
@test "$DRIVER: check custom machine cpucount" {
268+
findCPUCount
269+
[[ ${output} == "${CUSTOM_CPUCOUNT}" ]]
270+
}
271+
262272
@test "$DRIVER: machine should show running after create" {
263273
run machine ls
264274
[ "$status" -eq 0 ]

0 commit comments

Comments
 (0)