Skip to content

Commit

Permalink
test: Check that we can still access the target dir if it hasn''t bee…
Browse files Browse the repository at this point in the history
…n created by lxd

Signed-off-by: Gabriel Mougard <[email protected]>
  • Loading branch information
gabrielmougard committed Jan 8, 2024
1 parent 58f7d24 commit 700a18d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/suites/container_devices_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,23 @@ test_container_devices_disk_shift() {
[ "$(lxc exec foo-isol1 -- stat /mnt/a -c '%u:%g')" = "123:456" ] || false
[ "$(lxc exec foo-isol2 -- stat /mnt/a -c '%u:%g')" = "123:456" ] || false

mkdir -p "${TEST_DIR}/empty-dir"
lxc exec foo -- mkdir /opt
lxc config device add foo empty-dir disk source="${TEST_DIR}/empty-dir" path=/opt
lxc config device remove foo empty-dir
lxc exec foo -- stat /opt

lxc exec foo -- touch /tmp/empty-dir
lxc config device add foo empty-dir disk source="${TEST_DIR}/empty-dir" path=/tmp/empty-dir
lxc config device remove foo empty-dir
lxc exec foo -- stat /tmp/empty-dir

lxc exec foo -- touch /tmp/new-dir
lxc config device add foo empty-dir disk source="${TEST_DIR}/empty-dir" path=/tmp/new-dir
lxc config device remove foo empty-dir
! lxc exec foo -- stat /tmp/empty-dir
rm -rf "${TEST_DIR}/empty-dir"

lxc delete -f foo-priv foo-isol1 foo-isol2
lxc config device remove foo shifted
lxc storage volume delete "${POOL}" foo-shift
Expand Down

0 comments on commit 700a18d

Please sign in to comment.