846 Commits

Author SHA1 Message Date
Alfonso Sánchez-Beato
b0b324eb62 tests/core20-boot-config-update: wait for the reboot always
In some cases the reboot was happening while running "snap watch", it
makes more sense to run this after the reboot to ensure that the
change has finished.
2023-10-11 10:17:28 +02:00
Alfonso Sánchez-Beato
199073455b tests/core20-boot-config-update: wait for the reboot before the watch
In some cases the reboot was happening while running "snap watch", it
makes more sense to run this after the reboot to ensure that the
change has finished.
2023-10-11 10:17:28 +02:00
Philip Meulengracht
33aefb22e5 o/restart,o/devicestate: default to tasks being restart-boundaries if no restart-boundaries have been configured.
To support upgrade-paths to newer snapd and the new restart logic, when doing refreshes of snapd with other essential snaps, it could end up failing the refresh of the other essential snaps. Default to all restarts being acted like they are restart boundaries, if none have been configured.
2023-10-06 14:51:35 +02:00
Valentin David
d50dbc0cf4 tests/nested/manual/snapd-refresh-from-old: also test refresh to current
This tests was testing refresh only to edge. Which means it would not
fail in a branch but only once it is merged to master. The new variant
also test refresh to the current version to make sure we do not break
refresh.
2023-10-06 14:51:35 +02:00
Philip Meulengracht
11e0166f1c tests/nested/manual: correct some reboot messages after reboot code changes 2023-10-06 12:14:02 +02:00
Alfonso Sánchez-Beato
3b17006155 tests/muinstaller-real: ask twice for the recovery key
To make sure that LP#2036631 is fixed.
2023-10-06 12:08:41 +02:00
Valentin David
73c90a1575 tests/nested/manual/uc-update-assets-secure: do not check for shim in boot
This should only be in seed partition.
2023-10-06 11:03:29 +02:00
Alfonso Sánchez-Beato
98fedd95dd tests/remodel-uc20-to-uc22: enable encrypted variant
Run the test also for the encrypted case, using a new gadget for the
remodel target that has a shim signed with snakeoil keys.
2023-10-05 13:29:19 +02:00
Philip Meulengracht
8d4e3b2727 tests,overlord: review feedback from @pedronis
run unit tests with examples that include non-essential snaps, rename assertions
2023-10-05 09:27:15 +02:00
Philip Meulengracht
870e30ce76 t/n/m/core20-validation-sets: fix check of validation task, fix configure-default-user 2023-10-05 09:27:15 +02:00
Philip Meulengracht
102050d105 t/n/m/core20-validation-sets: add checks, manually add user 2023-10-05 09:27:15 +02:00
Philip Meulengracht
59357c3558 o/devicestate: only add track validation-sets task in run-mode.
Before it would result it being added to install mode as well, when we only set up the minimal set of snaps (gadget, kernel, base, snapd). If the validation-set contained any snaps besides these, it would fail. Wait until run mode, where we set up any non-essential snaps, and after this we expect all snaps to be present in system.
2023-10-05 09:27:15 +02:00
Valentin David
0a39bc4fb1 tests/nested/manual/install-min-size: make it more stable
`snap install` may cause reboot before the command ends, which causes
a deconnection. ssh returns 255 when a error happens, so we detect
the deconnection that way.
2023-10-03 17:20:23 +02:00
Alfonso Sánchez-Beato
c90867945e tests: add remodel case where target base is already installed
The test remodels from UC20 with and already installed core22 snap to
UC22.
2023-10-03 17:15:18 +02:00
Dimitri John Ledkov
d55f3123d4 go: go fix with 1.18
Apply `go fix ./...` to the whole code base using go-1.18 to remove
old build tags.
2023-09-25 13:22:14 +02:00
Valentin David
67cd71057d t/n/c/connected-after-reboot-revert: expect one more reboot on UC16
Here are the expected reboot causes:
 * Make current revision for snap "core" unavailable
 * Make snap "core" (unset) available to the system
 * Make current revision for snap "pc-kernel" unavailable
 * Make snap "pc-kernel" (unset) available to the system
2023-09-04 10:16:19 +02:00
Valentin David
97e757d13b t/n/m/fde-on-classic: Do not check for default EFI boot loader (shim)
The EFI boot loader is for the ESP, not the boot partition. This
was removed in pc-gadget recently.
2023-09-01 08:54:39 +02:00
alfonsosanchezbeato
dcb8ad2e44 tests: make muinstaller capable of installing Ubuntu Core (#13026)
* tests/muinstaller: allow installing Ubuntu Core images

* tests/muinstaller-core: add test using muinstaller for UC installation

This new test runs muinstaller installing Ubuntu Core images.

* tests/muinstaller: build statically and update deps

* tests: change order of arguments for muinstaller invocations

* tests/muinstaller: use better function names, remove unneeded arg

* tests/muinstaller-core: some minor fixes
2023-08-24 11:32:43 +02:00
Alfonso Sánchez-Beato
58a97f7e60 tests/remodel-offline: change pc gadget revision
Revision 148 has an additional min-size field for the ubuntu-save
partition, being that the only actual difference with the revision in
22/stable.
2023-08-11 13:49:25 +02:00
Alfonso Sánchez-Beato
df723923f9 tests: add spread tests for offline remodeling 2023-08-03 17:45:52 +02:00
Alfonso Sánchez-Beato
787122e857 tests/core20-auto-remove-user: do retries for set-ntp
The "sudo timedatectl set-ntp false" command some times fails with
message:

Failed to set ntp: Connection timed out

Apparently because it takes a bit of time to start
org.freedesktop.timedate1 and then stop systemd-timedated, as trying
again fixes the issue. Do some retries to prevent random failures of
this spread test.
2023-07-31 11:14:34 +02:00
Alfonso Sánchez-Beato
ddf7f6c701 tests/core20-early-config: make sure to configure any ethernet
The name of the interface is enp0s2 in some cases instead of ens3.
2023-07-28 12:56:50 +02:00
Alfonso Sánchez-Beato
fe7b56d346 tests/core20-early-config: check that netplan defaults from
the base are overriden.
2023-07-28 12:56:50 +02:00
Michael Vogt
08bcef175f snap: support install/refresh that result in "Wait" changes in the cli better (#12910)
* snap: support install/refresh that result in "Wait" changes in the cli better

On a classic system that supports mode the user experience when refreshing
a snap in wait state (like the kernel) is not great. The progress meter just
displays that a "Re-refresh" is in doing state. This is confusing for the
user as really a reboot is required.

So this commit change the behavior so that after a refresh that
ends up in a "Wait" snap will show a message:
```
Task set to wait until a manual system restart allows to continue
```

* snap: rename waitWaitTasks->waitForTasksInWaitStatus

* move "wait" handling ealier in showDone() and add missing unit test

* snap: remove warning about pressing "ctrl-c" as it no longer applies (thanks to Samuele)

* tests/lib/tools: use correct unit switch

* t/core/snapd-failover: use SIGKILL instead of SIGSEGV

We should avoid triggering of the segmentation fault check

* t/regression/mount-order-regression: set no mem limit

Unfortunately it happens that we hit the memory limit while setting up security profiles for the snap. Set no memory limit for this test

---------

Co-authored-by: Philip Meulengracht <philip.meulengracht@canonical.com>
2023-07-24 21:57:50 +02:00
Valentin David
361617826f tests: test factory reset without fde 2023-07-06 17:37:18 +02:00