Skip to content

Commit

Permalink
Merge pull request canonical#140 from mihalicyn/raw_idmap_vm_extra_test
Browse files Browse the repository at this point in the history
storage-disks-vm: add a few extra tests for raw.idmap setting
  • Loading branch information
tomponline authored Apr 17, 2024
2 parents 6dc90c0 + 24d8221 commit 70fedce
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/storage-disks-vm
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 70fedce

Please sign in to comment.