Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add details for core tests suite #13912

Merged
8 changes: 8 additions & 0 deletions tests/core/network-config/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
summary: Check that `snap set {system,core} network.disable-ipv6` works

details: |
In Ubuntu Core systems network.disable-ipv6 core/system config can be used
to enable and disable the ip v6 protocol.

This test verifies that when network.disable-ipv6 core/system config is set
to true, then the ipv6 is disable in the system. Also it is verified that when
the config is set to false, then the ipv6 is enabled in the system.

environment:
snap_nick/system: system
snap_nick/core: core
Expand Down
10 changes: 10 additions & 0 deletions tests/core/persistent-journal-namespace/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
summary: Test journal.persistent core config option is honored by journal namespaces

details: |
In Ubuntu Core systems journal.persistent core config option can be used to
enable and disable the journal persistence. If persistent journals were previously
enabled by this setting, changing the value to false will delete all saved logs.

This test verifies that when journal.persistent core config is set to true, the
journal logs are written and those are deleted when the config is set to false.
Also it is verified that a journal quota group can be created, and the presence
of its corresponding namespace log.

# these systems do not support journal quota groups due to their old systemd versions.
# requires systemd v245+
systems:
Expand Down
8 changes: 8 additions & 0 deletions tests/core/persistent-journal/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
summary: Test journal.persistent core config option

details: |
In Ubuntu Core systems journal.persistent core config option can be used to
enable and disable the journal persistence. If persistent journals were previously
enabled by this setting, changing the value to false will delete all saved logs.

This test verifies that when journal.persistent core config is set to true, the
journal logs are written and those are deleted when the config is set to false.

prepare: |
systemctl status snapd > before.txt

Expand Down
4 changes: 4 additions & 0 deletions tests/core/reboot/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
summary: Ensure that service and apparmor profiles work after a reboot

details: |
The test checks that after a system reboot the snaps are still there,
the snapd service is running and the apparmor profiles are still loaded.

# Start early as it takes a long time.
priority: 100

Expand Down
4 changes: 4 additions & 0 deletions tests/core/services/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
summary: Ensure all services on Core are active

details: |
The test verifies that the snapd.autoimport, snapd.sshd-keygen, snapd,
and snapd.snap-repair services are active in Ubuntu Core systems.

execute: |
echo "Ensure one-shot services are working"
for oneshot in snapd.autoimport.service snapd.sshd-keygen.service; do
Expand Down
12 changes: 12 additions & 0 deletions tests/core/snap-auto-import-asserts-spools/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
summary: Check that `snap auto-import` works as expected

details: |
The auto-import command searches available mounted devices looking for
assertions that are signed by trusted authorities, and potentially
performs system changes based on them.

Assertions to be imported must be made available in the auto-import.assert file
in the root of the filesystem.

This test verifies that if snapd is not running, the `snap auto-import` command
spools assertions into /run/snapd/auto-import, and then when snapd is started
`snap auto-import` command reads the assertions from the auto-import dir.

systems: [ubuntu-core-*-64]

prepare: |
Expand Down
12 changes: 12 additions & 0 deletions tests/core/snap-auto-import-asserts/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
summary: Check that `snap auto-import` works as expected

details: |
The auto-import command searches available mounted devices looking for
assertions that are signed by trusted authorities, and potentially
performs system changes based on them.

Assertions to be imported must be made available in the auto-import.assert file
in the root of the filesystem.

Having created a ramdisk with the account-key assertion, this test verifies that
an account key can be imported by the `snap auto-import` command from the
mounted ramdisk.

systems: [ubuntu-core-*-64]

prepare: |
Expand Down
14 changes: 14 additions & 0 deletions tests/core/snap-auto-mount/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
summary: Check that `snap auto-import` works as expected

details: |
The auto-import command searches available mounted devices looking for
assertions that are signed by trusted authorities, and potentially
performs system changes based on them.

If one or more device paths are provided via --mount, these are temporarily
mounted to be inspected as well

Assertions to be imported must be made available in the auto-import.assert file
in the root of the filesystem.

This test creates new block device to trigger auto-import mount and then
verifies the auto-mount magic has given us the assertion.

