Skip to content

Commit

Permalink
test/suites: Test image export from devlxd
Browse files Browse the repository at this point in the history
Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
  • Loading branch information
hamistao committed Sep 13, 2024
1 parent fcb0fa4 commit ee0522b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/suites/devlxd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ test_devlxd() {
lxc exec devlxd -- test -S /dev/lxd/sock
lxc file push --mode 0755 "devlxd-client/devlxd-client" devlxd/bin/

# Try to export host private image from devlxd.
fingerprint="$(lxc image info testimage | awk '/^Fingerprint:/ {print $2}')"
[ "$(lxc exec devlxd -- devlxd-client image-export "${fingerprint}")" = "not authorized" ]
# Trying to get a private image should return a not found error so that the client can't infer the existence
# of and image with the provided fingerprint.
lxc config set devlxd security.devlxd.images true
[ "$(lxc exec devlxd -- devlxd-client image-export "${fingerprint}" | jq -r .error)" = "not found" ]
lxc config unset devlxd security.devlxd.images

lxc config set devlxd user.foo bar
[ "$(lxc exec devlxd -- devlxd-client user.foo)" = "bar" ]

Expand Down

0 comments on commit ee0522b

Please sign in to comment.