Skip to content

Commit

Permalink
tests: fixes for fde and devmode-snap-seeded-dangerous nested tests (#…
Browse files Browse the repository at this point in the history
…14301)

* tests: fixes for fde and devmode-snap-seeded-dangerous nested tests

This change renames models used for fde tests
Also adapt some nested tests to run in uc24

* revert change related to ubuntu-seed

* fix shellcheck errors

* more fixes for boot dir

* remove support for uc24 on fde-on-classic test

* fix hybrid-remodel test

the test still fails because of this issue
https://paste.ubuntu.com/p/gZvZRtvjTz/

* updating classic models to use pc-kernel from beta by default

* download 23.10 pc snap for uc22 in hybrid-remodel test
  • Loading branch information
sergiocazzolato authored Aug 9, 2024
1 parent cec484a commit 18a9ada
Show file tree
Hide file tree
Showing 21 changed files with 265 additions and 643 deletions.
44 changes: 44 additions & 0 deletions tests/lib/assertions/classic-model-22.assert
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
type: model
authority-id: test-snapd
series: 16
brand-id: test-snapd
model: ubuntu-core-22-pc-amd64
architecture: amd64
base: core22
classic: true
distribution: ubuntu
grade: dangerous
serial-authority:
- generic
snaps:
-
default-channel: 22/edge
name: pc
type: gadget
-
default-channel: 22/beta
name: pc-kernel
type: kernel
-
default-channel: latest/edge
id: amcUKQILKXHHTlmSa7NMdnXSx02dNeeT
name: core22
type: base
-
default-channel: latest/edge
id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4
name: snapd
type: snapd
timestamp: 2023-11-09T07:50:10+00:00
sign-key-sha3-384: 7qWG-Uwck6Dji43a3Z8ZZrm7rAziZAch3xf76iFvqe4GaD0LI7U9lYPWMSJAsEgu

