Skip to content

Commit

Permalink
Merge pull request #146 from hamistao/tests_custom_block_volume_sharing
Browse files Browse the repository at this point in the history
tests/storage-volumes-vm: Add tests for custom block volume sharing
  • Loading branch information
tomponline authored Jul 11, 2024
2 parents b384c18 + b030b4b commit 363f274
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/storage-volumes-vm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ do
lxc storage volume attach "${poolName}" vol2 v1
lxc storage volume attach "${poolName}" vol3 v1

echo "==> Share a custom block volume"
if hasNeededAPIExtension shared_custom_block_volumes; then
! lxc storage volume attach "${poolName}" vol2 v2 || false
lxc storage volume set "${poolName}" vol2 security.shared true
lxc storage volume attach "${poolName}" vol2 v2
! lxc storage volume set "${poolName}" vol2 security.shared false || false
lxc storage volume detach "${poolName}" vol2 v2
lxc storage volume set "${poolName}" vol2 security.shared false
else
# Sharing is allowed by default without shared_custom_block_volumes extension
lxc storage volume attach "${poolName}" vol2 v2
lxc storage volume detach "${poolName}" vol2 v2
fi

if hasNeededAPIExtension custom_volume_iso; then
echo "==> Attach custom ISO volumes to VM"
lxc storage volume attach "${poolName}" vol5 v1
Expand Down

0 comments on commit 363f274

Please sign in to comment.