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 6, 2024
1 parent 6da4d11 commit 9a612c8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/container
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,15 @@ lxc exec u1 -- mkdir /root/sys
lxc exec u1 -- mount -t sysfs sysfs /root/sys
lxc delete -f u1

echo "==> Test exit codes when container disconnects during lxc exec"
lxc launch "${IMAGE}" c1

(sleep 1 && lxc stop -f c1) &
lxc exec c1 -- sleep 10 || exitCode=$?
# The expected signal is a 137 indicating a SIGKILL.
[ "${exitCode:-0}" -eq 137 ]

lxc delete -f c1

# shellcheck disable=SC2034
FAIL=0

0 comments on commit 9a612c8

Please sign in to comment.