Skip to content

Commit

Permalink
tests/main/preseed-lxd: restore apparmor profiles on the host
Browse files Browse the repository at this point in the history
The test stars a privileged LXD container which most likely replaced the
AppArmor profiles on the host. Attempt to reload the host profiles in restore.

Signed-off-by: Maciej Borzecki <[email protected]>
  • Loading branch information
bboozzoo authored and Meulengracht committed Apr 3, 2024
1 parent e68b477 commit 1d280d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/main/preseed-lxd/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ restore: |
apt autoremove --purge -y
fi
umount "$IMAGE_MOUNTPOINT"
umount "$IMAGE_MOUNTPOINT"
rmdir "$IMAGE_MOUNTPOINT"
# qemu-nbd -d may sporadically fail when removing the device,
Expand All @@ -69,6 +69,11 @@ restore: |
"$TESTSTOOLS"/lxd-state undo-mount-changes
# the test started a privileged LXD container which most likely replaced the
# AppArmor profile for /usr/lib/snapd/snap-confine with its own version,
# restart apparmor.service so we get back the right profiles
systemctl restart apparmor.service
execute: |
echo "Create a trivial container using the lxd snap"
lxd waitready
Expand Down

0 comments on commit 1d280d9

Please sign in to comment.