1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
summary: Ensures that introspection of login1 of the shutdown interface works.
details: |
A snap declaring the shutdown plug is defined, its command just calls
the Introspect method on org.freedesktop.login1.
#debian: no confinement (AppArmor, Seccomp) available on these systems
#ubuntu-core: unity7 implicit classic slot needed (used to access dbus-send) not available on core
systems: [-debian-*, -ubuntu-core-*]
prepare: |
echo "Given a snap declaring a plug on the shutdown interface is installed"
"$TESTSTOOLS"/snaps-state install-local shutdown-introspection-consumer
execute: |
echo "The interface is disconnected by default"
snap interfaces -i shutdown | MATCH -- '- +shutdown-introspection-consumer:shutdown'
echo "When the plug is connected"
snap connect shutdown-introspection-consumer:shutdown
echo "Then the snap is able to get introspect org.freedesktop.login1"
expected="<interface name=\"org.freedesktop.login1.Manager\">"
su -l -c "shutdown-introspection-consumer" test | MATCH "$expected"
if [ "$(snap debug confinement)" = partial ]; then
exit
fi
echo "When the plug is disconnected"
snap disconnect shutdown-introspection-consumer:shutdown
echo "Then the snap is not able to get system information"
if su -l -c "shutdown-introspection-consumer" test; then
echo "Expected error with plug disconnected"
exit 1
fi
|