Skip to content

Commit

Permalink
tests/vm: Add test for VM disconnection during lxc exec
Browse files Browse the repository at this point in the history
Signed-off-by: hamistao <[email protected]>
  • Loading branch information
hamistao committed Sep 9, 2024
1 parent d2fbe4f commit feb18b9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/vm
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,18 @@ waitInstanceReady vm1
lxc restart vm1
waitInstanceBooted vm1

echo "==> Test lxc exec exit code upon VM disconnection due to a stop/reboot"
# Try disconnecting a VM stopping forcefully and gracefully to make sure they match.
(sleep 1 && lxc restart -f vm1) &
lxc exec vm1 -- sleep 10 || exitCode=$?
[ "${exitCode:-0}" -eq 129 ]

waitInstanceBooted vm1
(sleep 1 && lxc stop vm1) &
lxc exec vm1 -- sleep 10 || exitCode=$?
[ "${exitCode:-0}" -eq 129 ]

lxc delete -f vm1

# shellcheck disable=SC2034
FAIL=0

0 comments on commit feb18b9

Please sign in to comment.