From 81fe9da07833b354edbab95dd5e7cb6270d95c95 Mon Sep 17 00:00:00 2001 From: hamistao Date: Tue, 26 Nov 2024 11:49:35 -0300 Subject: [PATCH] test: Expect non-null disk state when usage is not supported Previously, when usage was not supported, we returned null root disk and thus did not show disk total size, even when it was possible. Now we represent not supporting showing disk usage with usage=-1. Signed-off-by: hamistao --- test/suites/storage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/suites/storage.sh b/test/suites/storage.sh index e236f736daa0..f988589580eb 100644 --- a/test/suites/storage.sh +++ b/test/suites/storage.sh @@ -931,8 +931,8 @@ EOF # Disable quotas. The usage should be 0. # shellcheck disable=SC2031 btrfs quota disable "${LXD_DIR}/storage-pools/${pool_name}" - usage=$(lxc query /1.0/instances/c1/state | jq '.disk.root') - [ "${usage}" = "null" ] + # Usage -1 indicates the driver does not support getting instance usage. + [ "$(lxc query /1.0/instances/c1/state | jq '.disk.root.usage')" = "-1" ] # Enable quotas. The usage should then be > 0. # shellcheck disable=SC2031