Skip to content

Commit

Permalink
test: lxc image list --all-projects
Browse files Browse the repository at this point in the history
This commit adds tests for listing images across all projects.

Signed-off-by: Kadin Sayani <kadin.sayani@canonical.com>
  • Loading branch information
kadinsayani committed Nov 8, 2024
1 parent 3722085 commit 79816ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/suites/projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ test_projects_images() {
lxc project switch default
! lxc image list | grep -q "${fingerprint}" || false

# The imported image is visible in the default project when the all-projects flag is set.
lxc image list --all-projects | grep -q "${fingerprint}"

# Switch back to the project and clean it up.
lxc project switch foo
lxc image delete "${fingerprint}"
Expand All @@ -419,6 +422,9 @@ test_projects_images() {
# The image alias from the default project is not visible here
! lxc image list | grep -q testimage || false

# The image alias from the default project is visible when the all-projects flag is set.
lxc image list --all-projects | grep -q testimage

# Rename the image alias in the project using the same it has in the default
# one.
lxc image alias rename foo-image testimage
Expand Down

0 comments on commit 79816ce

Please sign in to comment.