Skip to content

tests/nested: add a daily desktop TPM autoinstall test - #17887

Draft
ernestl wants to merge 1 commit into
canonical:masterfrom
ernestl:ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test
Draft

ernestl wants to merge 1 commit into
canonical:masterfrom
ernestl:ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test

Conversation

@ernestl

@ernestl ernestl commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Install the 26.04 daily desktop image with Subiquity in a nested QEMU guest, then boot the installed system over SSH. The outer sequence matches the muinstaller hybrid tests: a blank disk on the spread worker, enrolled OVMF variables, a virtual TPM, install, power off, then boot that disk again with the firmware and TPM state kept. Where those tests run the muinstaller snap over SSH, tests.nested create-vm installer boots the desktop ISO. Classic and core VM startup are unchanged.

The ISO is the installer CD. A second SCSI CD is the autoinstall seed, a small NoCloud image labeled cidata. It holds the answers: user, SSH, power-off, and the hybrid TPM storage layout from tests/lib/nested/autoinstall-tpmfde.yaml, including the running-in-vm exception. Subiquity writes the installed system into ubuntu-desktop-installed.img on the worker. After power-off, that same file is the boot disk and both CDs are gone.

The seed copies the installer log to the guest serial console while the installer runs. A clean power-off is still success. The test fails as soon as that log reports an installer error, and if the log stops moving for 20 minutes.

Guest checks match the encrypted muinstaller case: storage-encrypted status active, the FDE marker, and ubuntu-data-enc as LUKS. The task runs only on ubuntu-26.04-64.

NESTED_UBUNTU_DESKTOP_ISO_URL replaces the daily image URL. NESTED_DESKTOP_SOURCE_ID replaces the autoinstall source id.

@github-actions github-actions Bot added the Run only one system Only runs spread tests on one system label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Fri Oct 30 08:45:45 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/41013553262

Test Predictor Analysis

Preparing

Test Success %
openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:create_write_write_same_path_single_deny 🟢 100.0%
openstack:ubuntu-24.04-64:tests/main/snap-delta 🟡 30.0%
openstack:ubuntu-24.04-64:tests/regression/lp-1871652 🟢 99.7%
openstack-ext:ubuntu-18.04-64:tests/nested/classic/hotplug 🟡 33.4%
openstack-ext:ubuntu-18.04-64:tests/nested/classic/snapshots-with-core-refresh-revert 🔴 23.9%
openstack-ext:ubuntu-20.04-64:tests/nested/manual/cmdline-option:signed 🟢 99.6%
openstack-ext:ubuntu-20.04-64:tests/nested/manual/seed-refresh-back-to-revision:refresh_app 🟢 99.6%
openstack-ext:ubuntu-20.04-64:tests/nested/manual/snapd-removes-vulnerable-snap-confine-revs:snapd 🟢 99.6%
openstack-ext:ubuntu-20.04-64:tests/nested/manual/uc-update-assets-secure-add-sbat:both 🟢 99.6%
openstack-ext:ubuntu-20.04-64:tests/nested/manual/uc-update-assets-secure-add-sbat:seed 🟢 99.3%
openstack-ext:ubuntu-20.04-64:tests/nested/manual/uc20-install-in-initrd:both 🟢 99.7%
openstack-ext:ubuntu-22.04-64:tests/nested/manual/core20-gadget-cloud-conf:signed 🟢 99.6%
openstack-ext:ubuntu-22.04-64:tests/nested/manual/uc-update-assets-secure-add-sbat:boot 🟢 99.5%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/core-recover-from-recovery:clear_tpm 🟢 99.2%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/core20-fault-inject-on-remodel:gadget_panic_remodel_boot_assets 🟢 99.4%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/core20-grade-signed-above-testkeys-boot:signed 🟢 99.3%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/core20-set-efi-boot-vars:UBUNTUDIR_NOSEC 🟢 99.4%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/install-device-hostname 🟢 99.0%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/minimal-smoke:secboot_enabled 🟢 99.4%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/seed-refresh-no-space 🟢 82.1%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/seeding-failure 🟢 99.4%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/uc-update-assets-secure:boot 🟢 95.6%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/uc-update-command-line-secure 🟢 91.9%
openstack-ext:ubuntu-26.04-64:tests/nested/manual/fde-auth-support-on-hybrid:pin 🟢 99.6%

