diff --git a/test/suites/projects.sh b/test/suites/projects.sh index 463444a9152..b52dd7a488c 100644 --- a/test/suites/projects.sh +++ b/test/suites/projects.sh @@ -550,6 +550,43 @@ test_projects_limits() { deps/import-busybox --project p1 --alias testimage + # Test per-pool limits. + incus storage create limit1 dir + incus storage create limit2 dir + + incus project set p1 limits.disk=50MiB + incus project set p1 limits.disk.pool.limit1=0 + incus project set p1 limits.disk.pool.limit2=0 + + ! incus storage list | grep -q limit1 || false + ! incus storage list | grep -q limit2 || false + + incus storage volume create "${pool}" foo size=10MiB + ! incus storage volume create "${pool}" bar size=50MiB || false + incus storage volume delete "${pool}" foo + + ! incus storage volume create limit1 foo size=10GiB || false + ! incus storage volume create limit2 foo size=10GiB || false + + incus project set p1 limits.disk.pool.limit1=10MiB + incus project set p1 limits.disk.pool.limit2=10MiB + incus storage volume create limit1 foo size=10MiB + ! incus storage volume create limit1 bar size=10MiB || false + incus storage volume create limit2 foo size=10MiB + ! incus storage volume create limit2 bar size=10MiB || false + + ! incus storage volume create "${pool}" foo size=40MiB || false + incus storage volume delete limit1 foo + incus storage volume delete limit2 foo + incus storage volume create "${pool}" foo size=40MiB + + incus storage volume delete "${pool}" foo + incus project unset p1 limits.disk.pool.limit1 + incus project unset p1 limits.disk.pool.limit2 + incus project unset p1 limits.disk + incus storage delete limit1 + incus storage delete limit2 + # Create a couple of containers in the project. incus init testimage c1 incus init testimage c2