Commit Graph

8 Commits

Author SHA1 Message Date
Sergio Cazzolato
9087d184db Update layout for tests - part 1
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
2021-04-08 15:05:29 -03:00
Sergio Cazzolato
a6e8691e0b Moving main suite to snaps-state tool part 4 2020-10-01 12:00:46 -03:00
Sergio Cazzolato
d97b0d6d17 Moving install_local test-snapd-tools to install_local test-snapd-sh 2019-12-05 11:50:03 -03:00
Zygmunt Krynicki
81724f5779 tests: always say 'restore: |'
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>
2019-08-27 14:34:29 +02:00
Zygmunt Krynicki
dab3d43ac1 tests: replace subset of "! foo" with "not foo"
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>
2019-05-29 10:09:48 +02:00
Maciej Borzecki
c30339a434 tests: more fixes for restrictive umask
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2018-12-05 15:23:02 +01:00
Maciej Borzecki
53833075a6 tests/main/parallel-install-basic: drop devmode
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2018-09-18 09:19:12 +02:00
Maciej Borzecki
2ac586c47d many: mount namespace mapping for parallel installs of snaps (#5713)
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.
2018-09-18 08:45:34 +02:00