From 955416f35e3ea3460e7fa1621d58d4f634997c20 Mon Sep 17 00:00:00 2001 From: hamistao Date: Tue, 10 Dec 2024 09:43:40 -0300 Subject: [PATCH] test/suites: Test `security.shared` is only allowed in block vols Signed-off-by: hamistao --- test/suites/storage_local_volume_handling.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/suites/storage_local_volume_handling.sh b/test/suites/storage_local_volume_handling.sh index 5631ebd518f8..261e7df7d3ac 100755 --- a/test/suites/storage_local_volume_handling.sh +++ b/test/suites/storage_local_volume_handling.sh @@ -66,6 +66,18 @@ test_storage_local_volume_handling() { lxc storage volume set "${pool}" vol1 user.foo=snap0 lxc storage volume set "${pool}" vol1 snapshots.expiry=1H + lxc storage volume create "${pool}" blockVol --type=block + truncate -s 25MiB foo.iso + lxc storage volume import "${pool}" ./foo.iso iso1 + + # security.shared is only allowed for block volumes + ! lxc storage volume set "${pool}" vol1 security.shared true || false + ! lxc storage volume set "${pool}" isoVol security.shared true || false + lxc storage volume set "${pool}" blockVol security.shared true + + lxc storage volume delete "${pool}" blockVol + lxc storage volume delete "${pool}" isoVol + # This will create the snapshot vol1/snap0 lxc storage volume snapshot "${pool}" vol1 @@ -289,7 +301,6 @@ test_storage_local_volume_handling() { [ "$(lxc storage volume get "${target_pool}" vol5/snap0 volatile.uuid)" = "${old_snap0_uuid}" ] # copy ISO custom volumes - truncate -s 25MiB foo.iso lxc storage volume import "${source_pool}" ./foo.iso iso1 lxc storage volume copy "${source_pool}/iso1" "${target_pool}/iso1" lxc storage volume show "${target_pool}" iso1 | grep -q 'content_type: iso' @@ -308,10 +319,11 @@ test_storage_local_volume_handling() { lxc storage volume delete "${source_pool}" vol6 lxc storage volume delete "${target_pool}" iso1 lxc storage volume delete "${target_pool}" iso2 - rm -f foo.iso fi done done + + rm -f foo.iso ) # shellcheck disable=SC2031,2269