Skip to content

Commit

Permalink
test/suites: Test OSD pool size flag
Browse files Browse the repository at this point in the history
Signed-off-by: Max Asnaashari <[email protected]>
  • Loading branch information
masnax committed Oct 22, 2024
1 parent 283088d commit 861a503
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/suites/storage_driver_ceph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ test_storage_driver_ceph() {
lxc storage delete "lxdtest-$(basename "${LXD_DIR}")-pool1"
lxc storage delete "lxdtest-$(basename "${LXD_DIR}")-pool2"
ceph --cluster "${LXD_CEPH_CLUSTER}" osd pool rm "lxdtest-$(basename "${LXD_DIR}")-existing-osd-pool" "lxdtest-$(basename "${LXD_DIR}")-existing-osd-pool" --yes-i-really-really-mean-it


# Test that the pool size setting only applies to the created pool, and not any other pools.
pool1="$("lxdtest-$(basename "${LXD_DIR}")-pool1")"
pool2="$("lxdtest-$(basename "${LXD_DIR}")-pool2")"
lxc storage create "${pool1}" ceph volume.size=25MiB ceph.osd.pg_num=16 ceph.osd.pool_size=1
ceph --cluster "${LXD_CEPH_CLUSTER}" osd pool get "${pool1}" size --format json | jq '.size' | grep -q 1
ceph --cluster "${LXD_CEPH_CLUSTER}" osd pool get ".mgr" size --format json | jq '.size' | grep -q 3

lxc storage create "${pool2}" ceph volume.size=25MiB ceph.osd.pg_num=16 ceph.osd.pool_size=2
ceph --cluster "${LXD_CEPH_CLUSTER}" osd pool get "${pool1}" size --format json | jq '.size' | grep -q 1
ceph --cluster "${LXD_CEPH_CLUSTER}" osd pool get "${pool2}" size --format json | jq '.size' | grep -q 2
ceph --cluster "${LXD_CEPH_CLUSTER}" osd pool get ".mgr" size --format json | jq '.size' | grep -q 3

lxc storage delete "${pool1}"
lxc storage delete "${pool2}"
)

# shellcheck disable=SC2031
Expand Down

0 comments on commit 861a503

Please sign in to comment.