From 2ff623c716800d5ae40b8b85752d32b8e42ea8a1 Mon Sep 17 00:00:00 2001 From: Gabriel Mougard Date: Fri, 5 Jan 2024 12:50:46 +0100 Subject: [PATCH] test: Check that we can still access the target dir if it hasn''t been created by lxd Signed-off-by: Gabriel Mougard --- test/suites/container_devices_disk.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/suites/container_devices_disk.sh b/test/suites/container_devices_disk.sh index c5e8609b64cc..9443d8022cce 100644 --- a/test/suites/container_devices_disk.sh +++ b/test/suites/container_devices_disk.sh @@ -86,6 +86,18 @@ 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 + 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