Skip to content

Commit

Permalink
tests/main/lxd-mount-units: wait before checking generators (#13697)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meulengracht authored Mar 13, 2024
1 parent 03a2c4d commit ce451ce
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/main/lxd-mount-units/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ execute: |
lxd.lxc exec ubuntu -- apt install -y /root/"$DEB"
lxd.lxc restart ubuntu
echo "Precondition check that $core_snap snap is mounted correctly"
# Make sure $core_snap is mounted and readable for a regular user
retry -n 5 --wait 2 sh -c "lxd.lxc exec ubuntu -- sudo --user ubuntu --login ls /snap/${core_snap}/current"
retry -n 5 --wait 2 sh -c "lxd.lxc exec ubuntu -- sudo --user ubuntu --login mount | grep $core_snap | grep allow_other"
echo "Precondition check that mount overrides were generated inside the container"
lxd.lxc exec ubuntu -- find /var/run/systemd/generator/ -name container.conf | MATCH "/var/run/systemd/generator/snap-${core_snap}.*mount.d/container.conf"
Expand All @@ -63,11 +68,6 @@ execute: |
# The unit does not exist in newer LXD images where root is shared.
lxd.lxc exec ubuntu -- findmnt / -o PROPAGATION --noheadings | MATCH shared || lxd.lxc exec ubuntu -- test -f /var/run/systemd/generator/snap.mount
echo "Precondition check that $core_snap snap is mounted correctly"
# Make sure $core_snap is mounted and readable for a regular user
retry -n 5 --wait 1 sh -c "lxd.lxc exec ubuntu -- sudo --user ubuntu --login ls /snap/${core_snap}/current"
retry -n 5 --wait 1 sh -c "lxd.lxc exec ubuntu -- sudo --user ubuntu --login mount | grep $core_snap | grep allow_other"
echo "Check that snapfuse mount options of generated units match those generated by snapd"
# the only way to get mount options used by snapd is to install a new snap
retry -n 5 --wait 1 sh -c 'lxd.lxc exec ubuntu snap install hello-world'
Expand Down

0 comments on commit ce451ce

Please sign in to comment.