Add example of vm images testing

This commit is contained in:
Mikhail Gordeev 2021-06-07 23:37:28 +03:00
parent 540978b835
commit 8bb91a0863
2 changed files with 17 additions and 0 deletions

15
cloud-build-test-cloud Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh -eu
IMAGE="${1?Pass image}"
NAME="test-cloud-$$"
at_exit() {
vml rm --force --names "$NAME"
exit "$@"
}
trap 'at_exit $?' EXIT
trap 'exit 143' HUP INT QUIT PIPE TERM
vml run -i "$IMAGE" --wait-ssh --names "$NAME"
vml ssh --check --cmd 'apt-get update && apt-get install -y vim-console' --names "$NAME"

View File

@ -35,6 +35,8 @@ images:
- use/net-ssh
- use/vmguest/kvm
- use/repo
tests:
- method: prog(cloud-build-test-cloud)
rootfs-minimal:
target: ve/docker
kinds: