700 Commits

Author SHA1 Message Date
Valentin David
150b66303b Add debug output for failing test 2022-07-28 13:05:10 +02:00
Valentin David
5d430a1705 tests: Also test with 4k logical block size 2022-07-28 13:05:08 +02:00
Sergio Cazzolato
7b3fffa5af Merge pull request #11987 from mvo5/tweak-nested-connections-test
tests: tweak the "tests/nested/manual/connections" test
2022-07-25 17:43:36 -03:00
Michael Vogt
65dd3ff769 tests: update "core20-boot-config-update" to match updated grub.cfg 2022-07-22 16:23:16 +02:00
Michael Vogt
323606ddc4 tests: add NESTED_IMAGE_ID to avoid re-using of an pre-existing image
Without NESTED_IMAGE_ID the `tests.nested build-image core` will
reuse already created images in a slightly naive way. It does
not take the model into account when calculating the name and
hence can reuse the wrong image. This lead to wrong results for
the `gadget-connections` test.
2022-07-22 16:14:56 +02:00
Michael Vogt
158091c424 tests: tweak the "tests/nested/manual/connections" test
The `tests/nested/manual/connections` is failing sometimes and
it's unclear why. When it fails it appears that the `connections`
snap is not installed which is strange given that it's clearly
needed in the model - as a consequence there are no connections
so the test fails.

To untangle this a bit this commit makes some changes to the test:
- rename to gadget-connections
- rename test snap from just "connections" to "tests-snapd-connections"
- rename the model from "pc" to "nested-20-amd64-test-snapd-connections"
- precondition checks that ensure we have the right model
- precondition checks that we have the expected test-snapd-connections
  snap
- move image building into "execute:" to ensure that on failure we get
  the shell log of how the image was build (this is lost if "prepare"
  bulds the image but the error happens in "execute").
2022-07-22 11:50:03 +02:00
Michael Vogt
b550491575 Merge remote-tracking branch 'upstream/master' into fix-core20-new-snapd-does-not-break-old-initrd-on-reboot 2022-07-21 20:20:03 +02:00
Michael Vogt
58615acd8a Merge pull request #11983 from mvo5/ubuntu-22.04-nested-core-save
tests: fix nested save-data test on 22.04
2022-07-21 20:19:31 +02:00
Michael Vogt
eb6eba7a6b tests: simplify by using blkid (thanks to Valentin) 2022-07-21 17:54:53 +02:00
Michael Vogt
e88d6bcccb tests: fix core20-new-snapd-does-not-break-old-initrd test
The nested `core20-new-snapd-does-not-break-old-initrd` installs
an old snapd and then refreshes to the new snapd and assume this
only causes a snapd restart. This assumption is incorrect, an
update like this can trigger a reboot if managed assets like
`grub.cfg` or the static commandline change. In this case a
full system reboot is performed.

This commit changes the code to deal with that by simply waiting
for the `snap install new-snapd.snap` to complete via `snap watch`
even if it take a reboot.
2022-07-21 15:33:08 +02:00
Michael Vogt
a841bc6114 tests: add debug: section to tests/nested/manual/connections
This test failed in spread with:
```
2022-07-20T15:05:25.9201971Z ##[error]2022-07-20 15:05:25 Error executing google-nested:ubuntu-20.04-64:tests/nested/manual/connections (jul201353-281932) :
...
2022-07-20T15:41:06.8471005Z + tests.nested exec 'snap connections'
2022-07-20T15:41:06.8471500Z + MATCH 'serial-port  *connections:serial-1  *pc:serial-1'
2022-07-20T15:41:06.8472066Z Warning: Permanently added '[localhost]:8022' (ECDSA) to the list of known hosts.
2022-07-20T15:41:06.8472463Z grep error: pattern not found, got:
2022-07-20T15:41:06.8472863Z -----
```

