Skip to content

Commit 107974a

Browse files
committed
Add integration test for suspend resume
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
1 parent 0de3fb0 commit 107974a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

hack/test-example.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ declare -A CHECKS=(
2121
["systemd-strict"]="1"
2222
["mount-home"]="1"
2323
["containerd-user"]="1"
24+
["pause"]="1"
2425
["restart"]="1"
2526
["port-forwards"]="1"
2627
["vmnet"]=""
@@ -259,6 +260,28 @@ if [[ -n ${CHECKS["disk"]} ]]; then
259260
set +x
260261
fi
261262

263+
if [[ -n ${CHECKS["pause"]} ]]; then
264+
INFO "Suspending \"$NAME\""
265+
limactl suspend "$NAME"
266+
267+
got=$(limactl ls --format '{{.Status}}' "$NAME")
268+
expected="Paused"
269+
if [ "$got" != "$expected" ]; then
270+
ERROR "suspend status: expected=${expected} got=${got}"
271+
exit 1
272+
fi
273+
274+
INFO "Resuming \"$NAME\""
275+
limactl resume "$NAME"
276+
277+
got=$(limactl ls --format '{{.Status}}' "$NAME")
278+
expected="Running"
279+
if [ "$got" != "$expected" ]; then
280+
ERROR "resume status: expected=${expected} got=${got}"
281+
exit 1
282+
fi
283+
fi
284+
262285
if [[ -n ${CHECKS["restart"]} ]]; then
263286
INFO "Create file in the guest home directory and verify that it still exists after a restart"
264287
# shellcheck disable=SC2016

0 commit comments

Comments
 (0)