We saw some test failures running this test on UC16 external
devices. It turns out the failures are a side-effect of the
way `tests.session exec` works on UC16. Here the `/snap/bin`
directory is not in `PATH`.
The other places that use `tests.session exec` workaround this
by prepending `snap run`. This commit does the same for
the `parallel-install-basic` test (thanks to Maciej for the
suggestion).
The change updates the layout of the tests following a proposed order
which should make the test easier to read and understand
The proposed order is:
summary
details
backends
systems
manual
priority
warn-timout
kill-timeout
environment
prepare
restore
debug
execute
YAML can be a bit deceiving, especially when it looks right on paper.
While each of the existing restore fragments were one-liners it's better
to be safe rather than sorry.
Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
This patch was automatically made with the following command
find -name 'task.yaml' -exec sed -E -i -e 's/^( +)!([^|]+$)/\1not\2/g' {} \;
This looks for all files named "task.yaml" and replaces all occurrences
of "! something..." with "not something..." as long as pipes are not
used.
Pipes are more problematic because for correct semantics we need to
place the "not" command on the part that we actually expect to fail.
For example, consider the following three programs. The input and two
variations of the output program:
! echo foo bar | grep bar # input program
not echo foo bar | grep bar # naive replacement
echo foo bar | not grep bar # correct replacement
A "!" applied to a pipe expression returns the negated exit code of the
pipe. A pipe expression alone returns the exit status of the last
element of the pipe, unless "set -o pipefail" is in effect, which we
disabled a while ago.
Therefore the correct replacement for pipe programs is to negate the
last component. The subsequent patch addresses this.
Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
Establish the necessary mappings for parallel installed snaps by updating the
mount profile of the snap. The change adds the following bind
mounts:
- /snap/foo_bar -> /snap/foo
- /var/snap/foo_bar -> /var/snap/foo
The mounts have `x-snapd.origin=overname` in the mount profile. 'Overname' mounts are applied before any other mounts.