13 Commits

Author SHA1 Message Date
Zygmunt Bazyli Krynicki
5ab61c19ea tests/main: document more tests (#13900)
* tests/main: document manpages

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document network-retry

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: fix typo: queries

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document no-snap-repair-classic

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document non-home

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document op-remove

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document op-remove-retry

The test implementation and name hint at a retry logic, but the reality is
different.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document parallel-install-aliases

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document parallel-install-auto-aliases

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document parallel-install-basic

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document parallel-install-classic

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document parallel-install-common-dirs-undo

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document parallel-install-common-dirs

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document parallel-install-desktop

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document parallel-install-interfaces

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document parallel-install-snap-icons

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document parallel-install-store

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document prefer

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document prepare-image-check-arch

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document prepare-image-classic

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests/main: document prepare-image-gating

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

---------

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2024-04-29 09:04:45 -03:00
Michael Vogt
5e2d18ff0f tests: fix parallel-install-basic on external UC16 devices
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).
2022-01-12 12:37:54 +01:00
Maciej Borzecki
64abc4d324 tests/main: actually use tests.session for executing things as a user
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-04 15:20:40 +02:00
Maciej Borzecki
2e1ebf284e tests/main: disable tests that require user session on ubuntu-14.04
Since this requires a more recent systemd

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-04 10:30:55 +02:00
Maciej Borzecki
a6a3bcc7df tests/main/parallel-install-basic: start test user session before su
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-09-28 13:24:58 +02:00
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