summary: Check that the authentication errors are properly reported. details: | Verify that in ubuntu core just authenticated users are allowed to install snaps ans to connect interfaces. Also validate the error messages are the expected. systems: [-ubuntu-core-*] prepare: | mkdir -p /home/test/.snap echo -n "{\"macaroon\":\"yummy\",\"discharges\":[ \"some \"]}" > /home/test/.snap/auth.json chown -R test:test /home/test/.snap restore: | rm -rf /home/test/.snap execute: | echo "An unauthenticated user cannot install snaps" if su - -c "snap install test-snapd-sh" test 2> install.output; then echo "Expected error installing snap from unauthenticated account" exit 1 fi expected="error: access denied (try with sudo)" [ "$(cat install.output)" = "$expected" ] echo "An unauthenticated user cannot connect plugs to slots" if su - -c "snap connect foo:bar baz:fromp" test 2> connect.output; then echo "Expected error connecting plugs to slots from unauthenticated account" exit 1 fi [ "$(cat connect.output)" = "$expected" ]