* i/b/custom_device: add new custom-device interface
* tests: spread tests for the custom-device interface
* tests: remove unused variable
* tests: add custom-device plug to interfaces-many-core-provided
* i/b/custom-device: fix base declaration
* i/b/custom-devices: error reporting, pattern handling
* i/b/custom_device: add unit test for ** check
* i/b/custom_device: add support for read-devices attribute
* i/b/custom_device: revert change on ** in paths
It's safer to be restrictive and keep the globbing to "*".
* i/b/custom_device: update comment on AppArmor globbing
* i/b/custom_device: minor formatting change
* i/b/custom_device: improve logic of slot attribute naming
* i/b/custom_device_test: add tests
* i/b/custom_device: update interface declaration
* interfaces/custom-device: mv read/write under a files key
As suggested by Samuele. Also update all the tests.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
* i/b/custom_device: remove leftover comments
* i/b/custom_device: remove unneeded function parameter
* i/b/custom-devices: improve validation, error handling and tests
* i/b/custom_device: test more invalid characters
Co-authored-by: Michael Vogt <mvo@ubuntu.com>
Co-authored-by: Ian Johnson <ian.johnson@canonical.com>
with merge fixes
Tweak snapd.fish to be compatible with even older releases of fish, going back to 2.7, which was shipped with Ubuntu 18.04.
* data/env: make fish setup compatible with fish 2.7
Make the environment setup script compatible with fish 2.7 which was shipped
with Ubuntu 18.04.
Thanks to @faho for the review.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/main/user-session-env: verify env in fish shell
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/main/user-session-env: tweak comments
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* data/env: provide reasonable default if XDG_DATA_DIRS is unset in fish shell
Fixes: https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1960702
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/main/user-session-env: verify that XDG_DATA_DIRS contains reasonable defaults
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
The reset_all_snaps code will get confused if the state contains
disabled snaps. The reason is that importing `reset.sh` will remove
all disabled snaps first. Then the `reset_all_snaps` will call
`restore_snapd_state` which will restore the state and the snaps
but the mount unit of the removed snaps are not re-started so
the snap appears to be broken.
This happens on e.g. the external testflinger devices when the
device starts with a stable core20, then refreshes to a core20
from beta. In that configuration the `tests.invariant` test will
detect a broken core20 revision because of the above behavior.
There are various ways to fix this, the easiest is to just start
with a snapd state that contains no disabled snaps on core systems.
* build-aux: error when a build is dirty
* generate-packaging-dir: fix packaging diff
* buid-aux: set version before calling ./generate-packaging-dir
* debian, generate-packging-dir: make symlinks consistent with the git defaults
Otherwise the check matches things like `dbus-daemon-launch-helper` which are
incorrectly reported as errors
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Use dbus-user-session to provide the session but, and drop dbus-x11 which
requires $DISPLAY and actual X to be running.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/lib/fakestore: allow passing a snap blob file or dir to make-refreshable
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/core/kernel-and-base-single-reboot-failover: verify failover handling
Verify failover handling when executing simultaneous refresh of kernel and base
with a single reboot.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/lib/fakestore/refresh: strip quoting when faking a new version
Sometimes a snap version can be quoted, eg. version: '2021112' in core18 to
avoid ambiguity whether the value is a string or a number. However, when adding
+fake1 suffix, it's clearly a string, thus the quoting should be stripped,
otherwise we produce invalid yaml.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/lib/fakestore: allow dots in original version
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/core/kernel-and-base-single-reboot-failover: comments update
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/lib/fakestore: provide help message for new make-refreshable options
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/lib/fakestore: more improvements to make-refreshable command
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/core/kernel-and-base-single-reboot-failover: tweak comments
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/lib/fakestore/refresh: strip quoting when faking a new version
Sometimes a snap version can be quoted, eg. version: '2021112' in core18 to
avoid ambiguity whether the value is a string or a number. However, when adding
+fake1 suffix, it's clearly a string, thus the quoting should be stripped,
otherwise we produce invalid yaml.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/core/kernel-and-base-single-reboot: verify there is a single reboot when refreshing kernel and boot base
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/core/kernel-and-base-single-reboot: comment tweaks
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/core/kernel-and-base-single-reboot: check revisions, check reboots
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/core/kernel-and-base-single-reboot: fix keeping track of current revisions
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/lib/fakestore: allow dots in original version
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* packaging/ubuntu, packaging/debian: depend on dbus-session-bus provider
On a cgroup v2 system, we rely on being able to set up a systemd scope for the
snap applications. This is done by communicating with a proper systemd instance
over a dbus bus, which for user session is the session bus.
This only came up when one of the intermediate dependencies of ubuntu-server,
had their dependencies updated and no longer requires session bus and we
observed that it was impossible to launch snap applications that required device
access on Ubuntu 21.10.
Related to:
- https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1951491
- https://forum.snapcraft.io/t/cannot-launch-snap-applications-with-cgroup-v2/27700
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* spread: have ubuntu-core-18 be based on 18.04 images
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* packaging/ubuntu-16.04: depend on dbus-session-bus if not on 16.04
The (default-)dbus-session-bus was introduced only in 2018, so it's available in
18.04 but not in earlier releases, so revert to not having a special dependency
on that release. Not having a session bus and lack of snap app tracking is not
fatal on 16.04, but is a must on 21.10 where a snap specific cgroup created by
dbus user instance is required for device access filtering.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/lib/pkgdb: dbus-user-session shall be pulled in through default-dbus-session-bus dependency
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/lib/pkgdb: fix indentation
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/main/lxd-snapfuse,lxd-try,lxd-mount-units: wait for container to be booted, run apt update before installing any packages
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* tests/main/lxd-try/task.yaml: fix typo
Co-authored-by: Ian Johnson <person.uwsome@gmail.com>
* interfaces/interfaces/scsi_generic: add interface for scsi generic devices
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
* interfaces/interfaces/scsi_generic: fixing formatting
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
* interfaces/interfaces/scsi_generic: update summary
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
* interfaces/interfaces/scsi_generic: restrict plug side with base declaration
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
* interfaces/builtin/scsi-generic: fix copyright date
Co-authored-by: Ian Johnson <person.uwsome@gmail.com>