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
|
summary: Ensure that the basic devpts security rules are in place.
details: |
Test that a snap which has a plug for the physical-memory-observe interface
can read /dev/pts, can openpty, and can access the PTY via /dev/ptmx, both
with and without the physical-memory-observe interface connected.
execute: |
if [ "$(snap debug confinement)" = none ] ; then
exit 0
fi
echo "Given a basic snap is installed"
"$TESTSTOOLS"/snaps-state install-local test-snapd-devpts
echo "When no plugs are not connected"
if snap interfaces -i physical-memory-observe | MATCH ":physical-memory-observe .*test-snapd-devpts" ; then
snap disconnect test-snapd-devpts:physical-memory-observe
fi
echo "Then can openpty"
test-snapd-devpts.openpty | MATCH PASS
echo "Then can access slave PTY"
test-snapd-devpts.useptmx | MATCH PASS
echo "When a udev tagging plug is connected"
snap connect test-snapd-devpts:physical-memory-observe
echo "Then can openpty"
test-snapd-devpts.openpty | MATCH PASS
echo "Then can access slave PTY"
test-snapd-devpts.useptmx | MATCH PASS
|