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
|
summary: Ensure that adb-support creates udev rules
details: |
Connecting the adb-support plug to a matching slot adds appropriate udev
rules to the system. Before such connection is placed there are no
wide-open, write-access rules present.
prepare: |
"$TESTSTOOLS"/snaps-state install-local test-snapd-adb-support
execute: |
echo "Check initially there are not udev rules granting writable-to-all permission to anything"
# If there are any udev rules from existing snaps they are not granting
# writable-to-all permission to anything. This part is conditional because
# some systems have the network manager installed and such systems will get
# additional rules.
if [ "$(find /etc/udev/rules.d -name '70-snap.*.rules' | wc -l)" -gt 0 ]; then
NOMATCH adb-support /etc/udev/rules.d/70-snap.*.rules
NOMATCH 'MODE="0666"' /etc/udev/rules.d/70-snap.*.rules
fi
snap connect test-snapd-adb-support:adb-support
echo "Once the snap is connected there are adb-support udev rules that grant write-all permissions."
MATCH "Concatenation of all adb-support udev rules" /etc/udev/rules.d/70-snap.*.rules
MATCH 'MODE="0666"' /etc/udev/rules.d/70-snap.*.rules
|