Executing

Test Success %
openstack:ubuntu-24.04-64:tests/main/snap-info-components 🟢 100.0%
openstack-ext:ubuntu-20.04-64:tests/nested/core/core20-fault-inject-on-refresh:kernel_panic_refresh_gadget_assets 🟢 100.0%
openstack-ext:ubuntu-20.04-64:tests/nested/manual/core20-preseed 🟢 98.9%
openstack-ext:ubuntu-20.04-64:tests/nested/manual/minimal-smoke:secboot_enabled 🟡 37.5%
openstack-ext:ubuntu-20.04-64:tests/nested/manual/remodel-offline:local_and_installed_snaps 🟢 99.0%
openstack-ext:ubuntu-20.04-64:tests/nested/manual/update-snapd-seed-and-factory-reset:tpm 🟡 34.3%
openstack-ext:ubuntu-22.04-64:tests/nested/manual/minimal-smoke:secboot_disabled 🟢 91.6%
openstack-ext:ubuntu-22.04-64:tests/nested/manual/minimal-smoke:secboot_enabled 🟡 30.3%
openstack-ext:ubuntu-22.04-64:tests/nested/manual/muinstaller 🟢 99.1%
openstack-ext:ubuntu-24.04-64:tests/nested/core/core20-fault-inject 🟢 100.0%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/core-factory-reset-new-secboot:hook 🟢 100.0%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/hybrid-remodel 🟢 82.3%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/remodel-min-size 🟢 96.3%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/seed-refresh-back-to-revision:refresh_kernel 🟢 74.4%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/seed-refresh-component:optional_in_seed_snap_component_exclusive 🟢 96.3%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/uc-grub-boot-chains 🟢 95.5%
openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-degraded 🟡 32.4%
openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-factory-reset:fde 🟡 36.5%
openstack-ext:ubuntu-26.04-64:tests/nested/manual/fde-auth-support-on-hybrid:passphrase 🟢 78.7%
openstack-ext:ubuntu-26.04-64:tests/nested/manual/seed-refresh-back-to-revision:revert_gadget 🟢 100.0%

Restoring

Test Success %
openstack:ubuntu-24.04-64:tests/main/snapd-reexec:core 🟢 95.9%
openstack:ubuntu-24.04-64:tests/regression/lp-1871652 🟢 99.7%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/ 12 times 🟡 46.7%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/core-factory-reset-new-secboot:hook 🟢 100.0%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/core-recover-from-recovery:clear_tpm 🟢 90.0%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/core20-fault-inject-on-remodel:gadget_panic_remodel_boot_assets 🟢 99.4%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/core20-grade-signed-above-testkeys-boot:signed 🟢 100.0%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/hybrid-remodel 🟢 72.7%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/remodel-min-size 🟢 96.3%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/seed-refresh-back-to-revision:refresh_kernel 🟢 71.5%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/seed-refresh-component:optional_in_seed_snap_component_exclusive 🟢 96.3%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/seed-refresh-no-space 🟢 90.0%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/uc-grub-boot-chains 🟡 69.0%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/uc-update-assets-secure:boot 🟢 96.3%
openstack-ext:ubuntu-24.04-64:tests/nested/manual/uc-update-command-line-secure 🟢 96.3%
openstack-ext:ubuntu-26.04-64:tests/nested/manual/ 🟢 79.6%
openstack-ext:ubuntu-26.04-64:tests/nested/manual/fde-auth-support-on-hybrid:passphrase 🟢 98.8%

Skipped tests from snapd-testing-skip

If you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list of the below tests you wish to run (unskip plus test list must be valid yaml)

  • openstack:ubuntu-24.04-64:tests/main/i18n
  • openstack:ubuntu-24.04-64:tests/main/network-retry