AcLBcwQAAQoAHRYhBGESvKlz1RXG1IBOC0MdJKf2hr9ABQJmtOLMAAoJEEMdJKf2hr9A7rIP/38k
2dG1jeI9RgPN0nKEE/fbYqD0SxrKhiPqTWsiQOXWqcp9ywgSAF7mTF9m2OaLPWtitnkH6QGXdZk/
7thgrUZU441oqF/EbLVd6nJWRyjZWr6FWDRYWr6Qe1Y/Ebx6+OubFrLBL1a/FVDWcatce+Es2JVX
nxFOGgvF3kDF/Tmzy116bgnsi/sP6U/v+dPYLfjEEzV9aLLYqj43cbkVsD8n6tx1DhpVslM6XT1y
qaBCiwMJRIb3uxYs4wo2bAILjN0WYHxzlaUVsDO2FPl4V9HOuVhYb6SFXrBsgPEYwch8P4GPldgW
LO3Hwoplv22AIL+MVG3rOR8XmBrfyKcwkl3iQWriJ+i5U1vI/8sNmO5oLFxQN+Y14AYa9NbOdtlm
8sh9c9ENE3je36asp7OJZOBAZEEJGcx7p2dD7FD58ne2kisdga3VnDfIHE7RAGcbRubLKhYnzPWR
W6ALKwesPEbfJ6kSoxdHH0EjUxCM9/rESrJ8STH/85yjs7VNp1CTojWiZGq5Z3dTe68yJFRisdgs
WhOcBzy5e9WHWywUjHAOt/Vw+/sDiplxdtvueLjySqWskFpN5l2wU0O6DeK0ioPL1yR8VRLsBkJa
0JtRutlDcS0W90b6SOj+QLVL9yGGuKc/zu25N3TOiZD6rKxpiBNYiRWVjVjn6zLzjCjRjsf5
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{
"name": "pc-kernel",
"type": "kernel",
"default-channel": "22/edge"
"default-channel": "22/beta"
},
{
"name": "core22",
Expand Down
44 changes: 44 additions & 0 deletions tests/lib/assertions/classic-model-24.assert
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
type: model
authority-id: test-snapd
series: 16
brand-id: test-snapd
model: ubuntu-core-24-pc-amd64
architecture: amd64
base: core24
classic: true
distribution: ubuntu
grade: dangerous
serial-authority:
- generic
snaps:
-
default-channel: 24/edge
name: pc
type: gadget
-
default-channel: 24/beta
name: pc-kernel
type: kernel
-
default-channel: latest/edge
id: dwTAh7MZZ01zyriOZErqd1JynQLiOGvM
name: core24
type: base
-
default-channel: latest/edge
id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4
name: snapd
type: snapd
timestamp: 2024-08-02T00:00:00+00:00
sign-key-sha3-384: 7qWG-Uwck6Dji43a3Z8ZZrm7rAziZAch3xf76iFvqe4GaD0LI7U9lYPWMSJAsEgu

AcLBcwQAAQoAHRYhBGESvKlz1RXG1IBOC0MdJKf2hr9ABQJmtOLnAAoJEEMdJKf2hr9ABGMP+QHw
q7J7KLiz/slrwelWmxzJE8m+odTK23ttFXB5da5UKjFOnpMdY0ZgWDGAPW/d1r3/T8+agsPYGMhM
EyP0YNaVEhbAoZqd2jrFYPO2185zOtTtpsunnrGklfJv9YhMbXj3qfuSDnzZyKfBbiVMrfcHRV8y
4EksSGfTE4vvlsqcg4dNnwpRoNEKcGzmaHExS+nOWVV88VxmzpJVc4UCDRV3bTeAEGQ0O1OQ48we
7Ke8+z+LD46hj7uSCyCtLFxFNWpnTQYdnA/8oJFPZ3+5DIFtgatFqjMONMNZWbSOB1e1eMzIFD97
9/ilLi14VGBAAB3ULotauYA/hb+YG7f5bZ14/gUyWjaVglsiUZFeHs22uPpEdgrjVQfbMujL8pJN
hrdb5d8BFkduvNhh/PbbTwalhP5xCE5dWHeec2IVAYgHFI03yX/9jR4x4ddjwNYwo9em2Iu0t0aE
LvGEjOz6+yPBHWpICRjvapa1hcUMnmWIpsp082bxOjLgKq68NnplHt/fZ4f4DDKETUCvxyIAEQZ8
75IJvZLg5CJt5cmeJHUE5w0pA//jQv1pTA6PjJ7kLfZZgnDtufHfqcQdGpgtarI3MkWK5vNqhk1m
z0HPYp1oZpHUq/vxW7MzHtCpHGQ4jHncAc/5ecyIJVFb9dqxnZZWzaAogYXrGOrfdCBQmSeh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"series": "16",
"authority-id": "<YOUR_ID_HERE>",
"brand-id": "<YOUR_ID_HERE>",
"model": "ubuntu-core-22-pc-amd64",
"model": "ubuntu-core-24-pc-amd64",
"architecture": "amd64",
"timestamp": "2022-03-31T12:00:00.0Z",
"base": "core22",
"timestamp": "2024-08-02T00:00:00+00:00",
"base": "core24",
"grade": "dangerous",
"classic": "true",
"distribution": "ubuntu",
Expand All @@ -17,18 +17,18 @@
{
"name": "pc",
"type": "gadget",
"default-channel": "22/edge"
"default-channel": "24/edge"
},
{
"name": "pc-kernel",
"type": "kernel",
"default-channel": "22/edge"
"default-channel": "24/beta"
},
{
"name": "core22",
"name": "core24",
"type": "base",
"default-channel": "latest/edge",
"id": "amcUKQILKXHHTlmSa7NMdnXSx02dNeeT"
"id": "dwTAh7MZZ01zyriOZErqd1JynQLiOGvM"
},
{
"name": "snapd",
Expand All @@ -37,4 +37,4 @@
"id": "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4"
}
]
}
}
50 changes: 50 additions & 0 deletions tests/lib/assertions/classic-model-rev1-24.assert
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
type: model
authority-id: test-snapd
revision: 1
series: 16
brand-id: test-snapd
model: ubuntu-core-24-pc-amd64
architecture: amd64
base: core24
classic: true
distribution: ubuntu
grade: dangerous
serial-authority:
- generic
snaps:
-
default-channel: 24/edge
name: pc
type: gadget
-
default-channel: 24-hwe/stable
name: pc-kernel
type: kernel
-
default-channel: latest/stable
id: dwTAh7MZZ01zyriOZErqd1JynQLiOGvM
name: core24
type: base
-
default-channel: latest/edge
id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4
name: snapd
type: snapd
-
default-channel: latest/edge
id: zBAzEImJzOAoGxmoG5o6Tl6ELZXMeUlt
name: test-snapd-jq-core24
type: app
timestamp: 2024-08-02T00:00:00+00:00
sign-key-sha3-384: 7qWG-Uwck6Dji43a3Z8ZZrm7rAziZAch3xf76iFvqe4GaD0LI7U9lYPWMSJAsEgu

