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
|
summary: Ensure that the udev interface backend works.
details: |
This test checks that the udev rules file is created when a snap declaring
a dependency on an interface (being it a slot or a plug) and that concrete
dependency has a related udev snippet, then the udev rules files are created
on install and removed after it is uninstalled.
Currently the ony interface that declares a udev snippet is the modem-manager
interface for its slot. This test can be easily extended with variants when
more interfaces declare udev snippets.
prepare: |
echo "Given a snap declaring a slot with associated udev rules is installed"
"$TESTSTOOLS"/snaps-state install-local modem-manager-consumer
execute: |
echo "Then the udev rules files specific to it are created"
test -f /etc/udev/rules.d/70-snap.modem-manager-consumer.rules
expected="ATTRS{idVendor}==\".*?\", ATTRS{idProduct}==\".*?\""
grep -Pq "$expected" /etc/udev/rules.d/70-snap.modem-manager-consumer.rules
echo "When the snap is removed"
snap remove --purge modem-manager-consumer
echo "Then the udev rules files are removed"
not test -f /etc/udev/rules.d/70-snap.modem-manager-consumer.rules
|