From patchwork Thu May 7 22:14:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2290 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1778192146; bh=iiqYV4SKW2bHlAPo1VITV48Z4UirBoUqVatfra5FT8Q=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=N3kk1URqU897KEnQ2hZd7ZnDIzXsPyWN6Cq9UUOSI99aL/R8/xifuI4Id3VE1awLE XKz0hHpc0v4WQBx1c2wNNeQXAucdDvkqiG4d1LOuIE+2aGtVr7igUzCbCCSpczVdPL wfDP0ibKgZFLaZv9N8FZ8m5HGbF/JPToT+pzoP2k= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 70B1D6A959 for ; Thu, 7 May 2026 16:15:46 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id YnExvM7vXfld for ; Thu, 7 May 2026 16:15:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1778192146; bh=iiqYV4SKW2bHlAPo1VITV48Z4UirBoUqVatfra5FT8Q=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=N3kk1URqU897KEnQ2hZd7ZnDIzXsPyWN6Cq9UUOSI99aL/R8/xifuI4Id3VE1awLE XKz0hHpc0v4WQBx1c2wNNeQXAucdDvkqiG4d1LOuIE+2aGtVr7igUzCbCCSpczVdPL wfDP0ibKgZFLaZv9N8FZ8m5HGbF/JPToT+pzoP2k= Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5D8536A9A5 for ; Thu, 7 May 2026 16:15:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1778192144; bh=ZPTX9NbkD7FVlCguxxzxAOUvcAjljWmoeStrTcRFbTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=spDCyHF+Nl3GE2qjVCLmkTVOYITSVo95Yu+EQ7rXH85lCHxkcesUD/urbQQHz8QA4 x2HUodsgtQcZBT0VOCQ166BGxjm493VVHl65b3ZHqQ3fJ/RSgBgJJOAoK2zp0lZOga z1aA3N4xr/Jip5znWOMGiTLMHbSTXC4V/ZzpQ9zo= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 860276A9A5; Thu, 7 May 2026 16:15:44 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id y7hPuCHZjOx2; Thu, 7 May 2026 16:15:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1778192137; bh=Z3S1wlZCtYFn5g6DaE6tD4kbkmH/Ksy6H3mz9cLR79c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nC9dQe2CUkzN2+kd6gLDvs0YaFUhwtj2KpJJeAC9gPL/eb81BB4O/g+ViAuB+eqgq mCVIfqtUO//V7UHLc2VfoDFozv+2HOMuCzh27oe0OK134u2xTkXNgwrqEx78bGNs7F OgUdmAp3A0j9l7m0Qp9t79cFe5/AcX3aWTAyaTNY= Received: from u-boot.org (unknown [174.51.25.52]) by mail.u-boot.org (Postfix) with ESMTPSA id 613A36A959; Thu, 7 May 2026 16:15:37 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 7 May 2026 16:14:57 -0600 Message-ID: <20260507221507.505998-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221507.505998-1-sjg@u-boot.org> References: <20260507221507.505998-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NICBF4U5VZBCTM2XQN35D7H46UVGIF4K X-Message-ID-Hash: NICBF4U5VZBCTM2XQN35D7H46UVGIF4K X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/13] test/py: distro: Add test_distro_ubuntu_iso_install List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The existing test_distro_ubuntu_iso_uboot exercises the live-ISO path only. It leaves the post-install half of the BLS wiring - the kernel-install plugin run by autoinstall late-commands and the first-boot systemd unit in the install squashfs - unverified. Add a companion test that drives the full unattended install. The test expects a role (efi-x86_64-uboot-iso-install) whose writer passes --autoinstall to scripts/ubuntu-iso-to-uboot.py and whose QEMU config attaches a blank target disk. It watches for: - U-Boot's BLS bootflow and the kernel's 'Linux version' line, confirming subiquity has been handed control - a subiquity reboot marker (or the kernel's reboot line) within a 45 minute window - a second BLS bootflow after reboot, this time picking up the /loader/entries/ kernel-install has written onto the installed ESP rather than the ISO's casper entry - a getty 'login: ' prompt on ttyS0, so the test only passes once the installed system is actually up Signed-off-by: Simon Glass --- test/py/tests/test_distro.py | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/test/py/tests/test_distro.py b/test/py/tests/test_distro.py index ed3f6d86249..6acc4c200b5 100644 --- a/test/py/tests/test_distro.py +++ b/test/py/tests/test_distro.py @@ -99,6 +99,59 @@ def test_distro_arm_app_extlinux(ubman): ubman.restart_uboot() +@pytest.mark.boardspec('efi-x86_app64') +@pytest.mark.role('efi-x86_64-uboot-iso-install') +@pytest.mark.restart +def test_distro_ubuntu_iso_install(ubman): + """Run an unattended Ubuntu install through U-Boot + BLS. + + Needs a role whose UBootWriterDriver passes --autoinstall to + scripts/ubuntu-iso-to-uboot.py and whose QEMU config attaches a blank virtio + disk as the install target. The rewritten ISO boots straight into subiquity + (autoinstall on the BLS cmdline), subiquity partitions the target disk and + installs Ubuntu, then kernel-install populates /boot/loader/entries/ on the + installed ESP. On reboot, OVMF hands control back to U-Boot (still living on + the ISO ESP), whose BOOTMETH_BLS picks up the new entries from the installed + disk and boots that system. + """ + with ubman.log.section('boot-installer'): + with ubman.temporary_timeout(120 * 1000): + ubman.run_command('boot', wait_for_prompt=False) + ubman.expect([r"Booting bootflow '[^']+' with bls"]) + ubman.expect(['Linux version']) + + # Subiquity sends its reporting events through journald; with + # forward_to_console=1 on the cmdline they appear on ttyS0. Each event is + # logged as 'start: : ' (or 'finish: ...'), so wait for + # the start of the curtin_install step, which follows partitioning and + # marks the point where curtin begins copying the system to disk. + with ubman.log.section('subiquity-install'): + with ubman.temporary_timeout(10 * 60 * 1000): + ubman.expect( + [r'start: +subiquity/Install/install/curtin_install:']) + + # The clean end-of-install marker: subiquity finishes, systemd tears the + # session down and the kernel prints 'Restarting system' on the way out. + # 'quiet' has been stripped so this is visible. + with ubman.log.section('subiquity-reboot'): + with ubman.temporary_timeout(45 * 60 * 1000): + ubman.expect([r'reboot: Restarting system']) + + # After reboot OVMF re-runs U-Boot from the ISO ESP. BLS now sees the + # installed disk's /loader/entries/ and should pick the newly written entry + # rather than the ISO's casper one. + with ubman.log.section('boot-installed'): + with ubman.temporary_timeout(300 * 1000): + ubman.expect([r"Booting bootflow '[^']+' with bls"]) + ubman.expect(['Linux version']) + + with ubman.log.section('installed-ubuntu'): + with ubman.temporary_timeout(300 * 1000): + ubman.expect([r' login: ']) + + ubman.restart_uboot() + + @pytest.mark.boardspec('efi-x86_app64') @pytest.mark.role('efi-x86_64-uboot-iso') @pytest.mark.restart