From patchwork Thu Mar 2 00:57:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 13156614 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 3BAB5C678D4 for ; Thu, 2 Mar 2023 00:57:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.504281.776887 (Exim 4.92) (envelope-from ) id 1pXXGE-0004JR-Fq; Thu, 02 Mar 2023 00:57:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 504281.776887; Thu, 02 Mar 2023 00:57:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pXXGE-0004JK-D8; Thu, 02 Mar 2023 00:57:30 +0000 Received: by outflank-mailman (input) for mailman id 504281; Thu, 02 Mar 2023 00:57:29 +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 1pXXGD-00042w-BD for xen-devel@lists.xenproject.org; Thu, 02 Mar 2023 00:57:29 +0000 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 33c6d130-b895-11ed-a550-8520e6686977; Thu, 02 Mar 2023 01:57:27 +0100 (CET) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 72948B811D5; Thu, 2 Mar 2023 00:57:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 629F5C433EF; Thu, 2 Mar 2023 00:57:25 +0000 (UTC) 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: 33c6d130-b895-11ed-a550-8520e6686977 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677718646; bh=l3p5CzfPCMHZRdXXtESCrWVMuXmzOEmp1Lvn+kITVB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=izzcOEiqP9KlXoUZkB5z8F3fqAXDDdsIU9xC6h4bIWOapRKqAW9rLo3ermWf5GDE9 PBlX73VYgwFE6LewERpJ2aRFogoYkS2eXrfEQKv08QeDHy2y0tUI2yZZvJXd9UlbL3 6NLcQS0JVNFSVlGlqD26CJZZUQpqoKoujH1HLqggfm10PHjdHCAwkNYrBH8zTGv3fb 1WUkZob0EA9P8GLfIoxMpwuCTqeAV6b3MHAoogVuRCo0uXfiEqXD5vgcTgrmxn5Eho mvTFMXbU2oQs/Izg8y+D4ZfTDVz9C59vcxOe/cy9tzh7NXv3JdeTA7wqFA5frYvomQ BK5v2CdfRIKOg== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, cardoe@cardoe.com, michal.orzel@amd.com, Stefano Stabellini Subject: [PATCH 1/2] automation: add Ubuntu container for Xilinx hardware tests Date: Wed, 1 Mar 2023 16:57:21 -0800 Message-Id: <20230302005722.665641-1-sstabellini@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 From: Stefano Stabellini This container is only run on the controller PC (x86) to trigger the test on a connected Xilinx ZCU102 physical board. Signed-off-by: Stefano Stabellini --- .../build/ubuntu/xenial-xilinx.dockerfile | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 automation/build/ubuntu/xenial-xilinx.dockerfile diff --git a/automation/build/ubuntu/xenial-xilinx.dockerfile b/automation/build/ubuntu/xenial-xilinx.dockerfile new file mode 100644 index 0000000000..7e4f5d6605 --- /dev/null +++ b/automation/build/ubuntu/xenial-xilinx.dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:16.04 +LABEL maintainer.name="The Xen Project " \ + maintainer.email="xen-devel@lists.xenproject.org" + +ENV DEBIAN_FRONTEND=noninteractive +ENV USER root + +RUN mkdir /build +WORKDIR /build + +# build depends +RUN apt-get update && \ + apt-get --quiet --yes install \ + snmp \ + snmp-mibs-downloader \ + u-boot-tools \ + device-tree-compiler \ + cpio \ + git \ + gzip \ + file \ + && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/* From patchwork Thu Mar 2 00:57:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 13156615 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 6DDA9C7EE30 for ; Thu, 2 Mar 2023 00:57:41 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.504282.776897 (Exim 4.92) (envelope-from ) id 1pXXGF-0004Z8-N6; Thu, 02 Mar 2023 00:57:31 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 504282.776897; Thu, 02 Mar 2023 00:57: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 1pXXGF-0004Yx-Jt; Thu, 02 Mar 2023 00:57:31 +0000 Received: by outflank-mailman (input) for mailman id 504282; Thu, 02 Mar 2023 00:57:30 +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 1pXXGE-00042w-Bb for xen-devel@lists.xenproject.org; Thu, 02 Mar 2023 00:57:30 +0000 Received: from ams.source.kernel.org (ams.source.kernel.org [2604:1380:4601:e00::1]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 343e63a2-b895-11ed-a550-8520e6686977; Thu, 02 Mar 2023 01:57:28 +0100 (CET) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 44DFAB81181; Thu, 2 Mar 2023 00:57:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EE1AC433D2; Thu, 2 Mar 2023 00:57:26 +0000 (UTC) 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: 343e63a2-b895-11ed-a550-8520e6686977 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677718647; bh=/i3r6ozVQ/rSsz//fvhxWROK5Xc1/AGB+lkdqgory7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZowqZq76Mke1TMpCtvxztUNTe4GylRe2ALex2sM5T4O+X+hB3CrsPIesBpZGXqdbt LMSEFb7RCllisiBPjZER8J3ArBM4QkhQCgQMWVNq/kC8E+rgIOLknMAvd7Fko+U8iq AmO9rwVshYDS+c2Xjl/iZ7FlleYNf3Hc7+H7u0y1FpBzoE9PQcyYe9KuZFQVCQZDpU GoztSYSi858xYpAHEvcRrJT2wEiz9k9o2EKIjljsNdEOnBO7KFLkUO2wXtZZiV07uO QCvcxmKm87ECeMYPKMUV45N4Zcty6U94DNFWTEhgQtesNL2ktmM809GE+ayDOkhBkM 28m5S0F4+0CmA== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, cardoe@cardoe.com, michal.orzel@amd.com, Stefano Stabellini Subject: [PATCH 2/2] automation: introduce a dom0less test run on Xilinx hardware Date: Wed, 1 Mar 2023 16:57:22 -0800 Message-Id: <20230302005722.665641-2-sstabellini@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 From: Stefano Stabellini The test prepares dom0 and domU binaries and boot artifacts, similarly to the existing QEMU test. (TBD: share preparation steps with the regular QEMU tests.) However, instead of running the test inside QEMU as usual, it copies the binaries to the tftp server root, triggers a Xilinx ZCU102 board reboot, and connects to the real serial of the board. For now and due to its novelty, allow_failure on the Xilinx hardware test. Signed-off-by: Stefano Stabellini --- automation/gitlab-ci/test.yaml | 19 +++ .../scripts/xilinx-smoke-dom0less-arm64.sh | 115 ++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100755 automation/scripts/xilinx-smoke-dom0less-arm64.sh diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 1c5f400b68..88bb47f26c 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -85,6 +85,25 @@ build-each-commit-gcc: tags: - x86_64 +xilinx-smoke-dom0less-arm64-gcc: + extends: .test-jobs-common + variables: + CONTAINER: ubuntu:xenial-xilinx + LOGFILE: qemu-smoke-xilinx.log + artifacts: + paths: + - smoke.serial + - '*.log' + when: always + tags: + - xilinx + script: + - ./automation/scripts/xilinx-smoke-dom0less-arm64.sh 2>&1 | tee ${LOGFILE} + needs: + - *arm64-test-needs + - alpine-3.12-gcc-arm64 + allow_failure: true + qemu-smoke-dom0-arm64-gcc: extends: .qemu-arm64 script: diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh new file mode 100755 index 0000000000..180c8b5f1c --- /dev/null +++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh @@ -0,0 +1,115 @@ +#!/bin/bash + +set -ex + +test_variant=$1 + +if [ -z "${test_variant}" ]; then + passed="ping test passed" + domU_check=" +until ifconfig eth0 192.168.0.2 &> /dev/null && ping -c 10 192.168.0.1; do + sleep 30 +done +echo \"${passed}\" +" +fi + +# DomU +mkdir -p rootfs +cd rootfs +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 . | cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz +cd .. +rm -rf rootfs + +# DOM0 rootfs +mkdir -p rootfs +cd rootfs +tar xzf ../binaries/initrd.tar.gz +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 + +/usr/local/lib/xen/bin/init-dom0less + +brctl addbr xenbr0 +brctl addif xenbr0 eth0 +ifconfig eth0 up +ifconfig xenbr0 up +ifconfig xenbr0 192.168.0.1 + +xl network-attach 1 type=vif +${dom0_check} +" > etc/local.d/xen.start +chmod +x etc/local.d/xen.start +echo "rc_verbose=yes" >> etc/rc.conf +find . | cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz +cd .. + + +TFTP=/scratch/gitlab-runner/tftp +START=`pwd` + +# ImageBuilder +echo 'MEMORY_START="0" +MEMORY_END="0xC0000000" + +DEVICE_TREE="mpsoc.dtb" +XEN="xen" +DOM0_KERNEL="Image" +DOM0_RAMDISK="dom0-rootfs.cpio.gz" +XEN_CMD="console=dtuart dom0_mem=1024M" + +NUM_DOMUS=1 +DOMU_KERNEL[0]="Image" +DOMU_RAMDISK[0]="domU-rootfs.cpio.gz" +DOMU_MEM[0]="1024" + +LOAD_CMD="tftpb" +UBOOT_SOURCE="boot.source" +UBOOT_SCRIPT="boot.scr"' > $TFTP/config + +cp -f binaries/xen $TFTP/ +cp -f binaries/Image $TFTP/ +cp -f binaries/dom0-rootfs.cpio.gz $TFTP/ +cp -f binaries/domU-rootfs.cpio.gz $TFTP/ + +rm -rf imagebuilder +git clone https://gitlab.com/ViryaOS/imagebuilder +bash imagebuilder/scripts/uboot-script-gen -t tftp -d $TFTP/ -c $TFTP/config + +# restart the board +cd /scratch/gitlab-runner +bash zcu102.sh 2 +sleep 5 +bash zcu102.sh 1 +sleep 5 +cd $START + +# connect to serial +set +e +stty -F /dev/ttyUSB0 115200 +timeout -k 1 120 nohup sh -c "cat /dev/ttyUSB0 | tee smoke.serial" + +set -e +(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1 +exit 0