This is obscure, no output from the nested snap connections but
also no error. This commit adds a bit of debug info around this.
2022-07-20 18:31:26 +02:00
Michael Vogt
194985b9d2 tests: simplify environment test for save-data 2022-07-20 18:05:53 +02:00
Michael Vogt
d77656af64 tests: fix nested save-data test on 22.04
The output of `lsblk` apparently changed between 20.04 and 22.04.
But fortuantely because we are only interested in the LABEL in
this test the way it's run can be simplified a bit.
2022-07-20 18:05:49 +02:00
Michael Vogt
13f09d85ff Merge pull request #11958 from Meulengracht/feature/snap-ubuntu-save
overlord,snap: add support for per-snap storage on ubuntu-save
2022-07-15 20:35:36 +02:00
Michael Vogt
d97b61c909 nested: fix core-early-config nested test
The kernel is automatically handled by the nesting code so it's
actually harmful if the tests specifies it as it leads to the
kernel being specified twice on the commandline which breaks
ubuntu-image:
```
2022-07-14T23:58:23.7590500Z + /home/gopath/bin/ubuntu-image snap --image-size 10G /home/gopath/src/github.com/snapcore/snapd/tests/lib/assertions/nested-18-amd64.model --channel edge '' --output-dir /tmp/work-dir/images --snap /tmp/work-dir/assets/snapd-from-deb.snap --snap new-kernel.snap --snap /home/gopath/src/github.com/snapcore/snapd/tests/nested/manual/core-early-config/new-core18.snap --snap /home/gopath/src/github.com/snapcore/snapd/tests/nested/manual/core-early-config/extra-snaps/pc_104.snap --snap /home/gopath/src/github.com/snapcore/snapd/tests/nested/manual/core-early-config/extra-snaps/pc-kernel_1056.snap
2022-07-14T23:58:23.7592321Z WARNING: proceeding to download snaps ignoring validations, this default will change in the future. For now use --validation=enforce for validations to be taken into account, pass instead --validation=ignore to preserve current behavior going forward
2022-07-14T23:58:23.7593047Z Error: Error preparing image: local snap "pc-kernel" is repeated in options
```

