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
|
summary: Ensure canonical-livepatch snap works
details: |
Verify the canonical-livepatch can be installed and it
retrieves its status properly.
# livepatch works only on LTS amd64 systems
systems: [ubuntu-14.04-64, ubuntu-16.04-64, ubuntu-18.04-64, ubuntu-20.04-64, ubuntu-22.04-64]
restore: |
snap remove --purge canonical-livepatch || true
if os.query is-trusty || os.query is-xenial || os.query is-bionic; then
# old systemd is not doing cleanups
find /sys/fs/cgroup/ -type d -name "snap.*" -prune | while read -r svc; do
rmdir "$svc" || true
done
fi
execute: |
echo "Ensure canonical-livepatch can be installed"
snap install canonical-livepatch
echo "Wait for it to respond"
for _ in $(seq 30); do
if canonical-livepatch status > /dev/null 2>&1 ; then
break
fi
sleep .5
done
echo "And ensure we get the expected status"
canonical-livepatch status 2>&1 | MATCH "Machine is not enabled"
|