AcLBcwQAAQoAHRYhBGESvKlz1RXG1IBOC0MdJKf2hr9ABQJmrOmQAAoJEEMdJKf2hr9A5l0P/iJF
deI0WrNF6njZqlaFMGGO1yKlqpZGedZI7M4qV3y0nFMCrFILxvlNevY2YYEFdtODvz5ZfEJZmg9w
J+ddyLeHb0Igd30u/DUxjBrxEW4coFNImVkJAqpNp1w3E/YNUBFwiMg2eadEBM6rkKEf+E3hkPql
UivLKoaXZ2CMHlqFHW34bFMDhj1NdE9AUx077lTyy8Qc+Q/XNOy1Ybq3ldqgTvTdT6yxBXpQvHNH
4nC5J/B3l/NXGVBdPYmvncZcHsNpREzTMmhu4rADqpPtweXtAV7r0Hqc9TcrvRb/VOwYerIOTIA+
N0GQ5bxGUnRng900aOAtHIiAqME6LvTDCZVcfC3HBKtIFgM7b254eFslvLRLFJCELDen3+kEXBj0
PVp1bKOd+ZExM8vKj18h+pfn/Ahy7PkzSqJLI4PvDOdiSx6GbbVoZCVgSrX3cgK2XQu181vJPlu+
m55JaYAgHYwM0am6Fn+VyQfqPu471X7z3g0+kCCCN7Vb46VsZ6JRhqP/L2nkcyZhHrBtU4a1q8GN
Qj3GpsnqCzGbLgCbzg/XjSJ6QsneLtWxdXHS6ozDNis3QsCCttkKiFo4tQh2wBRlnsMauoo91TQn
a5TuoLKppJPcbTZHFvsApQHSwGalogt7x/oYhJrH5493Ta66XivTixFf9prjS3o0HOwnMhEV
47 changes: 47 additions & 0 deletions tests/lib/assertions/classic-model-rev1-24.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"type": "model",
"series": "16",
"authority-id": "test-snapd",
"brand-id": "test-snapd",
"model": "ubuntu-core-24-pc-amd64",
"architecture": "amd64",
"timestamp": "2024-08-02T00:00:00+00:00",
"base": "core24",
"grade": "dangerous",
"classic": "true",
"distribution": "ubuntu",
"revision": "1",
"serial-authority": [
"generic"
],
"snaps": [
{
"name": "pc",
"type": "gadget",
"default-channel": "24/edge"
},
{
"name": "pc-kernel",
"type": "kernel",
"default-channel": "24-hwe/stable"
},
{
"name": "core24",
"type": "base",
"default-channel": "latest/stable",
"id": "dwTAh7MZZ01zyriOZErqd1JynQLiOGvM"
},
{
"name": "snapd",
"type": "snapd",
"default-channel": "latest/edge",
"id": "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4"
},
{
"default-channel": "latest/edge",
"id": "zBAzEImJzOAoGxmoG5o6Tl6ELZXMeUlt",
"name": "test-snapd-jq-core24",
"type": "app"
}
]
}
44 changes: 0 additions & 44 deletions tests/lib/assertions/classic-model.assert

This file was deleted.

4 changes: 2 additions & 2 deletions tests/lib/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ build_snapd_snap() {
if ! [ -f "${snap}" ]; then
if [ "${USE_PREBUILT_SNAPD_SNAP}" = true ]; then
if [ -n "${USE_SNAPD_SNAP_URL}" ]; then
wget "$USE_SNAPD_SNAP_URL" -O "${snapd_snap_cache}/snapd_from_ci.snap"
wget -q "$USE_SNAPD_SNAP_URL" -O "${snapd_snap_cache}/snapd_from_ci.snap"
else
cp "${PROJECT_PATH}/built-snap"/snapd_1337.*.snap.keep "${snapd_snap_cache}/snapd_from_ci.snap"
fi
Expand Down Expand Up @@ -531,7 +531,7 @@ build_snapd_snap_with_run_mode_firstboot_tweaks() {

if [ "${USE_PREBUILT_SNAPD_SNAP}" = true ]; then
if [ -n "${USE_SNAPD_SNAP_URL}" ]; then
wget "$USE_SNAPD_SNAP_URL" -O /tmp/snapd_from_snapcraft.snap
wget -q "$USE_SNAPD_SNAP_URL" -O /tmp/snapd_from_snapcraft.snap
else
cp "${PROJECT_PATH}/built-snap"/snapd_1337.*.snap.keep "/tmp/snapd_from_snapcraft.snap"
fi
Expand Down
2 changes: 1 addition & 1 deletion tests/main/mkimage-uc22/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ prepare: |
SNAP_DEB_PARAM="--snapd-deb $PROJECT_PATH/../$SNAPD_DEB"
fi
# shellcheck disable=SC2086
"$TESTSTOOLS"/mkimage-uc22 --base-dir "$PWD" --snap pc_x1.snap $SNAP_DEB_PARAM "$TESTSLIB"/assertions/classic-model.assert
"$TESTSTOOLS"/mkimage-uc22 --base-dir "$PWD" --snap pc_x1.snap $SNAP_DEB_PARAM "$TESTSLIB"/assertions/classic-model-22.assert
tests.pkgs install qemu qemu-utils genisoimage sshpass qemu-kvm cloud-image-utils ovmf kpartx cpu-checker
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: test-snapd-devmode-core24
version: 1.0
base: core24
summary: Basic core24 snap with devmode confinement
description: A basic buildable snap that asks for devmode confinement
confinement: devmode
apps:
test-snapd-devmode-core24:
command: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

true
44 changes: 0 additions & 44 deletions tests/nested/manual/fde-on-classic/classic-model.assert

This file was deleted.

Loading

0 comments on commit 18a9ada

Please sign in to comment.