Files
snapd/tests/lib
Ian Johnson 5bf1610f72 o/devicestate/handlers_install.go: add workaround to create dirs for install (#10608)
* tests/lib/store.sh: allow adding extra bits to snap-declaration via opts

This is needed in order to customize the snap-declaration with i.e. plugs or
slots or other special things granted through the snap-declaration assertion to
the snap.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>

* tests/lib/nested.sh: add NESTED_FAKESTORE_SNAP_DECL_PC_GADGET env var

This is used add special extra custom snap-declaration bits to the declaration
for tests which use the fakestore but need extra permissions to do things in
hooks or services for the gadget snap.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>

* o/devicestate/handlers_install.go: add workaround to create dirs for install

For UC20 install mode, we have devices which need to install files into the run
mode system before rebooting into install mode. The temporary solution designed
for this was to use the install-device hook with system-files providing write
access to the /run/mnt/ubuntu-data/system-data/_writable_defaults/... directory
where ubuntu-data is mounted during install mode. That seemed to work fine in
devmode, but the issue in strict mode is that system-files only grants
permissions to create that specific file, it doesn't grant permission to create
any of the parent directories the file lives in.

So, temporarily for this device to be released and shipped, create those
directories at the end of the setup-run-system task, which runs before the
install-device hook, thus ensuring that the hook is successful.

Also add a spread test for this situation.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>

* tests/core20-install-device-file-install-via-hook-hack: also check dir perms

As suggested by Samuele, also check the permissions of the directories that we
are creating here.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-08-16 12:13:50 -05:00
..
2021-05-18 10:00:25 -03:00
2020-11-06 09:30:35 -03:00