tests/lib/prepare-restore: further tweak snapd package purge
On some distros, attempting to purge a package that does not exist may fail.
Make sure we purge snapd only where we know it's preinstalled, but make sure
that there are no signs of snapd on other systems too.
Signed-off-by: Maciej Borzecki <email address hidden>
tests: add workaround for missing cache reset on older snapd
Older versions of snapd did not do a `rm -rf /var/cache/snapd/*`.
Newer versions of snapd create /var/cache/snapd/aux which means
that `dpkg --purge snapd` may fail after a re-exec. We need to
think how to fix that.
However to unblock tests we should add this workaround.
tests: enable tests that write /etc/{hostname,timezone} on core18
The systemd in Ubuntu 18.04 dropped some patches to make the
"writable-path" magic in core18 work. These patches got re-added
in bionic-proposed and in ppa:canonical-foundations/ubuntu-image.
This PR enables the tests on core18 to validate that the bug
is actually fixed.