mirror of
https://github.com/docker/docs.git
synced 2026-03-31 16:28:59 +07:00
check for VM in virtualbox; add stub for coverage
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
@@ -128,11 +128,13 @@ BATS (use that link). Then run `./script/build` to generate the binary. Once
|
||||
you have the binary, you can run test against a specified driver:
|
||||
|
||||
```
|
||||
$ DRIVER=virtualbox bats test/driver.bats
|
||||
$ bats test/driver-virtualbox.bats
|
||||
✓ virtualbox: machine should not exist
|
||||
✓ virtualbox: VM should not exist
|
||||
✓ virtualbox: create
|
||||
✓ virtualbox: active
|
||||
✓ virtualbox: ls
|
||||
✓ virtualbox: run busybox container
|
||||
✓ virtualbox: url
|
||||
✓ virtualbox: ip
|
||||
✓ virtualbox: ssh
|
||||
@@ -144,6 +146,7 @@ $ DRIVER=virtualbox bats test/driver.bats
|
||||
✓ virtualbox: machine should show running after restart
|
||||
✓ virtualbox: remove
|
||||
✓ virtualbox: machine should not exist
|
||||
✓ virtualbox: VM should not exist
|
||||
|
||||
15 tests, 0 failures
|
||||
```
|
||||
|
||||
@@ -16,6 +16,11 @@ function setup() {
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "$DRIVER: VM should not exist" {
|
||||
run VBoxManage showvminfo $NAME
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "$DRIVER: create" {
|
||||
run machine create -d $DRIVER $NAME
|
||||
[ "$status" -eq 0 ]
|
||||
@@ -109,6 +114,11 @@ function setup() {
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "$DRIVER: VM should not exist" {
|
||||
run VBoxManage showvminfo $NAME
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "$DRIVER: cleanup" {
|
||||
run rm -rf $MACHINE_STORAGE_PATH
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
2
test/test.go
Normal file
2
test/test.go
Normal file
@@ -0,0 +1,2 @@
|
||||
// stub for coverage
|
||||
package test
|
||||
Reference in New Issue
Block a user