diff --git a/tests/storage-disks-vm b/tests/storage-disks-vm index 67e0766de..b175ceadb 100755 --- a/tests/storage-disks-vm +++ b/tests/storage-disks-vm @@ -35,6 +35,40 @@ lxc project switch default lxc network create lxdbr0 lxc storage create default zfs size=20GB volume.size=5GB +lxc profile device add default root disk path="/" pool=default +lxc profile device add default eth0 nic network=lxdbr0 +lxc profile show default + +lxc init "${TEST_IMG:-ubuntu-minimal-daily:22.04}" v1 --vm + +lxc config device add v1 d1 disk source="${testRoot}/allowed1" path=/mnt + +# tests to prevent regressions like: +# https://github.com/canonical/lxd/issues/13325 +lxc config set v1 raw.idmap - << EOF +uid 0 0 +gid 0 1 +EOF +lxc start v1 +lxc stop -f v1 + +lxc config set v1 raw.idmap - << EOF +uid 0 0 +gid 0 0 +EOF +lxc start v1 +lxc stop -f v1 + +lxc config set v1 raw.idmap - << EOF +both 0 0 +EOF +lxc start v1 +lxc stop -f v1 + +lxc delete -f v1 +lxc profile device remove default root +lxc profile device remove default eth0 + # Create project with restricted disk source path. lxc project create restricted \ -c features.images=false \