From patchwork Sat Mar 25 21:11:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 13187896 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C850CC6FD1C for ; Sat, 25 Mar 2023 21:12:44 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.514763.797214 (Exim 4.92) (envelope-from ) id 1pgBBZ-0007xV-JU; Sat, 25 Mar 2023 21:12:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 514763.797214; Sat, 25 Mar 2023 21:12:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pgBBZ-0007xO-Fj; Sat, 25 Mar 2023 21:12:25 +0000 Received: by outflank-mailman (input) for mailman id 514763; Sat, 25 Mar 2023 21:12:23 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pgBBX-0007ws-Dd for xen-devel@lists.xenproject.org; Sat, 25 Mar 2023 21:12:23 +0000 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b95de818-cb51-11ed-b464-930f4c7d94ae; Sat, 25 Mar 2023 22:12:18 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id EB3A05C00CD; Sat, 25 Mar 2023 17:12:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 25 Mar 2023 17:12:17 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 25 Mar 2023 17:12:16 -0400 (EDT) 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: b95de818-cb51-11ed-b464-930f4c7d94ae 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:sender :subject:subject:to:to; s=fm2; t=1679778737; x=1679865137; bh=3w s6jUP18muaz1emPu0yGWXPNCRk+TTr+7tv8YnTvmY=; b=QLJAl7nWwTHWtit6LW nCBjCg/Ls7DjU2+m/+49OeLchCeorp8zJIXG8xA1Z6inzyfFZoGY+KCtG9ILgIOF zar3d/HFj5KwMqYq/R8wOei9F+Cpg42nPQ2Ivls0Z+pftjB6wnNSAwv6xCWe4iff 0ptubvgfFUmW0b1BIC1DUe7FSeKS7/iX8Je1844JDlkNdxAHD1EXTQZV7nH3SOZx drc9tp4ZCbN0w3p6y6gRD3lfIb2spXu/qqJ8GKw6NX6C8UhPfvCqX01BpBC9QaAA iSU4aEHAgmOoDCup0c+uRrz45zPso654vgaU5pKl3WJ4qQdK1H7Vqz6AS/zu+Igw 4jTg== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1679778737; x=1679865137; bh=3ws6jUP18muaz1emPu0yGWXPNCRk+TTr+7t v8YnTvmY=; b=HXQe191G7Luh8zFcoaE+pAQ6wT4G58910hljHNNT60G63SB3eZ7 m50bl1L4+Q5tsBSrCJBcWpJ/mt4KomKrg9wvyrJE/TYOj/l8LgA8tvjC0ookqf7p Qt0UIJO6IKHlpuBw5LSaSkURVlmM9A6GbohlAnc7jYud9G3wlYLDXRVBVsb9SOwb JxvgO4PcREpSMQrGrsLS+6Sjiv29T0Z1PMutH0RdM+gJpoGh2lxaT9GeGsSzHuQB xE7tfDU/DaVHsiOTNV0rWvpQGwjXrv4WbZS9kvuXdLJWs691nk6Oh/78o63bUDTK e+cQEDjidgLp9/yc67H0ZWVyUoThoq7pRmw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdegkedgudeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepofgr rhgvkhcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomhgrrhhmrghrvghkse hinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhep gfelgffgueffgeejudehieegteeugeefkeejtefghfdvieffieeijefgudeikeegnecuff homhgrihhnpehgihhtlhgrsgdrtghomhdpkhgvrhhnvghlrdhorhhgnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinh hvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , =?utf-8?q?Marek_Marczyk?= =?utf-8?q?owski-G=C3=B3recki?= , Doug Goldstein , Stefano Stabellini Subject: [PATCH v2 1/2] automation: update x86-64 tests to Linux 6.1.19 Date: Sat, 25 Mar 2023 22:11:57 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 It will be used in tests added in subsequent patches. Enable config options needed for those tests. While at it, migrate all the x86 tests to the newer kernel, and introduce x86-64-test-needs to allow deduplication later (for now it's used only once). Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Stefano Stabellini --- v2: - replace 5.10.74 with 6.1.19 in all the tests - introduce x86-64-test-needs --- automation/gitlab-ci/build.yaml | 4 +- automation/gitlab-ci/test.yaml | 7 +- automation/tests-artifacts/kernel/5.10.74.dockerfile | 38 +------------ automation/tests-artifacts/kernel/6.1.19.dockerfile | 40 +++++++++++++- 4 files changed, 47 insertions(+), 42 deletions(-) delete mode 100644 automation/tests-artifacts/kernel/5.10.74.dockerfile create mode 100644 automation/tests-artifacts/kernel/6.1.19.dockerfile diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml index 820cc0af83bd..0817f110556e 100644 --- a/automation/gitlab-ci/build.yaml +++ b/automation/gitlab-ci/build.yaml @@ -798,9 +798,9 @@ alpine-3.12-rootfs-export: tags: - x86_64 -kernel-5.10.74-export: +kernel-6.1.19-export: extends: .test-jobs-artifact-common - image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:5.10.74 + image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.1.19 script: - mkdir binaries && cp /bzImage binaries/bzImage artifacts: diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index d75662358f34..ee9e3210772b 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -15,6 +15,10 @@ .arm32-test-needs: &arm32-test-needs - qemu-system-aarch64-6.0.0-arm32-export +.x86-64-test-needs: &x86-64-test-needs + - alpine-3.12-rootfs-export + - kernel-6.1.19-export + .qemu-arm64: extends: .test-jobs-common variables: @@ -299,9 +303,8 @@ qemu-alpine-x86_64-gcc: script: - ./automation/scripts/qemu-alpine-x86_64.sh 2>&1 | tee ${LOGFILE} needs: + - *x86-64-test-needs - alpine-3.12-gcc - - alpine-3.12-rootfs-export - - kernel-5.10.74-export qemu-smoke-x86-64-gcc: extends: .qemu-x86-64 diff --git a/automation/tests-artifacts/kernel/5.10.74.dockerfile b/automation/tests-artifacts/kernel/5.10.74.dockerfile deleted file mode 100644 index 112e27fe45e1..000000000000 --- a/automation/tests-artifacts/kernel/5.10.74.dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM debian:unstable -LABEL maintainer.name="The Xen Project" \ - maintainer.email="xen-devel@lists.xenproject.org" - -ENV DEBIAN_FRONTEND=noninteractive -ENV LINUX_VERSION=5.10.74 -ENV USER root - -RUN mkdir /build -WORKDIR /build - -# build depends -RUN apt-get update && \ - apt-get --quiet --yes install \ - build-essential \ - libssl-dev \ - bc \ - curl \ - flex \ - bison \ - libelf-dev \ - && \ - apt-get autoremove -y && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/* - -# Build the kernel -RUN curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-"$LINUX_VERSION".tar.xz && \ - tar xvJf linux-"$LINUX_VERSION".tar.xz && \ - cd linux-"$LINUX_VERSION" && \ - make defconfig && \ - make xen.config && \ - cp .config .config.orig && \ - cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \ - make -j$(nproc) bzImage && \ - cp arch/x86/boot/bzImage / && \ - cd /build && \ - rm -rf linux-"$LINUX_VERSION"* diff --git a/automation/tests-artifacts/kernel/6.1.19.dockerfile b/automation/tests-artifacts/kernel/6.1.19.dockerfile new file mode 100644 index 000000000000..c2171555a0a6 --- /dev/null +++ b/automation/tests-artifacts/kernel/6.1.19.dockerfile @@ -0,0 +1,40 @@ +FROM debian:unstable +LABEL maintainer.name="The Xen Project" \ + maintainer.email="xen-devel@lists.xenproject.org" + +ENV DEBIAN_FRONTEND=noninteractive +ENV LINUX_VERSION=6.1.19 +ENV USER root + +RUN mkdir /build +WORKDIR /build + +# build depends +RUN apt-get update && \ + apt-get --quiet --yes install \ + build-essential \ + libssl-dev \ + bc \ + curl \ + flex \ + bison \ + libelf-dev \ + && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/* + +# Build the kernel +RUN curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \ + tar xvJf linux-"$LINUX_VERSION".tar.xz && \ + cd linux-"$LINUX_VERSION" && \ + make defconfig && \ + make xen.config && \ + scripts/config --enable BRIDGE && \ + scripts/config --enable IGC && \ + cp .config .config.orig && \ + cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \ + make -j$(nproc) bzImage && \ + cp arch/x86/boot/bzImage / && \ + cd /build && \ + rm -rf linux-"$LINUX_VERSION"* From patchwork Sat Mar 25 21:11:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 13187895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86FCBC6FD20 for ; Sat, 25 Mar 2023 21:12:44 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.514765.797224 (Exim 4.92) (envelope-from ) id 1pgBBa-00084b-4J; Sat, 25 Mar 2023 21:12:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 514765.797224; Sat, 25 Mar 2023 21:12:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pgBBZ-00082O-UH; Sat, 25 Mar 2023 21:12:25 +0000 Received: by outflank-mailman (input) for mailman id 514765; Sat, 25 Mar 2023 21:12:24 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pgBBY-0007ws-5B for xen-devel@lists.xenproject.org; Sat, 25 Mar 2023 21:12:24 +0000 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ba25b3f5-cb51-11ed-b464-930f4c7d94ae; Sat, 25 Mar 2023 22:12:20 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3801B5C00B5; Sat, 25 Mar 2023 17:12:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 25 Mar 2023 17:12:19 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 25 Mar 2023 17:12:18 -0400 (EDT) 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: ba25b3f5-cb51-11ed-b464-930f4c7d94ae 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:sender :subject:subject:to:to; s=fm2; t=1679778739; x=1679865139; bh=rQ U/oIGJKx7QRLBl4pp3Y5lNJCa59jcwnxSYsouhR5M=; b=RkMIhFzatDuVqb2sG1 teSfKul/D948EjL8c0lmc+E7kBtPZZxFjphOyAn37Bg5XJWiLXpELphFKMLDMWjE xBOKDh6OXOzFx3iRePUkEQ/GXhOA321nXtvC34/A9iFp3e4RW6JivSLFso4hd9sK FU9MwHS2Y3qn+u565DeIUng5RkcSoSXqaWtP1Vw4iVrPBZqos3CPmgxc5Xf81aZN JeslJk4Vrq8XUC+qw4J2gxDDb0Z9QhHWe29Rmj8OBBWW0hHmkO7qWrJ8GxhK/pYQ +wqOAwzv978h1XhEuukWasftO4Ksr16tFN7WdIf2u2eoO3W7K7pQ1uAVmTCtD03K d2fA== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1679778739; x=1679865139; bh=rQU/oIGJKx7QRLBl4pp3Y5lNJCa59jcwnxS YsouhR5M=; b=H2jGhoAl+rl+fXvaMNyNOWcy+tkN+Xop/UwFdBKQgrvhUPfax91 acEuYlch8aUZc/T5EQ12vgQiwZE8dydabtBlrgcX4z0Hky7sEteQbKeCFtqDhYII FlyKzCU7VGCennrbdhm6hIPUdRX/6mODSgrncrs+WbfrzNcVDCePBeIg1jctVb8M WgG3dE3c+sn4L52hIGg5DAX5sp3msOh0Q9u75bsZ+/PYNhn7xHv+f7XegQ+Xwb5h edpqhJk6SA4aCdojyr7QdlUxY1296MpnNC2XiByLPt6peCN4t2gwI8lxw0mawP1B Bfyc1aKeBcj3SYFEWhQCeSjDao0/iug52Jg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdegkedgudeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepofgr rhgvkhcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomhgrrhhmrghrvghkse hinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhep feeivdeijeeggfeggffgiefhkeetgefhveekuddugeejlefgfeetvdelvdeuvdejnecuff homhgrihhnpehquhgsvghsqdhoshdrohhrghenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthh hinhhgshhlrggsrdgtohhm X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , =?utf-8?q?Marek_Marczyk?= =?utf-8?q?owski-G=C3=B3recki?= , Doug Goldstein , Stefano Stabellini Subject: [PATCH v2 2/2] automation: add a smoke and suspend test on an Alder Lake system Date: Sat, 25 Mar 2023 22:11:58 +0100 Message-Id: <6997fb7c3a40da23683bb0ca1961de40376e71a8.1679778534.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 This is a first test using Qubes OS CI infra. The gitlab-runner has access to ssh-based control interface (control@thor.testnet, ssh key exposed to the test via ssh-agent) and pre-configured HTTP dir for boot files (mapped under /scratch/gitlab-runner/tftp inside the container). Details about the setup are described on https://www.qubes-os.org/news/2022/05/05/automated-os-testing-on-physical-laptops/ There are two test. First is a simple dom0+domU boot smoke test, similar to other existing tests. The second is one boots Xen, and try if S3 works. It runs on a ADL-based desktop system. The test script is based on the Xilinx one. The machine needs newer kernel than other x86 tests run, so use 6.1.x kernel added in previous commit. The usage of fakeroot is necessary to preserve device nodes (/dev/null etc) when repacking rootfs. The test runs in a rootless podman container, which doesn't have full root permissions. BTW the same applies to docker with user namespaces enabled (but it's only opt-in feature there). Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Stefano Stabellini --- v2: - install test deps in dockerfile - rename test script - add smoke test too (reusing the same script with different argument) - use CONTROLLER variable for ssh target - explain fakeroot usage - replace final "sleep 30" with polling + timeout --- automation/build/alpine/3.12-arm64v8.dockerfile | 3 +- automation/gitlab-ci/test.yaml | 33 +++- automation/scripts/qubes-x86-64.sh | 174 +++++++++++++++++- 3 files changed, 210 insertions(+) create mode 100755 automation/scripts/qubes-x86-64.sh diff --git a/automation/build/alpine/3.12-arm64v8.dockerfile b/automation/build/alpine/3.12-arm64v8.dockerfile index 180c978964aa..3f1e6a3fc6df 100644 --- a/automation/build/alpine/3.12-arm64v8.dockerfile +++ b/automation/build/alpine/3.12-arm64v8.dockerfile @@ -41,3 +41,6 @@ RUN apk --no-cache add \ libattr \ libcap-ng-dev \ pixman-dev \ + # qubes test deps + openssh-client \ + fakeroot \ diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index ee9e3210772b..0916b367ea90 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -88,6 +88,23 @@ tags: - xilinx +.adl-x86-64: + extends: .test-jobs-common + variables: + # the test controller runs on RPi4 + CONTAINER: alpine:3.12-arm64v8 + LOGFILE: smoke-test.log + artifacts: + paths: + - smoke.serial + - '*.log' + when: always + only: + variables: + - $QUBES_JOBS == "true" && $CI_COMMIT_REF_PROTECTED == "true" + tags: + - qubes-hw2 + # Test jobs build-each-commit-gcc: extends: .test-jobs-common @@ -114,6 +131,22 @@ xilinx-smoke-dom0less-arm64-gcc: - *arm64-test-needs - alpine-3.12-gcc-arm64 +adl-smoke-x86-64-gcc: + extends: .adl-x86-64 + script: + - ./automation/scripts/qubes-x86-64.sh 2>&1 | tee ${LOGFILE} + needs: + - *x86-64-test-needs + - alpine-3.12-gcc + +adl-suspend-x86-64-gcc: + extends: .adl-x86-64 + script: + - ./automation/scripts/qubes-x86-64.sh s3 2>&1 | tee ${LOGFILE} + needs: + - *x86-64-test-needs + - alpine-3.12-gcc + qemu-smoke-dom0-arm64-gcc: extends: .qemu-arm64 script: diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh new file mode 100755 index 000000000000..2d4cf2e2268c --- /dev/null +++ b/automation/scripts/qubes-x86-64.sh @@ -0,0 +1,174 @@ +#!/bin/sh + +set -ex + +test_variant=$1 + +wait_and_wakeup= +timeout=120 +if [ -z "${test_variant}" ]; then + passed="ping test passed" + domU_check=" +ifconfig eth0 192.168.0.2 +until ping -c 10 192.168.0.1; do + sleep 1 +done +echo \"${passed}\" +" + dom0_check=" +until grep -q \"${passed}\" /var/log/xen/console/guest-domU.log; do + sleep 1 +done +# get domU console content into test log +tail -n 100 /var/log/xen/console/guest-domU.log +echo \"${passed}\" +" +elif [ "${test_variant}" = "s3" ]; then + passed="suspend test passed" + wait_and_wakeup="started, suspending" + domU_check=" +ifconfig eth0 192.168.0.2 +echo domU started +" + dom0_check=" +until grep 'domU started' /var/log/xen/console/guest-domU.log; do + sleep 1 +done +echo \"${wait_and_wakeup}\" +set -x +echo deep > /sys/power/mem_sleep +echo mem > /sys/power/state +# now wait for resume +sleep 5 +# get domU console content into test log +tail -n 100 /var/log/xen/console/guest-domU.log +xl list +xl dmesg | grep 'Finishing wakeup from ACPI S3 state' || exit 1 +# check if domU is still alive +ping -c 10 192.168.0.2 || exit 1 +echo \"${passed}\" +" +fi + +# DomU +mkdir -p rootfs +cd rootfs +# fakeroot is needed to preserve device nodes in rootless podman container +fakeroot -s ../fakeroot-save tar xzf ../binaries/initrd.tar.gz +mkdir proc +mkdir run +mkdir srv +mkdir sys +rm var/run +echo "#!/bin/sh + +${domU_check} +/bin/sh" > etc/local.d/xen.start +chmod +x etc/local.d/xen.start +echo "rc_verbose=yes" >> etc/rc.conf +find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz +cd .. +rm -rf rootfs + +# DOM0 rootfs +mkdir -p rootfs +cd rootfs +fakeroot -s ../fakeroot-save tar xzf ../binaries/initrd.tar.gz +mkdir boot +mkdir proc +mkdir run +mkdir srv +mkdir sys +rm var/run +cp -ar ../binaries/dist/install/* . + +echo "#!/bin/bash + +export LD_LIBRARY_PATH=/usr/local/lib +bash /etc/init.d/xencommons start + +brctl addbr xenbr0 +brctl addif xenbr0 eth0 +ifconfig eth0 up +ifconfig xenbr0 up +ifconfig xenbr0 192.168.0.1 + +xl create /etc/xen/domU.cfg +${dom0_check} +" > etc/local.d/xen.start +chmod +x etc/local.d/xen.start +# just PVH for now +echo ' +type = "pvh" +name = "domU" +kernel = "/boot/vmlinuz" +ramdisk = "/boot/initrd-domU" +extra = "root=/dev/ram0 console=hvc0" +memory = 512 +vif = [ "bridge=xenbr0", ] +disk = [ ] +' > etc/xen/domU.cfg + +echo "rc_verbose=yes" >> etc/rc.conf +echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons +echo "QEMU_XEN=/bin/false" >> etc/default/xencommons +mkdir -p var/log/xen/console +cp ../binaries/bzImage boot/vmlinuz +cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU +find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz +cd .. + + +TFTP=/scratch/gitlab-runner/tftp +CONTROLLER=control@thor.testnet + +echo ' +multiboot2 (http)/gitlab-ci/xen console=com1 com1=115200,8n1 loglvl=all guest_loglvl=all +module2 (http)/gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 +module2 (http)/gitlab-ci/initrd-dom0 +' > $TFTP/grub.cfg + +cp -f binaries/xen $TFTP/xen +cp -f binaries/bzImage $TFTP/vmlinuz +cp -f binaries/dom0-rootfs.cpio.gz $TFTP/initrd-dom0 + +# start logging the serial; this gives interactive console, don't close its +# stdin to not close it; the 'cat' is important, plain redirection would hang +# until somebody opens the pipe; opening and closing the pipe is used to close +# the console +mkfifo /tmp/console-stdin +cat /tmp/console-stdin |\ +ssh $CONTROLLER console | tee smoke.serial & + +# start the system pointing at gitlab-ci predefined config +ssh $CONTROLLER gitlabci poweron +trap "ssh $CONTROLLER poweroff; : > /tmp/console-stdin" EXIT + +if [ -n "$wait_and_wakeup" ]; then + # wait for suspend or a timeout + until grep "$wait_and_wakeup" smoke.serial || [ $timeout -le 0 ]; do + sleep 1; + : $((--timeout)) + done + if [ $timeout -le 0 ]; then + echo "ERROR: suspend timeout, aborting" + exit 1 + fi + # keep it suspended a bit, then wakeup + sleep 30 + ssh $CONTROLLER wake +fi + +until grep "$passed" smoke.serial || [ $timeout -le 0 ]; do + sleep 1; + : $((--timeout)) +done +if [ $timeout -le 0 ]; then + echo "ERROR: test timeout, aborting" + exit 1 +fi + +sleep 1 + +(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1 +exit 0