Skip to content

Commit

Permalink
tests/container: Test container disconnect during 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 ddbe38c commit c96f034
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/container
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,18 @@ echo "==> Try cleanly stopping a container"
lxc launch "${IMAGE}" c1
lxc restart c1

echo "==> Test exit codes when container disconnects during lxc exec"

# Try disconnecting a container stopping forcefully and gracefully to make sure they match.
(sleep 1 && lxc restart -f c1) &
lxc exec c1 -- sleep 10 || exitCode=$?
[ "${exitCode:-0}" -eq 129 ]

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

lxc delete -f c1

# shellcheck disable=SC2034
FAIL=0

0 comments on commit c96f034

Please sign in to comment.