This commit just removes the kernel part of the tests which is not
needed.
2022-07-15 10:58:57 +02:00
Michael Vogt
6cb635ca01 Merge pull request #11956 from sergiocazzolato/tests-fix-inclusive-namimg
tests: Update the whitebox word to avoid inclusive naming issues
2022-07-15 09:18:22 +02:00
Michael Vogt
764dbfa7ec Merge pull request #11909 from alfonsosanchezbeato/mount-gadget-in-run-folder
many: mount gadget in run folder
2022-07-15 09:16:07 +02:00
Philip Meulengracht
e29a9b5efa overlord/snapstate: review feedback
add extra test verifications, change os.Remove to os.RemoveAll
2022-07-15 09:12:26 +02:00
Sergio Cazzolato
458e8a40f0 Merge remote-tracking branch 'upstream/master' into tests-fix-inclusive-namimg 2022-07-14 17:15:00 -03:00
Sergio Cazzolato
d9dd2e2ffa tests: enable centos-9 (#11849)
* Initial changes to support centos-9

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 3b56339b88..9b7b4e9bf1

9b7b4e9bf1 Merge pull request #28 from snapcore/add-centos-9-support
7fe2087423 Add support for centos-9
64a830b933 Merge pull request #27 from snapcore/improve-log-analyzer
7fe27d4aea Improve log analyzer utility
207536268e Merge pull request #19 from snapcore/new-spread-manager
2f2ff2e282 Update spread manager to support csv
33a44ca3be Merge branch 'main' into new-spread-manager
b4654950d4 Merge pull request #26 from snapcore/support-csv-for-expressions
3250bbd885 Support expressions with comma separation
2540135b90 Merge pull request #25 from snapcore/add-indent-to-log-parser
2536b0f070 Minor improvements in log-parser and log-analyzer based con review comments
84dc8092b1 Merge pull request #24 from snapcore/improve-log-parser
515770b3bf Add support for fedora-35
875c29b5ce Updated results with latest log-parser changes
d27f2bcdb7 Fix log-parser
b2cce1fcce fix wording
14d15e4fe4 Fixes for log-parser and changes for log analyzer
438d92d241 Log analyzer updated to support reexecute in all the scenarios
1c9dff58ff Merge pull request #23 from snapcore/improve-log-parser
cc7ee488d1 Fix shellcheck
324b99e719 revert change in log-analyzer test
f746f40ebe Fix shellcheck
2d7dbbe1bd Fix spelling
728dd64c2c Last set of changes for log analizer tools
bf389dcd01 New fixes for log parses
6b2b56afc3 Fix another shellcheck
56163e170b Fix shellcheck
d96ab8094f Merge branch 'main' into new-spread-manager
60fb99f02f new dir task5
259a7e188c Fix spread test
e674234454 New spread-manager tool

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 9b7b4e9bf102d9520be02959b184ee09d4021ec7

* Adding centos-9 to workflow

* Skip centos-9 on some tests

* data/selinux: update the policy to allow snap to access openssl certificates

As observed in the spread tests:

type=AVC msg=audit(06/07/22 14:39:47.321:1164) : avc:  denied  { open } for
pid=47406 comm=snap path=/etc/pki/tls/openssl.cnf dev="sda2" ino=16781422
scontext=system_u:system_r:snappy_cli_t:s0 tcontext=system_u:object_r:cert_t:s0
tclass=file permissive=1

type=AVC msg=audit(06/07/22 14:39:47.321:1164) : avc:  denied  { read } for
pid=47406 comm=snap name=openssl.cnf dev="sda2" ino=16781422
scontext=system_u:system_r:snappy_cli_t:s0 tcontext=system_u:object_r:cert_t:s0
tclass=file permissive=1

type=AVC msg=audit(06/07/22 14:39:47.321:1164) : avc: denied { search } for
pid=47406 comm=snap name=pki dev="sda2" ino=50341780
scontext=system_u:system_r:snappy_cli_t:s0 tcontext=system_u:object_r:cert_t:s0
tclass=dir permissive=1

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>

* Work around the snap version unknown issue

* Revert chnage to  force mkversion for centos-9

* Change spec used to build centos

In centos 9 if we use the spec "$packaging_path/snapd.spec" them
rpmbuild takes the packages from $packaging_path

* sources are also built from rpm_dir

* Updaing spec to support rhel 9

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 9b7b4e9bf1..54909c304d

54909c304d Merge pull request #29 from snapcore/udpate-os-query-new-systems
cc1729c2f4 preserve size for amazon-linux
bb3d8db60e preserve size for centos
d1089d5ce3 Fixing the tests
47793a6465 Fix auto-merge problem
f50be4ac5e Merge branch 'main' into udpate-os-query-new-systems
1a40a224c9 os.query tool cli simplified

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 54909c304ddbe284ee49142d3247aeb7876d1feb

* Update os.query uses following changes in the cli

* Skip test on centos-9

* fix os.query usage

* Skip rhbz-1708991 on centos-9

* Fix os.query error in tests

Co-authored-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-07-14 00:22:15 -03:00
Sergio Cazzolato
c62cfc33a0 Merge remote-tracking branch 'upstream/master' into tests-fix-inclusive-namimg 2022-07-14 00:18:34 -03:00
Alfonso Sánchez-Beato
56187a6665 Merge branch 'master' into mount-gadget-in-run-folder 2022-07-13 09:13:21 +01:00
Michael Vogt
31a431ec5a Merge pull request #11099 from alfonsosanchezbeato/add-grub-fallback
bootloader/assets: add fallback entry to grub.cfg
2022-07-13 09:53:24 +02:00
Philip Meulengracht
e0e08aeb31 overlord/snapstate,snap/snapenv: review feedback
fixes to tests and new unit test
2022-07-13 09:28:33 +02:00
Philip Meulengracht
0ab459d0c5 tests/nested/core/save-data: cleanup spread test 2022-07-13 09:28:30 +02:00