From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790071758; cv=none; d=zohomail.com; s=zohoarc; b=O5LFBy49kElD+Fvnr0fltld2BIONiUiRgKRxzY0goQ/fEpNYV638hjDMIkEstPFvcxkvRGEbwP0SyeDxm6kIliDn3BDfvH7yGkUfN/r93uEG+5gfceFht4tNEcsSDX61Lxwel2arpCkyFo6W1HpdTg40up5kqN4pMxfg6iB9O6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790071758; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H/MbAY1eGqbTAnphWhom0M3ym5qcu8LUIEqlrx+aImc=; b=eQ+IXLbRafrNrGDSLSO4m+YVjEfcZgoVicyHDQ/5jLVUAN8FVVAX6P3wU5ggCDegXcGsspUJX0jhboQKSqaLhGWZS03v0BjlggcVbKcvSp9RDZXjhVVaP2VTL245ypHbBn5SIVMl5YTVzS5MIA+vnHyevu5WIZuY404ZfxgdvyQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790071758683876.1626043682974; Tue, 22 Sep 2026 03:09:18 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428467.1651302 (Exim 4.92) (envelope-from ) id 1x8xQv-0006Or-Fz; Tue, 22 Sep 2026 10:09:05 +0000 Received: by outflank-mailman (output) from mailman id 1428467.1651302; Tue, 22 Sep 2026 10:09:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xQv-0006Ok-DM; Tue, 22 Sep 2026 10:09:05 +0000 Received: by outflank-mailman (input) for mailman id 1428467; Tue, 22 Sep 2026 10:09:04 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xQu-0006Ga-Fs for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:09:04 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xQt-00Ao1x-2c; Tue, 22 Sep 2026 10:09:04 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xQu-00DE8C-12; Tue, 22 Sep 2026 10:09:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=H/MbAY1eGqbTAnphWhom0M3ym5qcu8LUIEqlrx+aImc=; b=JM9IUQ4VbldbOLucyunP3iJ5F/ VR5KVOpiwzw5fjUPZtqXz+w+aZhSRvxNauAJ6yFShHcpXsehCPo2BL/mApqJ5FiO9alKYYb9ltQ2h AL17E26dztPG+ZWB3IUbGcakTknoXvAzQtEEeUOXqpnh6jm4TzGlfPMFxvxMOGKrYmK4=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 01/13] pytest: Add fixture to prepare rootfs Date: Tue, 22 Sep 2026 12:08:48 +0200 Message-ID: <20260922100900.29129-2-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790071761761158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD It's slyghtly more complicated than the QubeOS's test script as we try here to create a small rootfs with just enough for setting up the network, then once Linux is booted we load the rest, that is Xen's toolstack. Loading the full rootfs at netboot on the moonshot takes more than 10 minutes, while download it once Linux is booted is much faster. The network configuration should be flexible enough, we can select static IP or DHCP, and setup VLAN if needed. I've mainly only tested static IP + VLAN. Signed-off-by: Anthony PERARD --- automation/pytest/lib/__init__.py | 0 automation/pytest/lib/boot_binary.py | 212 +++++++++++++++++++++++++++ automation/pytest/test_boot.py | 32 ++++ 3 files changed, 244 insertions(+) create mode 100644 automation/pytest/lib/__init__.py create mode 100644 automation/pytest/lib/boot_binary.py create mode 100644 automation/pytest/test_boot.py diff --git a/automation/pytest/lib/__init__.py b/automation/pytest/lib/__in= it__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/automation/pytest/lib/boot_binary.py b/automation/pytest/lib/b= oot_binary.py new file mode 100644 index 000000000000..d8f503ead9f2 --- /dev/null +++ b/automation/pytest/lib/boot_binary.py @@ -0,0 +1,212 @@ +from pathlib import Path +import shlex +import stat +import subprocess +from textwrap import dedent + + +def cpio_archive_from_dir(root: Path, output: Path) -> None: + subprocess.run(f"find . | cpio -H newc --owner=3D0:0 -o | gzip >> {out= put}", + shell=3DTrue, + cwd=3Droot, + check=3DTrue) + + +def concatenate_cpios(archives: list[Path], output: Path) -> None: + paths =3D shlex.join([str(p) for p in archives]) + subprocess.run(f"cat {paths} > {output}", + shell=3DTrue, + check=3DTrue) + + +class BootBinary: + def __init__(self, tmp_path: Path, xenroot: Path, + pxe_host: str, + http_pxe_path: str, + vlan_id: int | None =3D None, + static_ip: str | None =3D None, + static_gateway: str | None =3D None, + static_dns: str | None =3D None, + static_ipv6: str | None =3D None, + boot_script: str | None =3D None, + ) -> None: + self.vlan_id =3D vlan_id + self.pxe_host =3D pxe_host + self.http_pxe_path =3D http_pxe_path + self.static_ip =3D static_ip + self.static_gateway =3D static_gateway + self.static_dns =3D static_dns + self.static_ipv6 =3D static_ipv6 + self.boot_script =3D boot_script + + # Minimal rootfs + rootfs_path =3D tmp_path / "rootfs_minimal" + rootfs_path.mkdir() + self.prepare_minimal_rootfs(rootfs_path, xenroot) + self.rootfs_dir =3D rootfs_path + + # Rootfs for dom0 + rootfs_path =3D tmp_path / "rootfs_dom0" + rootfs_path.mkdir() + self.prepare_dom0_rootfs(rootfs_path, xenroot) + self.rootfs_dom0_dir =3D rootfs_path + + + def prepare_minimal_rootfs(self, rootfs_path: Path, xenroot: Path) -> = None: + script_pre_xen =3D dedent(f"""\ + #!/bin/ash + set -xe + + wget http://{self.pxe_host}/{self.http_pxe_path}/dom0-rootfs.c= pio.gz -O /root/dom0-rootfs.cpio.gz + cd / + gzip -d < /root/dom0-rootfs.cpio.gz | while cpio -iu; do :; do= ne + /etc/local.d/xen.start + """) + + bridge_port =3D "eth0" + cfg_vlan =3D "" + if self.vlan_id: + bridge_port =3D f"eth0.{self.vlan_id}" + cfg_vlan =3D f"""\ + auto {bridge_port} + iface {bridge_port} inet manual + vlan-raw-device eth0 + # Remove all ipv6 route, they are duplicates from + # the one added to the bridge interface + post-up ip -6 route flush dev $IFACE + """ + + cfg_addr =3D "" + if self.static_ip and self.static_gateway: + cfg_addr =3D f"""\ + use static + address {self.static_ip} + gateway {self.static_gateway} + """ + else: + cfg_addr =3D """\ + use dhcp + """ + + if self.static_ip and not self.static_gateway: + cfg_addr +=3D f"""\ + address {self.static_ip} + """ + + cfg_addr_v6 =3D "" + if self.static_ipv6: + cfg_addr_v6 =3D f"""\ + address {self.static_ipv6} + """ + + network_interfaces =3D dedent(f"""\ + {cfg_vlan} + + auto xenbr0 + iface xenbr0 + {cfg_addr} + bridge-ports {bridge_port} + bridge-stp 0 + {cfg_addr_v6} + """) + + etc_networkd_d =3D rootfs_path / "etc/network" + etc_networkd_d.mkdir(parents=3DTrue) + (etc_networkd_d / "interfaces").write_text(network_interfaces) + + # if static + if self.static_dns: + dns_config =3D dedent(f"""\ + nameserver {self.static_dns} + """) + (rootfs_path / "etc/resolv.conf").write_text(dns_config) + + # rc-update add networking boot + runlevel_boot_d =3D rootfs_path / "etc/runlevels/boot" + runlevel_boot_d.mkdir(parents=3DTrue) + (runlevel_boot_d / "networking").symlink_to("/etc/init.d/networkin= g") + + local_d_dir =3D rootfs_path / "etc/local.d" + local_d_dir.mkdir(parents=3DTrue) + + pre_xen_start_script =3D local_d_dir / "pre-xen.start" + pre_xen_start_script.write_text(script_pre_xen) + pre_xen_start_script.chmod(stat.S_IRUSR | stat.S_IXUSR) + + # rootfs archive + rootfs =3D [] + # Uncompressed first! Then compressed cpio archives! + rootfs.append(xenroot / "binaries/ucode.cpio") + rootfs.append(xenroot / "binaries/rootfs.cpio.gz") + cpio_rootfs =3D xenroot / "binaries/pre-dom0-rootfs.cpio.gz" + concatenate_cpios(rootfs, cpio_rootfs) + cpio_archive_from_dir(rootfs_path, cpio_rootfs) + + self.minimal_rootfs =3D cpio_rootfs + + def prepare_dom0_rootfs(self, rootfs_path: Path, xenroot: Path) -> Non= e: + etc =3D rootfs_path / "etc" + etc.mkdir() + + local_d_dir =3D etc / "local.d" + local_d_dir.mkdir() + + script_xen =3D dedent("""\ + #!/bin/bash + + bash /etc/init.d/xencommons start + """) + if self.boot_script: + script_xen +=3D self.boot_script + + xen_start_script =3D local_d_dir / "xen.start" + xen_start_script.write_text(script_xen) + xen_start_script.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) + + etc_default =3D etc / "default" + etc_default.mkdir() + + xencommons_default =3D etc_default / "xencommons" + xencommons_default.write_text(dedent(""" + XENCONSOLED_TRACE=3Dall + QEMU_XEN=3D/bin/false + """)) + + (rootfs_path / "var/log/xen/console").mkdir(parents=3DTrue) + + root_home_dir =3D rootfs_path / "root" + root_home_dir.mkdir(parents=3DTrue) + run_tool_tests_script =3D xenroot / "automation/scripts/run-tools-= tests" + run_tool_tests_script.copy_into(root_home_dir, preserve_metadata= =3DTrue) + + # VM config file + etc_xen =3D etc / "xen" + etc_xen.mkdir() + domU_type =3D "hvm" + domU_vif =3D "'bridge=3Dxenbr0'" + (etc_xen / "domU.cfg").write_text(dedent(f"""\ + type =3D '{domU_type}' + name =3D 'domU' + kernel =3D '/boot/vmlinuz-domU' + ramdisk =3D '/boot/initrd-domU' + cmdline =3D 'root=3D/dev/ram0 console=3Dhvc0' + memory =3D 512 + vif =3D [ {domU_vif} ] + disk =3D [ ] + """)) + + # rootfs archive + rootfs_dom0 =3D [] + # Uncompressed first! Then compressed cpio archives! + rootfs_dom0.append(xenroot / "binaries/xen-tools.cpio.gz") + cpio_rootfs =3D xenroot / "binaries/dom0-rootfs.cpio.gz" + concatenate_cpios(rootfs_dom0, cpio_rootfs) + cpio_archive_from_dir(rootfs_path, cpio_rootfs) + + self.xen_tools_rootfs =3D cpio_rootfs + + def minimal(self) -> Path: + return self.minimal_rootfs + + def dom0_tools(self) -> Path: + return self.xen_tools_rootfs diff --git a/automation/pytest/test_boot.py b/automation/pytest/test_boot.py new file mode 100644 index 000000000000..230cee96d0ba --- /dev/null +++ b/automation/pytest/test_boot.py @@ -0,0 +1,32 @@ +import os +from pathlib import Path +import pytest + +from lib.boot_binary import BootBinary + + +@pytest.fixture +def xenroot_path() -> Path: + return Path("../..").resolve() + + +@pytest.fixture +def prepare_rootfs(tmp_path: Path, + xenroot_path: Path, + ) -> BootBinary: + static_gateway =3D os.environ['HOST_IP_GATEWAY'] + http_pxe_path =3D os.environ["PXE_HTTP_PATH"] + + boot_script =3D f"echo Dom0 ready\n" + + return BootBinary(tmp_path, + xenroot_path, + vlan_id=3Dint(os.environ['HOST_IP_VLANID']), + pxe_host=3Dos.environ["PXE_HOST"], + http_pxe_path=3Dhttp_pxe_path, + static_ip=3Dos.environ['HOST_IP4'], + static_gateway=3Dstatic_gateway, + static_dns=3Dstatic_gateway, + static_ipv6=3Dos.environ['HOST_IP6'], + boot_script=3Dboot_script, + ) --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790071769; cv=none; d=zohomail.com; s=zohoarc; b=hbGgbzeeM3vzYp7Bt2cyd7qS0zcmb4NLPUb2CwZ9P8321Mg+UVi7lZhp53p4hF06+7bEbhN0y2AWUW6IoytBWy9y0sN9EFlZImbwJmc62l2C7Ir94yY3m+u5+fsc83g/CJdylXSxjujlv4b5m5LD6ra+UpDPmr1/HrdhxA0XmfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790071769; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wrPZcuAXdEWAGjj1WBjrDx+MHluEOn4L26I9H5HEfgg=; b=njmg9EyhnNt/FLbmX1zRwiSpBv0SyH49YoaBbIAnNxvcNIBcz2F1JbMjyYIP3qRFFt/rRNBPVzATcdoL5jS+ALsf6EZy+5/C+2zTgxmTGxpkucA3Qc9anXO5/IExb6HMxCXxJ0/xrDX8kqnZeIlJnaqamx6QvqxumPmkDiOD17I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790071769780613.7633791419007; Tue, 22 Sep 2026 03:09:29 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428468.1651310 (Exim 4.92) (envelope-from ) id 1x8xQw-0006bz-PO; Tue, 22 Sep 2026 10:09:06 +0000 Received: by outflank-mailman (output) from mailman id 1428468.1651310; Tue, 22 Sep 2026 10:09:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xQw-0006bs-Ma; Tue, 22 Sep 2026 10:09:06 +0000 Received: by outflank-mailman (input) for mailman id 1428468; Tue, 22 Sep 2026 10:09:05 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xQv-0006RK-Kc for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:09:05 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xQu-00Ao27-32; Tue, 22 Sep 2026 10:09:05 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xQv-00DE8C-1U; Tue, 22 Sep 2026 10:09:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=wrPZcuAXdEWAGjj1WBjrDx+MHluEOn4L26I9H5HEfgg=; b=RrHt68DlEjnQipELy4DNLB4DSZ iJTE8QgWyM+nniSfSwx/2H/NSiPan0CdGuvHLMTMwdKduhk6usdCgSfw99/W2Rf/DOME4EDP/Fp3g yBI0U7bsBM30s5zar9dNwtvCdyvHjKgHE9YSoOmKDeAuLPnACDqrEsHa5zBBkiFePfhM=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 02/13] Creating new python project Date: Tue, 22 Sep 2026 12:08:49 +0200 Message-ID: <20260922100900.29129-3-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790071770795158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD This can by use by `uv` for example. Signed-off-by: Anthony PERARD --- uv run mypy . --- automation/pytest/pyproject.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 automation/pytest/pyproject.toml diff --git a/automation/pytest/pyproject.toml b/automation/pytest/pyproject= .toml new file mode 100644 index 000000000000..3180b2555029 --- /dev/null +++ b/automation/pytest/pyproject.toml @@ -0,0 +1,12 @@ +[project] +name =3D "xen-ci-intree" +version =3D "0.1.0" +requires-python =3D ">=3D3.14" +dependencies =3D [ + "pip>=3D26.0.1", + "pytest>=3D9.0.2", +] +[dependency-groups] +dev =3D [ + "mypy", +] --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790071765; cv=none; d=zohomail.com; s=zohoarc; b=W7gJN+TgMK31YeiEIzsbcLrG7dgsK4SG7wUeDuUbGBw4Vmgdw8rptagBjU2DZUDlomTqDSlaAzMwo+6Tepd1cFfQrPm9DOecaQYzoZvIO7BF6h0Ctlyy7j7Z5co6QiU3KuDbeGm5e6dUyllCR7gELyDxLicEsJY+FrBQacwYuls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790071765; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=m5pcMrpsVzkcznQskoFs5fpPn/HZg88On5QggZelYuc=; b=H6j4S9cu6xTo31E1S0sUwkqGUsM+M0hVCgGt35EkPrNd0lh4AoZXcNzwsWUogIQ85a/w0MzLewJn0lvVAg5FFvYvNtaZDJA2jaEdIfmk4nd0axBqRfuMaE641NRrtiQCE7UJaK/o/R94s1Z7T+GqlepGN78BtczMWXxKTOPz/tk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790071765094238.94785964392509; Tue, 22 Sep 2026 03:09:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428469.1651320 (Exim 4.92) (envelope-from ) id 1x8xQy-0006ot-0D; Tue, 22 Sep 2026 10:09:08 +0000 Received: by outflank-mailman (output) from mailman id 1428469.1651320; Tue, 22 Sep 2026 10:09:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xQx-0006om-TJ; Tue, 22 Sep 2026 10:09:07 +0000 Received: by outflank-mailman (input) for mailman id 1428469; Tue, 22 Sep 2026 10:09:06 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xQw-0006bn-Ix for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:09:06 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xQw-00Ao2I-0I; Tue, 22 Sep 2026 10:09:06 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xQw-00DE8C-1x; Tue, 22 Sep 2026 10:09:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=m5pcMrpsVzkcznQskoFs5fpPn/HZg88On5QggZelYuc=; b=mEhbB726wfIqB6nZLNEs7MDb20 xL/TX3pqFrZvTHl9dSnWWgRJO8h4r2fDOf2Nn/cmNWNn9Ve5+TWp4HCv6fhlusZhHADnYzqiPBKgv I567QOvIddWZM/x/Aps+0K3r3nkmgTyK1Y9+xIJTXv8H1ZXag+Vp0lev7wDetSCQblCY=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 03/13] pytest: Add fixture to prepare the tftp server Date: Tue, 22 Sep 2026 12:08:50 +0200 Message-ID: <20260922100900.29129-4-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790071766871158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD Prepare the netboot config, and upload the necessary files. Signed-off-by: Anthony PERARD --- automation/pytest/lib/net_boot.py | 60 +++++++++++++++++++++++++++++++ automation/pytest/pyproject.toml | 2 ++ automation/pytest/test_boot.py | 11 ++++++ 3 files changed, 73 insertions(+) create mode 100644 automation/pytest/lib/net_boot.py diff --git a/automation/pytest/lib/net_boot.py b/automation/pytest/lib/net_= boot.py new file mode 100644 index 000000000000..50d2cfaa5aaa --- /dev/null +++ b/automation/pytest/lib/net_boot.py @@ -0,0 +1,60 @@ +import io +import logging +import os +import paramiko +from pathlib import Path +import textwrap + + +class NetBoot: + def grub_script(self) -> str: + http_pxe_path =3D os.environ['PXE_HTTP_PATH'] + tftp_path =3D f"(http)/{http_pxe_path}" + console_opts =3D "console=3Dvga,com1" + + xen_cmdline_opts =3D [ + console_opts, + "loglvl=3Dall", + "guest_loglvl=3Dall", + "dom0_mem=3D4G", + "console_timestamps=3Dboot", + "watchdog", + "noreboot", + ] + xen_cmdline =3D " ".join(xen_cmdline_opts) + linux_cmdline =3D "console=3Dhvc0 root=3D/dev/ram0 earlyprintk=3Dx= en" + script =3D textwrap.dedent(f"""\ + echo \"Loading xen\" + multiboot2 {tftp_path}/xen {xen_cmdline} + echo \"Loading vmlinuz\" + module2 {tftp_path}/bzImage {linux_cmdline} + echo \"Loading initrd\" + module2 --nounzip {tftp_path}/pre-dom0-rootfs.cpio.gz + echo \"Booting\" + boot + """) + + return script + + def prepare_tftp(self, xenroot: Path, rootfss: list[Path]) -> None: + username =3D os.environ['PXE_SSH_USER'] + hostname =3D os.environ['PXE_HOST'] + remote_path =3D Path(os.environ['PXE_SSH_PATH']) + + binaries_path =3D xenroot / "binaries" + binaries =3D [] + for b1 in ["xen", "bzImage"]: + binaries.append(binaries_path / b1) + binaries +=3D rootfss + + ssh =3D paramiko.client.SSHClient() + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + ssh.connect(hostname, username=3Dusername) + with ssh.open_sftp() as sftp: + for b2 in binaries: + logging.debug(f" put {b2}, to {remote_path / b2.name}") + sftp.put(str(b2), str(remote_path / b2.name), confirm=3DTr= ue) + grub_script =3D io.BytesIO(self.grub_script().encode('utf-8')) + sftp.putfo(grub_script, str(remote_path / "grub.cfg"), + confirm=3DTrue) + ssh.close() diff --git a/automation/pytest/pyproject.toml b/automation/pytest/pyproject= .toml index 3180b2555029..78f60c4f8e77 100644 --- a/automation/pytest/pyproject.toml +++ b/automation/pytest/pyproject.toml @@ -3,8 +3,10 @@ name =3D "xen-ci-intree" version =3D "0.1.0" requires-python =3D ">=3D3.14" dependencies =3D [ + "paramiko>=3D4.0.0", "pip>=3D26.0.1", "pytest>=3D9.0.2", + "types-paramiko>=3D4.0.0.20260322", ] [dependency-groups] dev =3D [ diff --git a/automation/pytest/test_boot.py b/automation/pytest/test_boot.py index 230cee96d0ba..661c2a59e4fe 100644 --- a/automation/pytest/test_boot.py +++ b/automation/pytest/test_boot.py @@ -3,6 +3,7 @@ from pathlib import Path import pytest =20 from lib.boot_binary import BootBinary +from lib.net_boot import NetBoot =20 =20 @pytest.fixture @@ -30,3 +31,13 @@ def prepare_rootfs(tmp_path: Path, static_ipv6=3Dos.environ['HOST_IP6'], boot_script=3Dboot_script, ) + + +@pytest.fixture +def prepare_netboot(prepare_rootfs: BootBinary, xenroot_path: Path) -> Non= e: + netboot =3D NetBoot() + rootfs_paths =3D [ + prepare_rootfs.minimal(), + prepare_rootfs.dom0_tools(), + ] + netboot.prepare_tftp(xenroot_path, rootfs_paths) --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790071770; cv=none; d=zohomail.com; s=zohoarc; b=T1LO51exj9C7TTbNJ7MYfetwOetJgxJXfDZZjyJ7k09QuuBn+0skSpEuRtVdLjiNsXzmQ9r/rCk4Gu278YXIK72fs1ku+T6Zhl6EPoGTBH1672KQ/+TtzNYrUtVFnItei2v0d7tiRJnTC3NukrIxUxGKh92jUqOngmng1ItPMKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790071770; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EZSW/BF9mMmUonbwLJFPmPKsbgF7MFx2YuFv+VyC5TQ=; b=lbpkmN4YHmfJ3ekCYVG56w+2JSweD1Gbx00Q1brQRcqQrondYsAiBjgZNIql8pE0lByPe8543OUgMBy1zYFIEVjayAsSjgqWG2WrHSPcyC8MRcszWlar3onsPN+XmGAbWFjh80T09l1vgPlWxftdCBqqdLdu+t0fQgT6IpDGO4g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790071770519125.28896516530699; Tue, 22 Sep 2026 03:09:30 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428470.1651328 (Exim 4.92) (envelope-from ) id 1x8xQz-00071n-72; Tue, 22 Sep 2026 10:09:09 +0000 Received: by outflank-mailman (output) from mailman id 1428470.1651328; Tue, 22 Sep 2026 10:09:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xQz-00071e-4U; Tue, 22 Sep 2026 10:09:09 +0000 Received: by outflank-mailman (input) for mailman id 1428470; Tue, 22 Sep 2026 10:09:07 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xQx-0006oL-Ln for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:09:07 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xQx-00Ao2U-0j; Tue, 22 Sep 2026 10:09:07 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xQx-00DE8C-2R; Tue, 22 Sep 2026 10:09:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=EZSW/BF9mMmUonbwLJFPmPKsbgF7MFx2YuFv+VyC5TQ=; b=SzR99WPYlckt9ZceJ+XwhMyLb8 lcFIIs0ULG/7EnPojaqbf/pRVOT83KtjZxhTTIWGg/IKbhq3pCrlcjOSb+CWbq0hTRb4yEYxGwvkj QLHV1dPx7mduE+5CsaMusYwyMVVNeYhChsH42NNBIIdTuchCe2DKoKG5QOntx/vUWrNk=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 04/13] pytest: Add fixture that boot a machine Date: Tue, 22 Sep 2026 12:08:51 +0200 Message-ID: <20260922100900.29129-5-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790071770893158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD .. and power it off once a test using the fixture is done. This IPMI class is using the `ssh` console of an HP Moonshot 1500 Chassis. Signed-off-by: Anthony PERARD --- Maybe we could rename the class to Machine as a lib to control the machine behavior, and access it's console. --- automation/pytest/lib/ipmi.py | 69 ++++++++++++++++++++++++++++++++++ automation/pytest/test_boot.py | 17 +++++++++ 2 files changed, 86 insertions(+) create mode 100644 automation/pytest/lib/ipmi.py diff --git a/automation/pytest/lib/ipmi.py b/automation/pytest/lib/ipmi.py new file mode 100644 index 000000000000..0d3b085f704c --- /dev/null +++ b/automation/pytest/lib/ipmi.py @@ -0,0 +1,69 @@ +import logging +import paramiko +import re + + +class IPMI: + def __init__(self, *, + hostname: str, + username: str, + password: str, + blade_node: str, + ) -> None: + self.hostname =3D hostname + self.username =3D username + self.password =3D password + self.blade_node =3D blade_node + + self.channel =3D None + + def _new_client(self): + ssh =3D paramiko.client.SSHClient() + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + ssh.connect(self.hostname, + username=3Dself.username, + password=3Dself.password) + return ssh + + def _run_cmd(self, command: str, debug_print: bool =3D True) -> str: + with self._new_client() as ssh: + stdin, stdout, stderr =3D ssh.exec_command(command) + output =3D stdout.read().decode() + if debug_print: + for line in output.splitlines(): + if line in ['']: + continue + logging.debug(line.rstrip()) + # the command's exit status (0 =3D success, 1 =3D failure) + # stdout.channel.recv_exit_status() + return output + + def _power(self, state: str) -> None: + assert state in ["on", "off force"] + logging.info(f"Set power {state.split(' ')[0]} {self.blade_node}") + command =3D f"set node power {state} {self.blade_node}" + output =3D self._run_cmd(command, debug_print=3DFalse) + m =3D re.search(f"{self.blade_node}: #Node 1 (.*)\\r$", + output, + flags=3Dre.M) + if m: + logging.info(f"-> {m[1]}") + else: + logging.warning(f"Failed to parse 'set power' command output: = '{output}'") + + def power_status(self): + command =3D f"show node power {self.blade_node}" + output =3D self._run_cmd(command, debug_print=3DFalse) + m =3D re.search(f"{self.blade_node}: #Node 1\\r\\n\\s+Power State:= (\\S+)\\r$", + output, + flags=3Dre.M) + if m: + logging.info(f"Machine is {m[1]}") + else: + logging.warning(f"Failed to match for \"Power State\" in '{out= put}'") + + def power_on(self): + self._power('on') + + def power_off(self): + self._power('off force') diff --git a/automation/pytest/test_boot.py b/automation/pytest/test_boot.py index 661c2a59e4fe..b7610736fa25 100644 --- a/automation/pytest/test_boot.py +++ b/automation/pytest/test_boot.py @@ -1,9 +1,11 @@ import os from pathlib import Path import pytest +from typing import Generator =20 from lib.boot_binary import BootBinary from lib.net_boot import NetBoot +from lib.ipmi import IPMI =20 =20 @pytest.fixture @@ -41,3 +43,18 @@ def prepare_netboot(prepare_rootfs: BootBinary, xenroot_= path: Path) -> None: prepare_rootfs.dom0_tools(), ] netboot.prepare_tftp(xenroot_path, rootfs_paths) + + +@pytest.fixture +def machine_on_ipmi(prepare_netboot: None) -> Generator[IPMI]: + ipmi =3D IPMI( + hostname=3Dos.environ['IPMI_HOSTNAME'], + username=3Dos.environ['MOON_CONSOLE_USER'], + password=3Dos.environ['MOON_CONSOLE_PASS'], + blade_node=3Dos.environ['IPMI_BLADE_NODE'], + ) + ipmi.power_off() + ipmi.power_status() + ipmi.power_on() + yield ipmi + ipmi.power_off() --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790071767; cv=none; d=zohomail.com; s=zohoarc; b=SrQCr9qDxNA3s2mWtvyj0qWG8GbNKGJ3RZUzrBPN+8LDzDkTr4w18RR86PhhDp+9lqY5Z/bOkfk2CbXkBO0S1ECtXqgkg8SJNP1uaFnu5RCMxXP+gucWPCEX9QN3xERZDvJ3hhczmx8MyCEAlnRlRElNm8bAO9/fqeRfLDbrZTs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790071767; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=E1LH+34AS/zTBhZzWE2Tec45KIoMgC4W9seEEpRboRo=; b=fbqD9PH8a+YPdeB2UvOWSnlRhZxHD95dO7OR40CbokRrRz8pv4sX6s/bWdojP0d3u0dqe4ERtPBSLdhRDAa4Oawxe3fXPlcR/71B9XDjN7eXYqGXavgx0d4FEpEAumBbEReIFptAYltrROGR5GkwTadeBe5nvI21yLpsoAYXfcc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790071767828910.762897700994; Tue, 22 Sep 2026 03:09:27 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428471.1651337 (Exim 4.92) (envelope-from ) id 1x8xR0-0007EX-DY; Tue, 22 Sep 2026 10:09:10 +0000 Received: by outflank-mailman (output) from mailman id 1428471.1651337; Tue, 22 Sep 2026 10:09:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xR0-0007EQ-Am; Tue, 22 Sep 2026 10:09:10 +0000 Received: by outflank-mailman (input) for mailman id 1428471; Tue, 22 Sep 2026 10:09:08 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xQy-00070A-RU for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:09:08 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xQy-00Ao2h-1A; Tue, 22 Sep 2026 10:09:08 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xQy-00DE8C-2t; Tue, 22 Sep 2026 10:09:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=E1LH+34AS/zTBhZzWE2Tec45KIoMgC4W9seEEpRboRo=; b=1cnzPWZ/y+7519jE3Oa6zQtntx ftqwiO5uPq2hggQD2+YgnlQdwIbyt8rzCI62Tfcdc2EOSbMrY6YtjLlDgjiGEmroILcpROhKHV6ew KrkHL3ruS44zvUFx5fUvKWBa/Ok5Cv8byuIM29mR15hhSOg4PHXZ5tHNtoDCQqFm1Kx8=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 05/13] pytest: Introduce reading the console, and add a test Date: Tue, 22 Sep 2026 12:08:52 +0200 Message-ID: <20260922100900.29129-6-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790071768948158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD The test will do more than just checking dom0 booted in a later patch. Signed-off-by: Anthony PERARD --- automation/pytest/lib/ipmi.py | 86 ++++++++++++++++++++++++++++++++ automation/pytest/pyproject.toml | 1 + automation/pytest/test_boot.py | 24 +++++++++ 3 files changed, 111 insertions(+) diff --git a/automation/pytest/lib/ipmi.py b/automation/pytest/lib/ipmi.py index 0d3b085f704c..bda5d8077577 100644 --- a/automation/pytest/lib/ipmi.py +++ b/automation/pytest/lib/ipmi.py @@ -1,6 +1,8 @@ import logging import paramiko import re +import time +from typing import Generator =20 =20 class IPMI: @@ -67,3 +69,87 @@ class IPMI: =20 def power_off(self): self._power('off force') + + def get_console(self): + logging.info(f"Start console acquisition on {self.blade_node}") + ssh =3D self._new_client() + channel =3D ssh.invoke_shell() + + output =3D "" + logging.debug("wait for prompt") + while True: + if channel.recv_ready(): + output +=3D channel.recv(9999).decode('utf-8') + # wait for prompt + logging.debug(output) + if output.strip().endswith('hpiLO->'): + logging.debug("got prompt") + break + elif channel.exit_status_ready(): + raise Exception("Shell closed unexpectedly.") + else: + time.sleep(0.1) # Wait a bit for more output + + logging.debug("run connect node vsp acquire") + cmd =3D f"connect node vsp acquire {self.blade_node}\n" + channel.send(cmd) + + self.channel =3D channel + + def console_output_generator(self) -> Generator[str]: + if not self.channel: + raise Exception("Must call get_console") + channel =3D self.channel + previous_output =3D '' + # `count` when this reach 0, we had a line from the console that i= sn't + # finished, like a prompt, for sometime already, so display it in = the + # debug. + count =3D 0 + ansi_escape =3D re.compile(r''' + \x1B # ESC + (?: # 7-bit C1 Fe (except CSI) + [@-Z\\-_] + | # or [ for CSI, followed by a control sequence + \[ + [0-?]* # Parameter bytes + [ -/]* # Intermediate bytes + [@-~] # Final byte + ) + ''', re.VERBOSE) + while True: + if channel.recv_ready(): + output =3D previous_output + output +=3D channel.recv(9999).decode('utf-8') + output_lines =3D output.splitlines(keepends=3DTrue) + for line in output_lines[:-1]: + line =3D ansi_escape.sub('', line) + line =3D line.rstrip() + if line in ['', '\r', '\r\n']: + continue + logging.debug(line) + yield line + previous_output =3D output_lines[-1] + if previous_output.endswith('\n'): + line =3D previous_output + line =3D ansi_escape.sub('', line) + line =3D line.rstrip() + if line not in ['', '\r', '\r\n']: + logging.debug(line) + previous_output =3D '' + count =3D 0 + else: + count =3D 20 + # previous_output =3D output[-len(expect):] + # Check if the shell closed unexpectedly + elif channel.exit_status_ready(): + raise Exception("Shell closed unexpectedly.") + else: + if count > 1: + count -=3D 1 + elif count =3D=3D 1: + line =3D previous_output + line =3D ansi_escape.sub('', line) + if line not in ['\r']: + logging.debug("XXXXX output buffer: %s XXXXXX" % r= epr(line)) + count -=3D 1 + time.sleep(0.5) # Wait a bit for more output diff --git a/automation/pytest/pyproject.toml b/automation/pytest/pyproject= .toml index 78f60c4f8e77..4ab7094e0d84 100644 --- a/automation/pytest/pyproject.toml +++ b/automation/pytest/pyproject.toml @@ -6,6 +6,7 @@ dependencies =3D [ "paramiko>=3D4.0.0", "pip>=3D26.0.1", "pytest>=3D9.0.2", + "pytest-timeout>=3D2.4.0", "types-paramiko>=3D4.0.0.20260322", ] [dependency-groups] diff --git a/automation/pytest/test_boot.py b/automation/pytest/test_boot.py index b7610736fa25..158f1a30dcb6 100644 --- a/automation/pytest/test_boot.py +++ b/automation/pytest/test_boot.py @@ -1,3 +1,4 @@ +import logging import os from pathlib import Path import pytest @@ -53,8 +54,31 @@ def machine_on_ipmi(prepare_netboot: None) -> Generator[= IPMI]: password=3Dos.environ['MOON_CONSOLE_PASS'], blade_node=3Dos.environ['IPMI_BLADE_NODE'], ) + # start console + ipmi.get_console() ipmi.power_off() ipmi.power_status() ipmi.power_on() yield ipmi ipmi.power_off() + + +@pytest.mark.timeout(600) +def test_xen_tools_tests(machine_on_ipmi: IPMI, + ) -> None: + expect_string =3D "Dom0 ready" + for line in machine_on_ipmi.console_output_generator(): + # + # Wait for `expect_string` for the test to succeed + # + if expect_string in line: + logging.info(f"got expect_string '{line}'.") + break + # + # Some common expected or not console outputs. + # + if "Latest ChangeSet:" in line: + logging.info(f"Test xen build from '{line}'.") + if "Manual reset required ('noreboot' specified)" in line: + # Test failed, could wait a bit before failing the test. + logging.error("Xen panic") --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790071768; cv=none; d=zohomail.com; s=zohoarc; b=ka/tQF7QRXfjFdVaglwlw8+WRh+wS87gDu7IXqcYQ5PHz3HXETiqgFOkvL5/cdY4Fn6XPoxlK/nhOlgqANCV5HOI7JsuomcLXByL0I8iP/50M7UH7b0vilgwzEXdlsOfosY9Vk5vNA7N3B7GI+mlRluR8QTpiB6TZDqQudf8mlQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790071768; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/T7l5iO1dXbkzvS8G10wVZoy6AS2fih5DyiAKEvAhIQ=; b=aXHhNG7ljrAJNgmZcLGD0/bhJPSrbPCo/KaVRI1Vvtr1ECN5MN3rGN/ZbpelZSo+N5/in4t9JzWlSlw/nJUJymLuHD24TyQhUMQ0uznrA8cwzz6pXs6mJjKG2IhIYuFjhWdJTrqTcSVOjzV/og2j7FVQ7DnqDZtQD6dx7TMY9Fo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790071768893778.6541910091446; Tue, 22 Sep 2026 03:09:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428472.1651341 (Exim 4.92) (envelope-from ) id 1x8xR0-0007HF-LB; Tue, 22 Sep 2026 10:09:10 +0000 Received: by outflank-mailman (output) from mailman id 1428472.1651341; Tue, 22 Sep 2026 10:09:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xR0-0007H2-HR; Tue, 22 Sep 2026 10:09:10 +0000 Received: by outflank-mailman (input) for mailman id 1428472; Tue, 22 Sep 2026 10:09:10 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xR0-0007DN-1Y for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:09:10 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xQz-00Ao2s-1d; Tue, 22 Sep 2026 10:09:09 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xR0-00DE8C-09; Tue, 22 Sep 2026 10:09:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=/T7l5iO1dXbkzvS8G10wVZoy6AS2fih5DyiAKEvAhIQ=; b=Pu86ouqZl6A08svoclKdBsNkO2 +P0nYkh7Ox0AQavyyAE8PeEIadRCPrQNH41ihaK0yqpn44PKbgcnfJIBgQIc2gKSGBQQ/K01zY78g tgl09v+hEuPOgA1Cz6i1Nun3rrng1ZEsFa+zVtDcYlm8C+urc2iRP7Mv0aTbcCM36Kqc=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 06/13] We need an older version of paramiko. Date: Tue, 22 Sep 2026 12:08:53 +0200 Message-ID: <20260922100900.29129-7-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790071770798158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD To connect to the moonshot controller over ssh. Signed-off-by: Anthony PERARD --- automation/pytest/pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/automation/pytest/pyproject.toml b/automation/pytest/pyproject= .toml index 4ab7094e0d84..c54c1338f656 100644 --- a/automation/pytest/pyproject.toml +++ b/automation/pytest/pyproject.toml @@ -3,7 +3,8 @@ name =3D "xen-ci-intree" version =3D "0.1.0" requires-python =3D ">=3D3.14" dependencies =3D [ - "paramiko>=3D4.0.0", + # Need paramiko with support for SHA-1 key exchange + "paramiko<5.0.0", "pip>=3D26.0.1", "pytest>=3D9.0.2", "pytest-timeout>=3D2.4.0", --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790071764; cv=none; d=zohomail.com; s=zohoarc; b=UZRCxHee4QbtfgPQ9IHOVjOmhtSXEm1BbEyH9L0fgbLpCvB86e4wnyvymfhOjh/P5OBW1PM7VNwjLbbvCuSSQ8N1VYqepXvYqIjdhUMfpdHxNKyfC06fJvdvM9JuEdywwhtf+X7Jf6FlTFfcJPWuNrO+1rkxJSuwergYUmShXmM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790071764; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xsrfE5ntOSeufRj3RlZPqsn9RM3+8iFSAAGbkUyL2x4=; b=SuY6IjR4ngKH1/g/f8QSYVokq7p34uIZ/tNh+rXAkcCtMQD8LdCYpV1QXx9CZgtmZMlVWJ6pT8w0sKMI/26nI33sj8PnrIoNE+um/4PJTOpLwzpIkHYvPFMkEZQS/duuIkEF3YgWcKaD5r/ZIDhf4La93Gm6fq8ZnsUKDezD8FI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 179007176449896.69779028262747; Tue, 22 Sep 2026 03:09:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428473.1651356 (Exim 4.92) (envelope-from ) id 1x8xR1-0007e3-SH; Tue, 22 Sep 2026 10:09:11 +0000 Received: by outflank-mailman (output) from mailman id 1428473.1651356; Tue, 22 Sep 2026 10:09:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xR1-0007dw-PJ; Tue, 22 Sep 2026 10:09:11 +0000 Received: by outflank-mailman (input) for mailman id 1428473; Tue, 22 Sep 2026 10:09:11 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xR1-0007TP-2T for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:09:11 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xR0-00Ao33-25; Tue, 22 Sep 2026 10:09:10 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xR1-00DE8C-0c; Tue, 22 Sep 2026 10:09:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=xsrfE5ntOSeufRj3RlZPqsn9RM3+8iFSAAGbkUyL2x4=; b=F918OzmvRXBlx+JnVvgeFWjMcA yR9nA6x4lQJgt2XxFbxsDy9e920oXWwmXgiYmEWpWGwbr8Y0MfYyL37WTYPrVNfVDSE3S//hEz9RL gi6kqsjyaZIPdMPbhAQF2ghv37Ee29nggdHv3WCWe2FuEzXz3RoJyHcLs/bTq92dqaek=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 07/13] pytest: Add random string to look for in the logs Date: Tue, 22 Sep 2026 12:08:54 +0200 Message-ID: <20260922100900.29129-8-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790071766841158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD This allow to check that we are testing the expected rootfs. Signed-off-by: Anthony PERARD --- automation/pytest/test_boot.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/automation/pytest/test_boot.py b/automation/pytest/test_boot.py index 158f1a30dcb6..90d8e00e90d9 100644 --- a/automation/pytest/test_boot.py +++ b/automation/pytest/test_boot.py @@ -2,6 +2,8 @@ import logging import os from pathlib import Path import pytest +import random +import string from typing import Generator =20 from lib.boot_binary import BootBinary @@ -14,14 +16,20 @@ def xenroot_path() -> Path: return Path("../..").resolve() =20 =20 +@pytest.fixture +def boot_string() -> str: + return ''.join(random.choice(string.ascii_letters) for _ in range(16)) + + @pytest.fixture def prepare_rootfs(tmp_path: Path, xenroot_path: Path, + boot_string: str, ) -> BootBinary: static_gateway =3D os.environ['HOST_IP_GATEWAY'] http_pxe_path =3D os.environ["PXE_HTTP_PATH"] =20 - boot_script =3D f"echo Dom0 ready\n" + boot_script =3D f"echo Dom0 ready {boot_string}\n" =20 return BootBinary(tmp_path, xenroot_path, @@ -65,8 +73,9 @@ def machine_on_ipmi(prepare_netboot: None) -> Generator[I= PMI]: =20 @pytest.mark.timeout(600) def test_xen_tools_tests(machine_on_ipmi: IPMI, + boot_string: str, ) -> None: - expect_string =3D "Dom0 ready" + expect_string =3D boot_string for line in machine_on_ipmi.console_output_generator(): # # Wait for `expect_string` for the test to succeed --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790071775; cv=none; d=zohomail.com; s=zohoarc; b=AvvrQU2m7wxZgxplh99grIOiEFyZGfSr7E8bIVGaxWxJ0SxoEqCsadMrPADFv8BciWg2+GqaTPRghiLptFczJFeeXWtOWzvuLOhjg4jnRnIkyQXyA40LmeldzRPz2GfDidjE7+QFuU+dWD2iXT0wKPkoL5YU+DjsQq8LZ/hSdQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790071775; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Hwc7/siulS2GTqhirLoPBndfzFNCWOOcNc5vmaXH1ZA=; b=CQwAbTuejnyZ0Zgwy7/EaCLIQWPSN7YCbTf19k7fGgzS6TV/ofYO1vrQ3LfI9jmuJQ071aKZ8/HMdIzkcqVrbaNCokcHDlq0YtJ4dkMybYtvzdm+XbH+cjt/pNQcWjqUEfVguvgIaYr+fZLm58gVAky3j93i0nHI/GRMdTHZq60= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790071775177874.4734423484575; Tue, 22 Sep 2026 03:09:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428474.1651366 (Exim 4.92) (envelope-from ) id 1x8xR4-0007v1-CY; Tue, 22 Sep 2026 10:09:14 +0000 Received: by outflank-mailman (output) from mailman id 1428474.1651366; Tue, 22 Sep 2026 10:09:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xR4-0007um-6m; Tue, 22 Sep 2026 10:09:14 +0000 Received: by outflank-mailman (input) for mailman id 1428474; Tue, 22 Sep 2026 10:09:12 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xR2-0007kM-9U for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:09:12 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xR1-00Ao3C-2Y; Tue, 22 Sep 2026 10:09:12 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xR2-00DE8C-14; Tue, 22 Sep 2026 10:09:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=Hwc7/siulS2GTqhirLoPBndfzFNCWOOcNc5vmaXH1ZA=; b=2mE9f1d1Mlu7p1vVgKuzljZlyP DLxEvE+cnn2NRyKZm2pU7aalSuWQEuHOS013o0PFUuFg/9L1qZEmX87FbCQnvC7OUEXg6dSJDwqiL O2L4AAE0N7MO8ShiIrh4QRq29EHkFNA7qUOZnu97g4J8e7Y6IWF+AyJ2WQt5RqKY3bJs=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 08/13] pytest: Run run-tools-tests over ssh on the test machine Date: Tue, 22 Sep 2026 12:08:55 +0200 Message-ID: <20260922100900.29129-9-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790071776801158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD Add a new random ssh public key to the rootfs. Signed-off-by: Anthony PERARD --- automation/pytest/lib/boot_binary.py | 7 +++++ automation/pytest/test_boot.py | 39 ++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/automation/pytest/lib/boot_binary.py b/automation/pytest/lib/b= oot_binary.py index d8f503ead9f2..1910d1f88fe6 100644 --- a/automation/pytest/lib/boot_binary.py +++ b/automation/pytest/lib/boot_binary.py @@ -23,6 +23,7 @@ class BootBinary: def __init__(self, tmp_path: Path, xenroot: Path, pxe_host: str, http_pxe_path: str, + ssh_pub_keys: str | None =3D None, vlan_id: int | None =3D None, static_ip: str | None =3D None, static_gateway: str | None =3D None, @@ -37,6 +38,7 @@ class BootBinary: self.static_gateway =3D static_gateway self.static_dns =3D static_dns self.static_ipv6 =3D static_ipv6 + self.ssh_pub_keys =3D ssh_pub_keys self.boot_script =3D boot_script =20 # Minimal rootfs @@ -126,6 +128,11 @@ class BootBinary: runlevel_boot_d.mkdir(parents=3DTrue) (runlevel_boot_d / "networking").symlink_to("/etc/init.d/networkin= g") =20 + if self.ssh_pub_keys: + home_root_ssh =3D rootfs_path / "root/.ssh" + home_root_ssh.mkdir(parents=3DTrue) + (home_root_ssh / "authorized_keys").write_text(self.ssh_pub_ke= ys) + local_d_dir =3D rootfs_path / "etc/local.d" local_d_dir.mkdir(parents=3DTrue) =20 diff --git a/automation/pytest/test_boot.py b/automation/pytest/test_boot.py index 90d8e00e90d9..039cc36c1a04 100644 --- a/automation/pytest/test_boot.py +++ b/automation/pytest/test_boot.py @@ -1,5 +1,6 @@ import logging import os +import paramiko from pathlib import Path import pytest import random @@ -16,6 +17,11 @@ def xenroot_path() -> Path: return Path("../..").resolve() =20 =20 +@pytest.fixture +def sshkey_for_test() -> paramiko.pkey.PKey: + return paramiko.ecdsakey.ECDSAKey.generate() + + @pytest.fixture def boot_string() -> str: return ''.join(random.choice(string.ascii_letters) for _ in range(16)) @@ -24,6 +30,7 @@ def boot_string() -> str: @pytest.fixture def prepare_rootfs(tmp_path: Path, xenroot_path: Path, + sshkey_for_test: paramiko.pkey.PKey, boot_string: str, ) -> BootBinary: static_gateway =3D os.environ['HOST_IP_GATEWAY'] @@ -31,6 +38,9 @@ def prepare_rootfs(tmp_path: Path, =20 boot_script =3D f"echo Dom0 ready {boot_string}\n" =20 + ssh_pub_keys =3D os.environ['SSH_PUB_KEYS'] + ssh_pub_keys +=3D f"\n{sshkey_for_test.get_name()} {sshkey_for_test.ge= t_base64()}\n" + return BootBinary(tmp_path, xenroot_path, vlan_id=3Dint(os.environ['HOST_IP_VLANID']), @@ -40,6 +50,7 @@ def prepare_rootfs(tmp_path: Path, static_gateway=3Dstatic_gateway, static_dns=3Dstatic_gateway, static_ipv6=3Dos.environ['HOST_IP6'], + ssh_pub_keys=3Dssh_pub_keys, boot_script=3Dboot_script, ) =20 @@ -73,6 +84,7 @@ def machine_on_ipmi(prepare_netboot: None) -> Generator[I= PMI]: =20 @pytest.mark.timeout(600) def test_xen_tools_tests(machine_on_ipmi: IPMI, + sshkey_for_test: paramiko.pkey.PKey, boot_string: str, ) -> None: expect_string =3D boot_string @@ -91,3 +103,30 @@ def test_xen_tools_tests(machine_on_ipmi: IPMI, if "Manual reset required ('noreboot' specified)" in line: # Test failed, could wait a bit before failing the test. logging.error("Xen panic") + ssh =3D paramiko.client.SSHClient() + ssh.set_missing_host_key_policy(paramiko.client.WarningPolicy) + logging.debug(f"connecting to {os.environ['HOST_IP4'].split('/')[0]}") + ssh.connect(os.environ['HOST_IP4'].split('/')[0], + username=3D'root', + pkey=3Dsshkey_for_test, + timeout=3D10, + ) + + cmd =3D '/root/run-tools-tests /usr/lib/xen/tests /tmp/tests-junit.xml' + logging.info(f"Exec command: {cmd}") + stdin, stdout, stderr =3D ssh.exec_command(cmd) + for output in stdout: + logging.debug(output.strip()) + errormsg =3D stderr.read() + if errormsg: + logging.info(f"cmd errro: {errormsg!r}") + exit_status =3D stderr.channel.recv_exit_status() + logging.debug(f"exit status: {exit_status}") + + cmd =3D 'cat /tmp/tests-junit.xml' + stdin, stdout, stderr =3D ssh.exec_command(cmd) + junit =3D stdout.read() + logging.debug(f"got junit result: {junit!r}") + errormsg =3D stderr.read() + if errormsg: + logging.info(f"cmd errro: {errormsg!r}") --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790071771; cv=none; d=zohomail.com; s=zohoarc; b=g9lTKXgBbRiW2Hi2kM0b6tEUde5pJmD4AFZSldbok1RtEIcWVilVCqioRmrjUlpav068RF2R9c8EglN9IsuqSy5vSzcHVJrw2ty1BiBVF/O6Kw21eRsw11xiv2wJ+s12Lg0WmLxakfQKMDMoQx+mCGibCn70DlqeP8DY/riX/Sg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790071771; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zGpGZ+j9aQiCtnJa+6UJN2jNBGnn8uaTwN1dX0fpCgY=; b=PnlLOnqNbaxwTeCdAOFEYFi/JrbWON7wzUumGHaINBJWYGhRi/4Ckx5mKnNTsZyr+TF1D3YzD5AujUfdcwO7JFGhwqR39074uX4qYOBJ58NomlxlH+qx9pKpXoDvc91EXdXnKmIgCJzOdWS7avHXQK9jd+uDyfccruXozFQYulI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790071771209806.5489930102258; Tue, 22 Sep 2026 03:09:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428475.1651374 (Exim 4.92) (envelope-from ) id 1x8xR5-0008B0-MA; Tue, 22 Sep 2026 10:09:15 +0000 Received: by outflank-mailman (output) from mailman id 1428475.1651374; Tue, 22 Sep 2026 10:09:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xR5-00089o-FX; Tue, 22 Sep 2026 10:09:15 +0000 Received: by outflank-mailman (input) for mailman id 1428475; Tue, 22 Sep 2026 10:09:13 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xR3-0007sy-CU for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:09:13 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xR2-00Ao3M-31; Tue, 22 Sep 2026 10:09:13 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xR3-00DE8C-1X; Tue, 22 Sep 2026 10:09:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=zGpGZ+j9aQiCtnJa+6UJN2jNBGnn8uaTwN1dX0fpCgY=; b=olxkbERncTc4JTc6v5Lmha2s6K 58/t/1bjdVShM6LmKhCmxliYHydgfN5UcDzLBEtwiqg3Qo9HUZN90OmqC0gSlkBClbyFWLcnHm22s kuOyjnheTRuRzMQ1+FGGXrYxTz8mOiKGL6+pfgXqYwC2hLiNpLtJ3Z/+CqPH8039087c=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 09/13] pytest: Generate a rootfs for a guest Date: Tue, 22 Sep 2026 12:08:56 +0200 Message-ID: <20260922100900.29129-10-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790071772897158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD Signed-off-by: Anthony PERARD --- automation/pytest/conftest.py | 6 ++++ automation/pytest/lib/boot_binary.py | 42 ++++++++++++++++++++++++++++ automation/pytest/test_boot.py | 8 ++++++ 3 files changed, 56 insertions(+) create mode 100644 automation/pytest/conftest.py diff --git a/automation/pytest/conftest.py b/automation/pytest/conftest.py new file mode 100644 index 000000000000..304241ae06ba --- /dev/null +++ b/automation/pytest/conftest.py @@ -0,0 +1,6 @@ +import pytest + + +def pytest_configure(config: pytest.Config) -> None: + config.addinivalue_line("markers", + "guest_boot_script: script to run when the gue= st boot") diff --git a/automation/pytest/lib/boot_binary.py b/automation/pytest/lib/b= oot_binary.py index 1910d1f88fe6..9e79b1798908 100644 --- a/automation/pytest/lib/boot_binary.py +++ b/automation/pytest/lib/boot_binary.py @@ -30,6 +30,7 @@ class BootBinary: static_dns: str | None =3D None, static_ipv6: str | None =3D None, boot_script: str | None =3D None, + guest_boot_script: str | None =3D None, ) -> None: self.vlan_id =3D vlan_id self.pxe_host =3D pxe_host @@ -40,6 +41,7 @@ class BootBinary: self.static_ipv6 =3D static_ipv6 self.ssh_pub_keys =3D ssh_pub_keys self.boot_script =3D boot_script + self.guest_boot_script =3D guest_boot_script =20 # Minimal rootfs rootfs_path =3D tmp_path / "rootfs_minimal" @@ -53,6 +55,12 @@ class BootBinary: self.prepare_dom0_rootfs(rootfs_path, xenroot) self.rootfs_dom0_dir =3D rootfs_path =20 + # Guest kernel + rootfs + rootfs_path =3D tmp_path / "rootfs_domU" + rootfs_path.mkdir() + self.prepare_guest_rootfs(rootfs_path, xenroot) + self.rootfs_guest_dir =3D rootfs_path + =20 def prepare_minimal_rootfs(self, rootfs_path: Path, xenroot: Path) -> = None: script_pre_xen =3D dedent(f"""\ @@ -212,8 +220,42 @@ class BootBinary: =20 self.xen_tools_rootfs =3D cpio_rootfs =20 + def prepare_guest_rootfs(self, rootfs_path: Path, xenroot: Path) -> No= ne: + etc =3D rootfs_path / "etc" + etc.mkdir() + + local_d_dir =3D etc / "local.d" + local_d_dir.mkdir() + + xen_start_script =3D local_d_dir / "xen.start" + xen_start_script.write_text(dedent(f"""\ + #!/bin/sh + echo 8 > /proc/sys/kernel/printk + {self.guest_boot_script} + """)) + xen_start_script.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) + + (etc / "issue").write_text(dedent("""\ + domU Welcome to Alpine Linux + Kernel \\r on an \\m (\\l) + + """)) + + # rootfs archive + rootfs =3D [] + # Uncompressed first! Then compressed cpio archives! + rootfs.append(xenroot / "binaries/rootfs.cpio.gz") + cpio_rootfs =3D xenroot / "binaries/guest-rootfs.cpio.gz" + concatenate_cpios(rootfs, cpio_rootfs) + cpio_archive_from_dir(rootfs_path, cpio_rootfs) + + self.guest_rootfs =3D cpio_rootfs + def minimal(self) -> Path: return self.minimal_rootfs =20 def dom0_tools(self) -> Path: return self.xen_tools_rootfs + + def guest(self) -> Path: + return self.guest_rootfs diff --git a/automation/pytest/test_boot.py b/automation/pytest/test_boot.py index 039cc36c1a04..5a7ec43fa52b 100644 --- a/automation/pytest/test_boot.py +++ b/automation/pytest/test_boot.py @@ -32,11 +32,17 @@ def prepare_rootfs(tmp_path: Path, xenroot_path: Path, sshkey_for_test: paramiko.pkey.PKey, boot_string: str, + request: pytest.FixtureRequest ) -> BootBinary: static_gateway =3D os.environ['HOST_IP_GATEWAY'] http_pxe_path =3D os.environ["PXE_HTTP_PATH"] =20 boot_script =3D f"echo Dom0 ready {boot_string}\n" + marker =3D request.node.get_closest_marker("guest_boot_script") + if marker: + guest_boot_script =3D marker.args[0] + else: + guest_boot_script =3D None =20 ssh_pub_keys =3D os.environ['SSH_PUB_KEYS'] ssh_pub_keys +=3D f"\n{sshkey_for_test.get_name()} {sshkey_for_test.ge= t_base64()}\n" @@ -52,6 +58,7 @@ def prepare_rootfs(tmp_path: Path, static_ipv6=3Dos.environ['HOST_IP6'], ssh_pub_keys=3Dssh_pub_keys, boot_script=3Dboot_script, + guest_boot_script=3Dguest_boot_script, ) =20 =20 @@ -61,6 +68,7 @@ def prepare_netboot(prepare_rootfs: BootBinary, xenroot_p= ath: Path) -> None: rootfs_paths =3D [ prepare_rootfs.minimal(), prepare_rootfs.dom0_tools(), + prepare_rootfs.guest(), ] netboot.prepare_tftp(xenroot_path, rootfs_paths) =20 --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790072970; cv=none; d=zohomail.com; s=zohoarc; b=aLgfVaC+wNOTeQr3d9zZc6wgxYF+ch4ILVcfNaDNxqJg5MQPMVYvhQZ9mhvycUZj8kL+pgX0yZbb++QHtBxNVvWMRmxfcPGBMEUIhnmcPdbHtZAHyLVtoacv233FmMYfvnmU1gjPZpFNXshDnxgBcqb1hs/aHZvaZHOQdxyW2oM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790072970; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0EYmk0NJ/kvSiclNpr9gVl0wT7a9lZ6KKLAdNMnZn+8=; b=BebiZfGpJbtZBezVtN0vVHB9OfkcGlHzjbPPORbrIfzGS7m1tdoArWC6h4qZ61ULDw1hehlEBr8l1HCIttlvoNY9QW2wy6fF2bRsH0tE6kEGhrMyZLphGaBhkkYPRDV1RI5XyHKRSB6Se/8py6TOBFbsREKC7YeE3sz4s4E6A78= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790072970470748.847249753187; Tue, 22 Sep 2026 03:29:30 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428556.1651407 (Exim 4.92) (envelope-from ) id 1x8xkP-0006q2-WC; Tue, 22 Sep 2026 10:29:13 +0000 Received: by outflank-mailman (output) from mailman id 1428556.1651407; Tue, 22 Sep 2026 10:29:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xkP-0006ps-Pb; Tue, 22 Sep 2026 10:29:13 +0000 Received: by outflank-mailman (input) for mailman id 1428556; Tue, 22 Sep 2026 10:29:12 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xkO-0006mx-8k for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:29:12 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xkN-00ApBn-1O; Tue, 22 Sep 2026 10:29:11 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xR4-00DE8C-1z; Tue, 22 Sep 2026 10:09:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=0EYmk0NJ/kvSiclNpr9gVl0wT7a9lZ6KKLAdNMnZn+8=; b=0g8vDDC72M9fifW5/z5jWwZDDe n7hUPd2gGJRzFSwarkZyHVAjqpw/lGDU4inJjDrKWlEuGraLJsx2x6d8a077cvulNZaZr7ch29yjc twCdNBUMctcABymJi4huRQ8kK3urMKHgpHa+3CLoEg8ojQ146KhHUegJ/1sXNuXdT5z4=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 10/13] pytest: Add guest test Date: Tue, 22 Sep 2026 12:08:57 +0200 Message-ID: <20260922100900.29129-11-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790072971569158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD Adding a second test, to help show how to improve the fixtures, and needed code in libraries That test copies part of the run tools-test tests, but we could shared that better. Then, we ssh to the host, to both follow the guest log files and to prepare and start the guest, over several SSH channel. tail_log() could go into a lib. And I don't know yet what to do with the collected threads object. I also want to get rid of the guest_boot_script marker, and ssh to the guest instead. Signed-off-by: Anthony PERARD --- automation/pytest/test_boot.py | 97 ++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/automation/pytest/test_boot.py b/automation/pytest/test_boot.py index 5a7ec43fa52b..089aa1e6c063 100644 --- a/automation/pytest/test_boot.py +++ b/automation/pytest/test_boot.py @@ -3,8 +3,11 @@ import os import paramiko from pathlib import Path import pytest +from queue import Queue import random import string +from textwrap import dedent +from threading import Thread from typing import Generator =20 from lib.boot_binary import BootBinary @@ -138,3 +141,97 @@ def test_xen_tools_tests(machine_on_ipmi: IPMI, errormsg =3D stderr.read() if errormsg: logging.info(f"cmd errro: {errormsg!r}") + + +@pytest.mark.timeout(600) +@pytest.mark.guest_boot_script(dedent(f""" + ifconfig eth0 10.1.105.101 + until ping -c 10 {os.environ["HOST_IP4"].partition('/')[0]}; do + sleep 1 + done + echo \"guest ping test passed\" + """)) +def test_guest( + machine_on_ipmi: IPMI, + sshkey_for_test: paramiko.pkey.PKey, + boot_string: str, + ) -> None: + expect_string =3D boot_string + for line in machine_on_ipmi.console_output_generator(): + # + # Wait for `expect_string` for the test to succeed + # + if expect_string in line: + logging.info(f"got expect_string '{line}'.") + break + # + # Some common expected or not console outputs. + # + if "Latest ChangeSet:" in line: + logging.info(f"Test xen build from '{line}'.") + if "Manual reset required ('noreboot' specified)" in line: + # Test failed, could wait a bit before failing the test. + logging.error("Xen panic") + + with paramiko.client.SSHClient() as ssh: + threads =3D [] + ssh_logs: Queue[str] =3D Queue() + ssh.set_missing_host_key_policy(paramiko.client.WarningPolicy) + logging.debug(f"connecting to {os.environ['HOST_IP4'].split('/')[0= ]}") + ssh.connect(os.environ['HOST_IP4'].split('/')[0], + username=3D'root', + pkey=3Dsshkey_for_test, + timeout=3D10, + ) + + def ssh_channel_read(stdout, prefix): + for output in stdout: + ssh_logs.put(f"{prefix}{output.strip()}") + + def tail_log(file: Path, prefix: str): + stdin, stdout, stderr =3D ssh.exec_command(f"tail -n0 -F {file= }") + stdin.close() + # Dirty, should keep `stderr` to clean it up + t =3D Thread(target=3Dssh_channel_read, args=3D(stdout, prefix= )) + t.start() + return t + + threads +=3D [ + tail_log(Path("/var/log/xen/console/guest-domU.log"), "(domU) = "), + tail_log(Path("/var/log/xen/qemu-dm-domU.log"), "(qemu-dm) "), + ] + + cmd =3D dedent(f""" + set -x + pxe_host=3D"{os.environ["PXE_HOST"]}" + http_pxe_path=3D"{os.environ["PXE_HTTP_PATH"]}" + wget http://${{pxe_host}}/${{http_pxe_path}}/bzImage -O /boot/= vmlinuz-domU + wget http://${{pxe_host}}/${{http_pxe_path}}/guest-rootfs.cpio= .gz -O /boot/initrd-domU + xl -Tvvv create /etc/xen/domU.cfg 2>&1 + """) + logging.info(f"Exec command: {cmd}") + stdin, stdout, stderr =3D ssh.exec_command(cmd) + + # everything is on stderr, both wget and xl output + t =3D Thread(target=3Dssh_channel_read, args=3D(stderr, "")) + t.start() + threads.append(t) + t =3D Thread(target=3Dssh_channel_read, args=3D(stdout, "")) + t.start() + threads.append(t) + + # Log while `xl` is preparing the guest to start + while t.is_alive(): + line =3D ssh_logs.get() + logging.debug(line) + + xl_exit_status =3D stderr.channel.recv_exit_status() + assert xl_exit_status =3D=3D 0 + + # `xl` have exited, continue logging the guest output + while True: + line =3D ssh_logs.get() + logging.debug(line) + if "guest ping test passed" in line: + logging.info("found expected guest line in logs") + break --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790072971; cv=none; d=zohomail.com; s=zohoarc; b=BlKm+5p86g39G3d9I/XdVvAqdmKqke00YUhqMlak6gdPeb98w9F5Ktz3lySx9jvrYP0BiI6SR9SK1w4MrQwVdo1VMI1oya/oHZEwdDJCrhWY5zHAesmlf0zH8q7ZkR2OZUzBWKunjYsbW4+/79BnGc4CCvxlojResOIRO2e/j90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790072971; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h6+SFB0CIizh0TnhNrfS2IIUlkL9246nxzGjrD51H0I=; b=QliM8U8qpVN3ayRBi4/nd0B9If3qOJXUc7xy0TiVvWX75cpUPEJCyGbaDP06mLNF4/jGqaHhr6Sh9zag3YAXq+kw+CwsuP5mEr/bPdlLE6UFGahWXY5i3oBQyautGF0dQsaPPuhtuuU+J0M0167IyrmXymVLd5jVx3/bx7O5Jmo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 179007297143943.00420797410152; Tue, 22 Sep 2026 03:29:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428558.1651418 (Exim 4.92) (envelope-from ) id 1x8xkQ-000701-FM; Tue, 22 Sep 2026 10:29:14 +0000 Received: by outflank-mailman (output) from mailman id 1428558.1651418; Tue, 22 Sep 2026 10:29:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xkQ-0006xh-8R; Tue, 22 Sep 2026 10:29:14 +0000 Received: by outflank-mailman (input) for mailman id 1428558; Tue, 22 Sep 2026 10:29:12 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xkO-0006nG-Sf for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:29:12 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xkO-00ApC1-13; Tue, 22 Sep 2026 10:29:12 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xR5-00DE8C-2X; Tue, 22 Sep 2026 10:09:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=h6+SFB0CIizh0TnhNrfS2IIUlkL9246nxzGjrD51H0I=; b=QOWCVPAl1mpKrXFrDY/XE+hiAX Dh/I4r/EWYNQQ/WU0Vd0h0mta+5IW2k5gAZdMOaiIl1nfmgn+H70XESbEiSxlf5jYmBKQ0rA3DqTI 8IcygBJbJc1HJryYo/f0EpMFnr7Ll49mFdGEwPsx4LLS6xv3nRIrwYFBzJWTERiSC37E=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 11/13] pytest: Add config to enable live log, and disable ssh/paramiko logging Date: Tue, 22 Sep 2026 12:08:58 +0200 Message-ID: <20260922100900.29129-12-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790072973392158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD Signed-off-by: Anthony PERARD --- automation/pytest/pytest.toml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 automation/pytest/pytest.toml diff --git a/automation/pytest/pytest.toml b/automation/pytest/pytest.toml new file mode 100644 index 000000000000..ef61ff74ab47 --- /dev/null +++ b/automation/pytest/pytest.toml @@ -0,0 +1,9 @@ +[pytest] +addopts =3D [ + "--log-disable=3Dparamiko.transport", + "--log-disable=3Dparamiko.transport.sftp", +] +log_cli_format =3D "%(asctime)s %(levelname)s %(message)s" +log_cli_date_format =3D "%H:%M:%S" +log_cli_level =3D "DEBUG" +log_cli =3D true --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790072981; cv=none; d=zohomail.com; s=zohoarc; b=UV0Z6kbg7xp9hUcGraJzs0KvVS8JrTl0fG0KzgSHAS55spU7ET0DHD8uHHlM2G+lEJR9QtQqqSjms6VIlgqHJ6cfxdewIxha71wKwFIZpWLXwGcsvJn4PdoUKXu7H3VmTVjvpznRHzoFic+IQ9f+pZxUo4SnEmn3fWLut0MZmFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790072981; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xbKqePSgOa7HquVDUAC/PIH+wy1cBxBCncvcGMMYNw0=; b=CJgWKFHFa8t007Q6A9ydB4QWHq+MquCZ03b8FtDP0pEaHUxnGjB0vb7P7P9Ft8UPUfk/sJKbYQ33OzQGv5vMQe2fAMsyVFdCYX4o4esGrw5eptI/y1sLOgCCApQcufpvwN9dBT6jgwRGuC8YgNmuEVVowoVOOnRQK9+Q5Ulnw0k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790072981129859.4926333671975; Tue, 22 Sep 2026 03:29:41 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428557.1651413 (Exim 4.92) (envelope-from ) id 1x8xkQ-0006uv-7L; Tue, 22 Sep 2026 10:29:14 +0000 Received: by outflank-mailman (output) from mailman id 1428557.1651413; Tue, 22 Sep 2026 10:29:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xkQ-0006tP-0k; Tue, 22 Sep 2026 10:29:14 +0000 Received: by outflank-mailman (input) for mailman id 1428557; Tue, 22 Sep 2026 10:29:12 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xkO-0006nB-S0 for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:29:12 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xkO-00ApBz-0w; Tue, 22 Sep 2026 10:29:12 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xR6-00DE8C-31; Tue, 22 Sep 2026 10:09:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=xbKqePSgOa7HquVDUAC/PIH+wy1cBxBCncvcGMMYNw0=; b=w9WFgaeqKb8P/grfPG6dOfj7D3 eOrUekBbBylDc6LCbQGVgOy3X81cse+VLj2PXkFRxPnwBNKHKrWaqSg2gEprousa7rte3MKeGt2Xh TITxUzPAjiUgFeidVwg7G2KZ3jzkS4wINj/P/Sy57nu2mS15F3jHLTpktAyCmw4VgEJ0=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 12/13] pytest: Add example .env for options for the tests Date: Tue, 22 Sep 2026 12:08:59 +0200 Message-ID: <20260922100900.29129-13-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790072983340158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD All thees could be instead pass to the environment of a gitlab-runner job instead. But that can make developing easier. Signed-off-by: Anthony PERARD --- automation/pytest/.env | 19 +++++++++++++++++++ automation/pytest/pyproject.toml | 1 + automation/pytest/pytest.toml | 4 ++++ 3 files changed, 24 insertions(+) create mode 100644 automation/pytest/.env diff --git a/automation/pytest/.env b/automation/pytest/.env new file mode 100644 index 000000000000..6ac8b6158de8 --- /dev/null +++ b/automation/pytest/.env @@ -0,0 +1,19 @@ +# Test machine +HOST_MAC=3D"ff:ff:ff:ff:ff:ff" +HOST_IP_GATEWAY=3D"203.0.113.1" +HOST_IP_VLANID=3D42 +HOST_IP4=3D"203.0.113.42/24" +HOST_IP6=3D"2001:db8::1:42/32" + +# IPMI +IPMI_HOSTNAME=3D'moonshot.example.org' +IPMI_BLADE_NODE=3D"c42n1" + +# Network environment +# XXX default value probably not needed with env_files_skip_if_set +PXE_HOST=3D${PXE_HOST:-pxe.example.org} +PXE_HTTP_PATH=3D"configs/custom/${HOST_MAC}" +PXE_SSH_USER=3Dpxe +PXE_SSH_PATH=3D"pxe/moonshot-c42" + +SSH_PUB_KEYS=3D"ssh-algo AAAArandomstring Not a real key\n" diff --git a/automation/pytest/pyproject.toml b/automation/pytest/pyproject= .toml index c54c1338f656..b62befaa07d3 100644 --- a/automation/pytest/pyproject.toml +++ b/automation/pytest/pyproject.toml @@ -7,6 +7,7 @@ dependencies =3D [ "paramiko<5.0.0", "pip>=3D26.0.1", "pytest>=3D9.0.2", + "pytest-env>=3D1.6.0", "pytest-timeout>=3D2.4.0", "types-paramiko>=3D4.0.0.20260322", ] diff --git a/automation/pytest/pytest.toml b/automation/pytest/pytest.toml index ef61ff74ab47..405a56a83301 100644 --- a/automation/pytest/pytest.toml +++ b/automation/pytest/pytest.toml @@ -7,3 +7,7 @@ log_cli_format =3D "%(asctime)s %(levelname)s %(message)s" log_cli_date_format =3D "%H:%M:%S" log_cli_level =3D "DEBUG" log_cli =3D true + +[pytest_env] +env_files =3D [".env"] +env_files_skip_if_set =3D true --=20 Anthony PERARD From nobody Thu Sep 24 19:00:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790072978; cv=none; d=zohomail.com; s=zohoarc; b=YCHfX3uKwdeAwp3NZHzoLycSDmLW74LUPaqnjsOdXqjg44LqHMDkNdwbx+pQKAxOcgAAJ77QJ3n+9+Gy82ylNXW5ccUtKY0m0XjvcwV39QFMQTs/5sqp2EhvfShYvQUisL1rGvVp24yWFK5Cer3F+DXLokn47HTz2Osj6lfiRR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790072978; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DyHqTO5jwlg+PrrWKnovMacZA2AwSnp3TeyqmfEC+9I=; b=SkNtEt9ewnR3vGpr41DJrqbO2KS7ApIbvG+SKJX5Hgr1gec+J4kpDf7swYrlIlU03SzAEqyqsR1UYmFbA1II48rIBc1kDh+28sfXh17DtMpl1A5yjUBOGobD5LKP973BklppqtBr0gbGQSKU9nPFw6qyc23IYlrq2u/XSRIiWBo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790072978659874.2582719692947; Tue, 22 Sep 2026 03:29:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1428555.1651400 (Exim 4.92) (envelope-from ) id 1x8xkP-0006nX-Ma; Tue, 22 Sep 2026 10:29:13 +0000 Received: by outflank-mailman (output) from mailman id 1428555.1651400; Tue, 22 Sep 2026 10:29:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xkP-0006nQ-Jn; Tue, 22 Sep 2026 10:29:13 +0000 Received: by outflank-mailman (input) for mailman id 1428555; Tue, 22 Sep 2026 10:29:12 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1x8xkO-0006mw-8j for xen-devel@lists.xenproject.org; Tue, 22 Sep 2026 10:29:12 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1x8xkN-00ApBl-1B; Tue, 22 Sep 2026 10:29:11 +0000 Received: from [2a01:cb15:80c6:e800:b9e9:dfdc:4751:7ecb] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8xR8-00DE8C-0E; Tue, 22 Sep 2026 10:09:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=DyHqTO5jwlg+PrrWKnovMacZA2AwSnp3TeyqmfEC+9I=; b=2ufe/gQ6FxZjBTTJ+EIhJFj6qu oHnK5nEjocfkLk2kQBQ2/bzQ/edqnQFg98T0+woqazh7S6E7oTaiOyTqiZKmi4HdDA4iR4xJo+zBC 3WusMl1vVozCgrRKhD7h0eo5WelQQliex/lR8o8HqruvL/YiK2YoNE3EVr37CvtD4XGs=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 13/13] gitlab-ci: Add job for moonshot with pytest Date: Tue, 22 Sep 2026 12:09:00 +0200 Message-ID: <20260922100900.29129-14-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260922100900.29129-1-anthony@xenproject.org> References: <20260922100900.29129-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790072979393158500 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD WIP, use alternative branchs for artefacts - moonshot need kernel with driver for the network card and for vlan - alpine rootfs need network support and sshd Signed-off-by: Anthony PERARD --- automation/gitlab-ci/test.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 61adc1baff30..1f760e24811f 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -205,6 +205,7 @@ - qubes-hw11 =20 # Test jobs + build-each-commit-gcc: extends: .test-jobs-common variables: @@ -777,6 +778,26 @@ qemu-xtf-argo-x86_64-gcc-debug: needs: - alpine-3.24-x86_64-gcc-debug =20 +broadwell-tools-tests-pv-x86-64-gcc-debug: + extends: .test-jobs-common + variables: + XEN_REGISTRY: registry.gitlab.com/xen-project/people/anthonyper/xen + CONTAINER: archlinux:current-uv + artifacts: + paths: + - smoke.serial + - '*.log' + when: always + reports: + junit: tests-junit.xml + tags: + - vates-moonshot-1 + needs: + - *x86_64-test-needs + - alpine-3.24-x86_64-gcc-debug + script: + - cd automation/pytest && uv run pytest + qemu-smoke-riscv64-gcc: extends: .qemu-riscv64 script: --=20 Anthony PERARD