systems:
- ubuntu-core-16-64
- ubuntu-core-18-64
Expand Down
8 changes: 8 additions & 0 deletions tests/core/snap-core-fixup/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
summary: Check that the core-fixup-sh script works

details: |
Ubuntu Core systems previous to UC20 have a service which is used to fix
broken uboot environments. This has been added because of this issue
https://bugs.launchpad.net/snappy/+bug/1769669

This test verifies that having a broken uboot environment (two uboot.env files),
running the core-fixup script is able to correct the problem and fix the image.

# currently no fixups for UC20, so don't run this test there
systems: [ubuntu-core-1*]

Expand Down
8 changes: 8 additions & 0 deletions tests/core/snapd-failover/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
summary: Check that snapd failure handling works

details: |
Snapd has a failure handling mechanism to auto revert when a refresh process fails.
This test verifies this mechanism by trying to install a broken snapd snap
multiple times to validate that if a device wants to keep trying a refresh to a
broken snapd snap for some reason, it will be able to revert and fallback
as many times as needed. Also checks that after the revert, the snapd snap
revision has to be the same as before the broken one was installed.

prepare: |
# on UC16, we should transition to using the snapd snap before running the
# test because it by default uses the core snap
Expand Down
12 changes: 12 additions & 0 deletions tests/core/snapd-refresh-vs-services/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
summary: Check that refreshing snapd does not interfere with snap services

details: |
This test verifies the fix for the issue raised in https://bugs.launchpad.net/snapd/+bug/1924805
which fixes a race condition on certain devices where the device unexpectedly reboots during a
snapd refresh.

The problem is reproduced when we refresh snapd itself after having written out some systemd
units that include the Requires= above (which could happen for app snap refreshes or new
installs after snapd 2.49.2 is installed), then unmount/stop usr-lib-snapd.mount which,
due to how Requires= works, will forcibly stop all services which have the Requires= bit in it.
Then, after snapd finishes refreshing itself, those services will be left in the
terminated state, effectively killing the services when snapd refreshes itself.

# TODO: we should also run it on classic later

systems:
Expand Down
8 changes: 8 additions & 0 deletions tests/core/uboot-unpacked-assets/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
summary: Ensure we have unpacked kernel.img/initrd.img on uboot systems

details: |
In Ubuntu Core systems the kernel is unpacked in different locations depending
on the version.

This test verifies that in Ubuntu Core 20+ the the kernel snap is extracted
onto ubuntu-seed and in previous systems the kernel snap is extracted onto
/boot/uboot.

systems: [ubuntu-core-*-arm-*]

environment:
Expand Down
10 changes: 10 additions & 0 deletions tests/core/uc20-recovery/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
summary: verify booting into recovery mode on UC20 systems

details: |
In recovery mode, the device boots to a temporary system and operates
as it would from a pristine initial installation, including its snaps.
This allows you to log in to the system using prior credentials to recover
the data, either via SSH or locally after setting up a password for the user.

This test verifies that it is possible to transition from run mode to recovery
mode and back again. In recovery mode the test checks that the seed
is mounted in recover mode too and the host data is accessible.

systems:
- ubuntu-core-20-*
- ubuntu-core-22-*
Expand Down
9 changes: 9 additions & 0 deletions tests/core/writablepaths/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
summary: Ensure that the writable paths on the image are correct

details: |
The file writable-paths allows specific paths in the root partition filesystem
to be made writable, whilst leaving the rest of the root filesystem read-only.
It does this by creating overlaying writable mounts on top of the read-only
root filesystem. These writable mounts are backed to the writable partition.

This test ensures everything in writable-paths is actually writable by checking
in the paths declared in /etc/system-image/writable-paths.

execute: |
echo "Ensure everything in writable-paths is actually writable"
#shellcheck disable=SC2002
Expand Down
8 changes: 8 additions & 0 deletions tests/core/xdg-open-on-core/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
summary: Ensure snap userd returns an error for xdg-open requests on Core

details: |
Snapd contains a system where XDG utility programs, that applications may
commonly call, are replaced with programs that communicate the request back
to snapd user session daemon, to present a question to the user.

The test verifies that the 'xdg-open' program is not supported in Ubuntu Core
systems

prepare: |
if ! tests.session has-session-systemd-and-dbus; then
exit 0
Expand Down