Skip to content

Commit

Permalink
test: Expect non-null disk state when usage is not supported
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
hamistao committed Dec 6, 2024
1 parent e064bbc commit 5ad4a57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/suites/storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ad4a57

Please sign in to comment.