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
|
summary: Ensure that the netlink audit interface works.
details: |
The netlink-audit interface allows read/write to kernel audit system.
The test-snapd-netlink-audit snap creates a netlink socket and binds it.
# Ubuntu 14.04: CAP_AUDIT_READ is not available in its kernel
# arch: CONFIG_AUDIT is not enabled in the default kernel
systems: [-ubuntu-14.04-*, -arch-*]
prepare: |
# Install a snap declaring a plug on netlink-audit
"$TESTSTOOLS"/snaps-state install-local test-snapd-netlink-audit
execute: |
echo "The interface is disconnected by default"
snap interfaces -i netlink-audit | MATCH -- '- +test-snapd-netlink-audit:netlink-audit'
echo "When the interface is connected"
snap connect test-snapd-netlink-audit:netlink-audit
echo "Then the snap is able to create and bind a netlink socket"
test-snapd-netlink-audit.bind
if [ "$(snap debug confinement)" = partial ] ; then
exit 0
fi
echo "When the plug is disconnected"
snap disconnect test-snapd-netlink-audit:netlink-audit
echo "Then the snap is not able to bind the netlink socket"
if test-snapd-netlink-audit.bind; then
echo "Expected permission error creating/binding a netlink socket"
exit 1
fi
|