406 Commits

Author SHA1 Message Date
Valentin David
0a0b04616e tests: use KERNEL_CHANNEL/NESTED_KERNEL_CHANNEL instead of edge for pc-kernel (#13391)
* tests: use KERNEL_CHANNEL/NESTED_KERNEL_CHANNEL instead of edge for pc-kernel

* add var to define gadget channel used to create the nested vm

---------

Co-authored-by: Sergio Cazzolato <sergio.cazzolato@canonical.com>
2023-11-29 10:06:20 +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
Alfonso Sánchez-Beato
aa5baf4b8e tests/lib: select boot disk for classic images too 2023-07-05 07:56:23 +01:00
Alfonso Sánchez-Beato
209b447bf8 tests/lib/nested.sh: fix unbound variable access error 2023-05-11 08:21:14 +02:00
Sergio Cazzolato
0078bb08f5 tests: support for ubuntu core 22 in arm architecture (#12791)
* Tests support for ubuntu core 22 in arm architecture

This change includes the bits needed to run ubuntu-core in arm devices
and also the nested tests.

A new backend is added google-nested-arm.
Changes in tests to support the new system are also included.

* skip removing test-snapd-arm-tools

this is not needed anymore as focal is not being supported

* Use host machine for arch

* tests fixes

* skip nested arm xecution in github workflow
2023-05-09 09:21:16 +02:00
Sergio Cazzolato
cfccc9a891 tests: replace the systemd.sh helper by the tests.systemd tool in tests/lib (#12663)
* Repleace the systemd.sh helper by the tests.systemd tool in tests/lib

This is the first part of the migration to start using the tests.systemd
tool instead of the systemd.sh helper

* Fix shellcheck issues

* move function to get active snapd units to state.sh

It is the only place where the function is used

* Update missing functions in nested.sh

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 1c8efb77e1..14aa43a405

14aa43a405 new feature to re-run failed spread tests (#39)
604cb782db Fix shellcheck in systemd tool
bfc71082c8 Update the tests.systemd to allow parameters waiting for service status
8a2d0a99df Adding quiet tool and removing set +-x from tests.pkgs
d90935d2a4 A comment explaining about the default values for wait-for
3232c5dba7 Add support for ubuntu 23.04
a7164fba07 remove fedora 35 support, add fedora 37 support
89b9eb5301 Update systems supported
92bb6a0664 Include snap-sufix in the snaps.name tool

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 14aa43a405f344b056db4fec7aee78709c41959a

* use -n for tests.systemd wait-for-service

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 14aa43a405..162e93bd35

162e93bd35 update tests.systemd CLI options to be the same than retry command

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 162e93bd356f202b68408d0391b34e93a4f98755

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 162e93bd35..01a2a83b4b

01a2a83b4b Update tests.systemd to have stop units as systemd.sh

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 01a2a83b4b58262e13ca2578ac286a41b780fa7d

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 01a2a83b4b..9089ff5c02

9089ff5c02 Update tests to use the new tests.systemd stop-unit
44ecd5e56a Move tests.systemd stop-units to stop-unit

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 9089ff5c02a1cf074a05fb7c58af93274f63a446

* Use the new tests.systemd stop-unit command

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 9089ff5c02..75e8a426a5

75e8a426a5 make sure the unit is removed in tests.systemd test

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 75e8a426a59fb02ee74d5bb7c60c19403c9146a0

* Fix error in test muinstaller-real

the vm needs to be removed before creating a new one

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 75e8a426a5..63540b845a

63540b845a Fix error messages in remote pull and push

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 63540b845a542ee0a71257e0a726a618201ebb5d

* update how stop is used in muinstaller-real nested test

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 63540b845a..e5ae22a5d4

e5ae22a5d4 systemd units can be overwritten

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: e5ae22a5d42b55d6b33c3f692968e72c62a619dc
2023-04-04 23:02:29 -03:00
Sergio Cazzolato
7ce005366d tests: update the tests to start using the new store-state tool (#12649)
* New store-state tool to replace the store.sh helper

This is the new store tool inclusing a new test.
Also it is included a network took

* Fix store-state test and tool

Based on errors found in test results

* Fix refresh test

That part of the restore was missing

* Testing missing functions for store-state

Commands included:
 make-snap-installable command with snap-id
 make-snap-installable command without snap-id
 init-fake-refreshes command

* Skip test in ubuntu 14.04
2023-03-15 10:27:07 -03:00
Sergio Cazzolato
a7984f0ed0 tests: reduce the time we wait for a service to became active (#12630)
* Reduce the time we wait for a service to became active

This is needed to make the nested tests fail faster when the nested-vm
service fails to start

* Increase the time we wait for service inactive in core20-install-mode-shutdown-via-hook
2023-03-13 07:32:57 -03:00
Sergio Cazzolato
2b216dea76 Fixes ans less noise the vm preparation 2023-03-07 12:20:21 -03:00
Sergio Cazzolato
29983d8599 Merge remote-tracking branch 'upstream/master' into tests-update-nested-tests-again-p1 2023-02-18 15:48:32 -03:00
Sergio Cazzolato
0072b47919 The file to remove signature could not exist
We should not fail in that case
2023-01-12 13:36:16 -03:00
Sergio Cazzolato
758bc611aa Improvements for nested tests - part 1
This is the first part of the improvements done for nested tests.

It includes:
. new remote.wait-for tool
. several improvements to muinstaller tests
. new secboot-remove-signature command
. other small changes
2023-01-11 15:49:32 -03:00
Sergio Cazzolato
f62601a27e Cleanup the tests environment to avoid dirty tests directory
Some tests are failing because there are some directories which contain
snaps before the execution.

This is mostly for the first test executed, which contained many snaps
and directories created while the test suite is prepared.

The change cleans correctly the suite preaparation and moved the extra
tests directory to /tmp for the same raeson.
2023-01-09 13:27:04 -03:00
Michael Vogt
f16116628c configcore: add option to set service.ssh.listen-address (#12303)
This new config option allows setting the listen-address that the ssh
daemon listens to.

Note that this option is only available on UC20+ systems because
to work during first boot it needs to write a default configuration
into the `/etc/ssh/sshd_config.d` directory. This directory is
only available in UC20+ versions of ssh.

The configuration of ssh option is more flexible by using
`service.ssh.listen-address` which allows to specify:

1. hostname or IP
2. hostname or IP with port
3. port only (via :port syntax)

E.g.
```
$ snap set system system service.ssh.listen-port=:9022
$ snap set system system service.ssh.listen-port=hostname:9022
$ snap set system system service.ssh.listen-port=host1,host2
```
2022-12-15 09:15:57 +01:00
Valentin David
2497e6b41d tests: make tests.nested secboot-sign file remove all old signatures 2022-12-05 10:58:46 +01:00
Alfonso Sánchez-Beato
fcbb7a9641 tests/lib/nested.sh: reset swtpm in a safer way 2022-11-28 17:10:47 +01:00
Michael Vogt
5a402875c7 tests: add new fakeinstaller-real test and update fakeinstaller 2022-11-28 17:10:47 +01:00
Sergio Cazzolato
0b1f986432 Adding configuration for google-nested-dev 2022-10-13 15:16:26 -03:00
Sergio Cazzolato
cb14736615 Merge remote-tracking branch 'upstream/master' into tests-speedup-nested-tests 2022-10-13 09:26:01 -03:00
Sergio Cazzolato
606f5692b6 Merge pull request #12190 from sergiocazzolato/tests-add-commandline-to-nested
tests: new variable used to configure the kernel command line in nested tests
2022-10-13 08:52:24 -03:00
Sergio Cazzolato
48027bf8c0 Fix shellcheck 2022-10-12 22:18:14 -03:00
Sergio Cazzolato
e298b3511e Reduce memory and cpu to the initial values 2022-10-12 18:42:54 -03:00
Sergio Cazzolato
e184805854 Save snaps generated during image praparation 2022-10-12 17:43:28 -03:00