From nobody Sat Dec 13 07:25:32 2025 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=invisiblethingslab.com ARC-Seal: i=1; a=rsa-sha256; t=1764867295; cv=none; d=zohomail.com; s=zohoarc; b=eVyL1y15iIdu41IX5w8/qYEctG/55hC6ioDjmLNvxSUREVX54BTzrA6EWalcgAQqaYI3YA9JK2vD/Rf2uj4gpUYqayDsH2I8ChaOU3XZk/ai7fg8jwkU/LCiCnveOr3nBIR37I5Rey3k+3P9ZeOHe8qE4rcbJ7Mf8z9Xzx8Aa80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764867295; h=Content-Type: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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/bW7oZn7wYZvxeYpFbyx0iWQejJzqha55x3nUBK4tG4=; b=WB4Wxpm0W6WOPmXOSABpXa+6hwQar++jKpR38R0zpO6fvUNWRiD14WniJlAiOeBjZj+irfjGyf5T27mKx+u4LJv04gqK0KwenyM4NyZwH5HDnhO89y+t7ltALSa67t9VSfk4eaVMaIO4YWDUFRB6ruIzcSpJKOZlg+syd517DOE= 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 1764867295310711.9928108443465; Thu, 4 Dec 2025 08:54:55 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1178127.1502088 (Exim 4.92) (envelope-from ) id 1vRCb9-0000QD-6J; Thu, 04 Dec 2025 16:54:31 +0000 Received: by outflank-mailman (output) from mailman id 1178127.1502088; Thu, 04 Dec 2025 16:54:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vRCb9-0000Q6-35; Thu, 04 Dec 2025 16:54:31 +0000 Received: by outflank-mailman (input) for mailman id 1178127; Thu, 04 Dec 2025 16:54:30 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vRCb7-0000By-Vu for xen-devel@lists.xenproject.org; Thu, 04 Dec 2025 16:54:29 +0000 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e5a54370-d131-11f0-9d1a-b5c5bf9af7f9; Thu, 04 Dec 2025 17:54:29 +0100 (CET) Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 575D81400230; Thu, 4 Dec 2025 11:54:28 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Thu, 04 Dec 2025 11:54:28 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Dec 2025 11:54:26 -0500 (EST) 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" X-Inumbo-ID: e5a54370-d131-11f0-9d1a-b5c5bf9af7f9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1764867268; x=1764953668; bh=/bW7oZn7wY ZvxeYpFbyx0iWQejJzqha55x3nUBK4tG4=; b=uZZEVKwuFI3TSK9RLFAshT2JAo eG+UkzrtnuG0TH3Unur/Isfg9r0jtqVvDqs/tYqV2ukabqE5avk614DC00nnSmQq ucIjAkNrxjhbguzsoGx+AhYXLMtJUt/iY6AXeXmk6OYaM21/GlcAUoSttKadmtCa wd5o27A5/6fakS1R1Rpuob9AkkRPRn3GXdB8pGX5q3U21kpT+7F9pBmBziLyGr83 9/paWQllBeY3uR2qzqFzDBWzaIDbSiVhI8J6qT43OlR5CZPeHdNu2SbTl5UDteUA U1hIzkkZ2g9rCQNlypp1CGQXbdTJ1Np4d0dKcqo7NnqUrBZew/FVoCAEf5ew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1764867268; x= 1764953668; bh=/bW7oZn7wYZvxeYpFbyx0iWQejJzqha55x3nUBK4tG4=; b=M HAdr6jkV/nnSF1USkyv14gG+mseph6bXtP+s/gd0uZeOQ7iUTqcycS35crcF07Zf NW6j9mLjh/rg9uyzrmAfoZOK451AWjVXnAMm2h9TKq/Nxk1NbXEykLTSDAXO1KP2 Qyum5iXAtgnMTXlbWUscIG/xg59DcAYFfnjx3j/zkM0YSbgOlzR/yLQL0luZFLbk rO8bRVsYpkymZhjYn2pZLwTcAsrAjhMXIk/tBxe5AuUXafQ+FV4Z6ZMruJLt7Mn9 61G8eBdCNyWaim3NV6dOf6JgW+gQobY9/CKauGK+taV/QCfsUYHoe0toXTR/JmO3 g7yIpUssBJyiL/TX+l8bw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeiudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh ephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghkucfo rghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvhhish hisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefgueduhefg vdefheehudejheefudevueeghfekhfehleegveduteeuiedugffgffenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhesihhn vhhishhisghlvghthhhinhhgshhlrggsrdgtohhmpdhnsggprhgtphhtthhopeegpdhmoh guvgepshhmthhpohhuthdprhgtphhtthhopeigvghnqdguvghvvghlsehlihhsthhsrdig vghnphhrohhjvggtthdrohhrghdprhgtphhtthhopehmrghrmhgrrhgvkhesihhnvhhish hisghlvghthhhinhhgshhlrggsrdgtohhmpdhrtghpthhtoheptggrrhguohgvsegtrghr ughovgdrtghomhdprhgtphhtthhopehsshhtrggsvghllhhinhhisehkvghrnhgvlhdroh hrgh X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Doug Goldstein , Stefano Stabellini Subject: [PATCH v3 2/4] CI: Add driver domains tests Date: Thu, 4 Dec 2025 17:53:49 +0100 Message-ID: <58d2b15392340f82c914c7544af0f0f00ce53e47.1764867217.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @invisiblethingslab.com) X-ZM-MESSAGEID: 1764867297841019200 Setup a simple two domU system. One with network backend, running xendriverdomain service, and one with frontend, trying to ping the backend. Contrary to other similar tests, use disk image instead of initrd, to allow bigger rootfs without adding more RAM (for both dom0 and domU). But keep using pxelinux as a bootloader as it's easier to setup than installing grub on the disk. Theoretically, it could be started via direct kernel boot in QEMU, but pxelinux is slightly closer to real-world deployment. Use fakeroot to preserve file owners/permissions. This is especially important for suid binaries like /bin/mount - without fakeroot, they will end up as suid into non-root user. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- Changes in v3: - add fakeroot - run ldconfig at the disk image creation time, to avoid running it at dom0/domU boot time (which is much slower) Changes in v2: - use heredoc - limit ping loop iterations - use full "backend" / "frontend" in disk image names - print domU consoles directly to /dev/console, to avoid systemd-added messages prefix - terminate test on failure, don't wait for timeout --- automation/build/debian/13-x86_64.dockerfile | 2 +- automation/gitlab-ci/test.yaml | 8 +- automation/scripts/qemu-driverdomains-x86_64.sh | 138 +++++++++++++++++- 3 files changed, 148 insertions(+) create mode 100755 automation/scripts/qemu-driverdomains-x86_64.sh diff --git a/automation/build/debian/13-x86_64.dockerfile b/automation/buil= d/debian/13-x86_64.dockerfile index 2c6c9d4a5098..6382bafbd5bd 100644 --- a/automation/build/debian/13-x86_64.dockerfile +++ b/automation/build/debian/13-x86_64.dockerfile @@ -55,7 +55,9 @@ RUN <&1 | tee ${LOGFI= LE} + needs: + - *x86-64-test-needs + - alpine-3.22-gcc + qemu-smoke-x86-64-gcc: extends: .qemu-smoke-x86-64 script: diff --git a/automation/scripts/qemu-driverdomains-x86_64.sh b/automation/s= cripts/qemu-driverdomains-x86_64.sh new file mode 100755 index 000000000000..c0241da54168 --- /dev/null +++ b/automation/scripts/qemu-driverdomains-x86_64.sh @@ -0,0 +1,138 @@ +#!/bin/bash + +set -ex -o pipefail + +dom0_rootfs_extra_comp=3D() +dom0_rootfs_extra_uncomp=3D() + +cd binaries + +# DomU rootfs + +mkdir -p rootfs +cd rootfs +mkdir -p etc/local.d +passed=3D"ping test passed" +failed=3D"TEST FAILED" +cat > etc/local.d/xen.start << EOF +#!/bin/bash + +set -x + +if grep -q test=3Dbackend /proc/cmdline; then + brctl addbr xenbr0 + ip link set xenbr0 up + ip addr add 192.168.0.1/24 dev xenbr0 + bash /etc/init.d/xendriverdomain start + # log backend-related logs to the console + tail -F /var/log/xen/xldevd.log /var/log/xen/xen-hotplug.log >>/dev/co= nsole 2>/dev/null & +else + ip link set eth0 up + ip addr add 192.168.0.2/24 dev eth0 + timeout=3D6 # 6*10s + until ping -c 10 192.168.0.1; do + sleep 1 + if [ \$timeout -le 0 ]; then + echo "${failed}" + exit 1 + fi + ((timeout--)) + done + echo "${passed}" +fi +EOF +chmod +x etc/local.d/xen.start +fakeroot sh -c " + zcat ../rootfs.cpio.gz | cpio -imd + zcat ../xen-tools.cpio.gz | cpio -imd + ldconfig -r . + touch etc/.updated + mkfs.ext4 -d . ../domU-rootfs.img 1024M +" +cd .. +rm -rf rootfs + +# Dom0 rootfs +mkdir -p rootfs +cd rootfs +fakeroot -s ../fakeroot-save sh -c " + zcat ../rootfs.cpio.gz | cpio -imd + zcat ../xen-tools.cpio.gz | cpio -imd + ldconfig -r . + touch etc/.updated +" +mkdir -p root etc/local.d +cat > root/backend.cfg << EOF +name=3D"backend" +memory=3D512 +vcpus=3D1 +kernel=3D"/root/bzImage" +extra=3D"console=3Dhvc0 root=3D/dev/xvda net.ifnames=3D0 test=3Dbackend" +disk=3D[ '/root/domU-rootfs-backend.img,raw,xvda,rw' ] +EOF +cat > root/frontend.cfg << EOF +name=3D"frontend" +memory=3D512 +vcpus=3D1 +kernel=3D"/root/bzImage" +extra=3D"console=3Dhvc0 root=3D/dev/xvda net.ifnames=3D0 test=3Dfrontend" +disk=3D[ '/root/domU-rootfs-frontend.img,raw,xvda,rw' ] +vif=3D[ 'bridge=3Dxenbr0,backend=3Dbackend' ] +EOF + +cat > etc/local.d/xen.start << EOF +#!/bin/bash + +set -x + +bash /etc/init.d/xencommons start + +xl list + +tail -F /var/log/xen/console/guest-backend.log 2>/dev/null | sed -e "s/^/(= backend) /" >>/dev/console & +tail -F /var/log/xen/console/guest-frontend.log 2>/dev/null | sed -e "s/^/= (frontend) /" >>/dev/console & +xl -vvv create /root/backend.cfg +xl -vvv create /root/frontend.cfg +EOF +chmod +x etc/local.d/xen.start + +cp ../domU-rootfs.img ./root/domU-rootfs-backend.img +cp ../domU-rootfs.img ./root/domU-rootfs-frontend.img +cp ../bzImage ./root/ +mkdir -p etc/default +echo 'XENCONSOLED_TRACE=3Dall' >> etc/default/xencommons +mkdir -p var/log/xen/console +fakeroot -i ../fakeroot-save mkfs.ext4 -d . ../dom0-rootfs.img 2048M +cd .. +rm -rf rootfs + +cd .. + +cat >> binaries/pxelinux.0 << EOF +#!ipxe + +kernel xen console=3Dcom1 console_timestamps=3Dboot +module bzImage console=3Dhvc0 root=3D/dev/sda net.ifnames=3D0 +boot +EOF + +# Run the test +rm -f smoke.serial +export TEST_CMD=3D"qemu-system-x86_64 \ + -cpu qemu64,+svm \ + -m 2G -smp 2 \ + -monitor none -serial stdio \ + -nographic \ + -device virtio-net-pci,netdev=3Dn0 \ + -netdev user,id=3Dn0,tftp=3Dbinaries,bootfile=3D/pxelinux.0 \ + -drive file=3Dbinaries/dom0-rootfs.img,format=3Draw" + +export TEST_LOG=3D"smoke.serial" +export BOOT_MSG=3D"Latest ChangeSet: " +export LOG_MSG=3D"Domain-0" +# exit early on test failure too, check if it was success below +export PASSED=3D"$passed|$failed" + +./automation/scripts/console.exp | sed 's/\r\+$//' + +grep "$passed" smoke.serial --=20 git-series 0.9.1