@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch from 8743800 to 1fb6ca8 Compare October 28, 2026 19:41
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.09%. Comparing base (8d4d073) to head (2d36af3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17887      +/-   ##
==========================================
- Coverage   82.32%   82.09%   -0.24%     
==========================================
  Files        1418     1418              
  Lines      202384   202408      +24     
  Branches     2626     2626              
==========================================
- Hits       166619   166171     -448     
- Misses      33946    34014      +68     
- Partials     1819     2223     +404     
Flag Coverage Δ
unittests 82.09% <ø> (-0.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch 2 times, most recently from 4236675 to 4317344 Compare October 29, 2026 00:39
@ernestl ernestl added the Run nested The PR also runs tests inluded in nested suite label Oct 29, 2026
@ernestl ernestl closed this Oct 29, 2026
@ernestl ernestl reopened this Oct 29, 2026
@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch from 63b1ae1 to 512858f Compare October 29, 2026 15:24
Copilot AI balanced review requested due to automatic review settings October 29, 2026 15:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The unattended installation can stall because the ISO boot entry lacks the autoinstall kernel argument, and the encryption-status assertion incorrectly accepts inactive.

5 open issues
What changed in this PR

Adds a nested Ubuntu 26.04 daily desktop installation test to exercise TPM-backed disk encryption through Subiquity and verify the installed system over SSH.

Changes:

  • Adds an installer VM mode with ISO download, NoCloud seed generation, serial-log monitoring, and installed-disk boot.
  • Preserves firmware and TPM state between installation and the subsequent boot.
  • Adds checks for encryption status, the FDE marker, and the LUKS volume.
File Description
tests/​nested/​manual/​desktop-autoinstall/​task.yaml Defines the desktop installation test and encryption checks.
tests/​lib/​tools/​tests.nested Exposes the new installer VM mode.
tests/​lib/​nested/​qemu.sh Adds network, disk, and restart-policy overrides.
tests/​lib/​nested/​installer.sh Implements installer preparation, monitoring, and installed-system startup.
tests/​lib/​nested/​autoinstall-tpmfde.yaml Defines the hybrid TPM-encrypted storage layout.
tests/​lib/​nested.sh Loads the installer helpers.

Review effort: Balanced

Comment thread tests/lib/nested/installer.sh Outdated
Comment thread tests/lib/nested/installer.sh
Comment thread tests/nested/manual/desktop-autoinstall/task.yaml
Comment thread tests/nested/manual/desktop-autoinstall/task.yaml Outdated
Comment thread tests/nested/manual/desktop-autoinstall/task.yaml Outdated
@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch from 512858f to 93b4c64 Compare October 29, 2026 17:04
Copilot AI balanced review requested due to automatic review settings October 29, 2026 17:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The encryption check incorrectly accepts “inactive” as “active”, while log matching can trigger false failures and shadowed resource settings leave the VM underprovisioned.

5 open issues
1 resolved since last review

Review effort: Balanced

Comment thread tests/lib/nested/installer.sh Outdated
@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch from 93b4c64 to 8295d57 Compare October 29, 2026 17:15
Copilot AI balanced review requested due to automatic review settings October 29, 2026 17:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The installer can falsely abort successful installations by matching failure markers inside forwarded configuration, and the documented desktop image/source overrides are not passed into Spread workers.

4 open issues
3 resolved since last review

Review effort: Balanced

Comment thread tests/lib/nested/installer.sh Outdated
Comment thread tests/nested/manual/desktop-autoinstall/task.yaml
@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch from 8295d57 to a9f6b9e Compare October 29, 2026 17:40
Copilot AI balanced review requested due to automatic review settings October 29, 2026 17:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Failures from truncate and cloud-localds are masked by subsequent successful printf calls inside command substitutions, allowing QEMU to start with invalid disk or seed files instead of stopping at the creation error.

2 open issues
7 resolved since last review

Review effort: Balanced

Comment thread tests/lib/nested/installer.sh Outdated
Comment thread tests/lib/nested/installer.sh Outdated
@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch from a9f6b9e to 5905e25 Compare October 29, 2026 18:30
Copilot AI balanced review requested due to automatic review settings October 29, 2026 18:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The Subiquity flow still needs end-to-end validation of installation completion and encrypted reboot with preserved TPM/OVMF state, since supplied runtime evidence only confirms installation started.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@ernestl

ernestl commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

🔵 Needs a closer look

The Subiquity flow still needs end-to-end validation of installation completion and encrypted reboot with preserved TPM/OVMF state, since supplied runtime evidence only confirms installation started.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

The test does check installation completion and encryption. Success is the installer powering off, then a second boot of the same disk with the OVMF variables and TPM state kept. After SSH comes up, the task requires storage-encrypted status "active", the FDE marker, and ubuntu-data-enc as LUKS. A full run has not reached those checks yet: the local boot was stopped once curtin started extracting, and earlier CI runs stopped before power-off.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

End-to-end Spread validation is still needed to confirm encryption checks and TPM unsealing after a firmware-preserving reboot, since local validation only established curtin startup and the 8-GiB guest exceeds the configured workers’ memory.

No open issues 🎉

Review effort: Balanced

@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch from 5905e25 to ae9aed9 Compare October 29, 2026 20:13
Copilot AI balanced review requested due to automatic review settings October 29, 2026 20:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Static review cannot establish the two-phase flow’s compatibility without an end-to-end Ubuntu 26.04 run validating Subiquity installation, Secure Boot/TPM state preservation, and encrypted reboot across both QEMU launches.

No open issues 🎉

Review effort: Balanced

@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch from ae9aed9 to cb14e41 Compare October 29, 2026 20:48
Copilot AI balanced review requested due to automatic review settings October 29, 2026 20:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The live-snapd re-exec and two-phase Secure Boot/TPM flow require isolated end-to-end validation of both ISO and branch variants, since Subiquity runtime behavior and state across QEMU launches cannot be verified from this source snapshot.

No open issues 🎉

Review effort: Balanced

@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch from cb14e41 to ef7a6b9 Compare October 30, 2026 01:54
Copilot AI balanced review requested due to automatic review settings October 30, 2026 01:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Both ISO and branch variants require end-to-end nested-VM validation because the two-phase installer flow depends on live Subiquity behavior and retained TPM/UEFI state that this review environment cannot verify.

No open issues 🎉

Review effort: Balanced

@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch from ef7a6b9 to a9af2a0 Compare October 30, 2026 05:49
Copilot AI balanced review requested due to automatic review settings October 30, 2026 05:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The local result confirms only installer startup, leaving end-to-end validation of both ISO and branch variants—including TPM unsealing after the firmware-state-preserving reboot—unresolved.

No open issues 🎉

Review effort: Balanced

Boot the Ubuntu 26.04 desktop daily ISO in a nested QEMU guest so a
hybrid TPM-backed install can be reached over SSH. Reuse the existing
VM service so classic and core startup keep their command line.

Copy the installer log to the serial console and fail the wait when
that log reports an installer error, instead of waiting for a power-off
that never comes. Restart the live snapd with SNAPPY_TESTING=1 so the
secboot preinstall check permits a virtual machine, and confirm the
desktop prompt that firmware boot cannot skip. Return a failure from
disk, password, storage, and seed setup instead of continuing after a
command substitution hides it. The helper owns the autoinstall user-data
template and fills it. The test supplies the storage snippet, which the
helper inserts unchanged. The iso variant uses the image snapd. The
branch variant installs the snapd snap from this tree on the live system
and continues only after snapd re-execs. Give the guest 4096 MB so the
nested worker can allocate it.
@ernestl
ernestl force-pushed the ernestl/SNAPDENG-37872/add-subiquity-desktop-installer-test branch from a9af2a0 to 2d36af3 Compare October 30, 2026 06:20
Copilot AI balanced review requested due to automatic review settings October 30, 2026 06:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Both ISO and branch variants need isolated end-to-end validation across installation and reboot because static review cannot verify live snapd coordination, TPM/OVMF state preservation, and automatic disk unlock.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Run nested The PR also runs tests inluded in nested suite Run only one system Only runs spread tests on one system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants