diff --git a/test/suites/devlxd.sh b/test/suites/devlxd.sh index ef3b7689f89e..0ca42fe91f18 100644 --- a/test/suites/devlxd.sh +++ b/test/suites/devlxd.sh @@ -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 an 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" ]