* [PATCH v3 0/3] automation: add arm32 xl domU creation test
@ 2023-02-18 0:07 Stefano Stabellini
2023-02-18 0:07 ` [PATCH v3 1/3] automation: move yocto jobs to build stage Stefano Stabellini
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Stefano Stabellini @ 2023-02-18 0:07 UTC (permalink / raw
To: xen-devel; +Cc: sstabellini, cardoe, michal.orzel
Hi all,
This patch series add a domU creation test based on xl for arm32. To do
that, it reuses the existing arm32 dom0 test, and also reuses the Yocto
qemuarm build output.
Pipeline (with reduced amount of jobs):
https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/781740574
Cheers,
Stefano
Stefano Stabellini (3):
automation: move yocto jobs to build stage
automation: add binaries/ to artifacts for Yocto arm32 job
automation: expand arm32 dom0 test adding xl domain creation
automation/build/yocto/build-yocto.sh | 16 +++++++++
automation/gitlab-ci/build.yaml | 53 +++++++++++++++++++++++++++
automation/gitlab-ci/test.yaml | 56 ++---------------------------
automation/scripts/qemu-smoke-dom0-arm32.sh | 52 ++++++++++++++++++++-------
4 files changed, 110 insertions(+), 67 deletions(-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3 1/3] automation: move yocto jobs to build stage
2023-02-18 0:07 [PATCH v3 0/3] automation: add arm32 xl domU creation test Stefano Stabellini
@ 2023-02-18 0:07 ` Stefano Stabellini
2023-02-18 0:07 ` [PATCH v3 2/3] automation: add binaries/ to artifacts for Yocto arm32 job Stefano Stabellini
2023-02-18 0:07 ` [PATCH v3 3/3] automation: expand arm32 dom0 test adding xl domain creation Stefano Stabellini
2 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2023-02-18 0:07 UTC (permalink / raw
To: xen-devel; +Cc: sstabellini, cardoe, michal.orzel, Stefano Stabellini
From: Stefano Stabellini <stefano.stabellini@amd.com>
We are going to use artifacts produced by the Yocto builds in test jobs.
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
automation/gitlab-ci/build.yaml | 51 +++++++++++++++++++++++++++++++++
automation/gitlab-ci/test.yaml | 45 -----------------------------
2 files changed, 51 insertions(+), 45 deletions(-)
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 079e9b73f6..b6ae1c663b 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -199,6 +199,41 @@
variables:
<<: *gcc
+.yocto-test:
+ stage: build
+ image: registry.gitlab.com/xen-project/xen/${CONTAINER}
+ except:
+ - master
+ - smoke
+ - /^coverity-tested\/.*/
+ - /^stable-.*/
+ script:
+ - ./automation/build/yocto/build-yocto.sh -v --log-dir=./logs --xen-dir=`pwd` ${YOCTO_BOARD}
+ variables:
+ YOCTO_VERSION: kirkstone
+ CONTAINER: yocto:${YOCTO_VERSION}-${YOCTO_BOARD}-${YOCTO_HOST}
+ artifacts:
+ paths:
+ - 'logs/*'
+ when: always
+ needs: []
+
+.yocto-test-arm64:
+ extends: .yocto-test
+ variables:
+ YOCTO_HOST: arm64v8
+ tags:
+ - arm64
+
+# This is not used by any test job as we only run Yocto on arm based machines.
+# Keep it here so that someone having x86 hardware can easily add jobs.
+.yocto-test-x86-64:
+ extends: .yocto-test
+ variables:
+ YOCTO_HOST: amd64
+ tags:
+ - x86_64
+
# Jobs below this line
archlinux-gcc:
@@ -699,6 +734,22 @@ archlinux-current-gcc-riscv64-debug-randconfig:
EXTRA_FIXED_RANDCONFIG:
CONFIG_COVERAGE=n
+# Yocto test jobs
+yocto-qemuarm64:
+ extends: .yocto-test-arm64
+ variables:
+ YOCTO_BOARD: qemuarm64
+
+yocto-qemuarm:
+ extends: .yocto-test-arm64
+ variables:
+ YOCTO_BOARD: qemuarm
+
+yocto-qemux86-64:
+ extends: .yocto-test-arm64
+ variables:
+ YOCTO_BOARD: qemux86-64
+
## Test artifacts common
.test-jobs-artifact-common:
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index c0b4a90e0d..00273b21c8 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -67,35 +67,6 @@
tags:
- x86_64
-.yocto-test:
- extends: .test-jobs-common
- script:
- - ./automation/build/yocto/build-yocto.sh -v --log-dir=./logs --xen-dir=`pwd` ${YOCTO_BOARD}
- variables:
- YOCTO_VERSION: kirkstone
- CONTAINER: yocto:${YOCTO_VERSION}-${YOCTO_BOARD}-${YOCTO_HOST}
- artifacts:
- paths:
- - 'logs/*'
- when: always
- needs: []
-
-.yocto-test-arm64:
- extends: .yocto-test
- variables:
- YOCTO_HOST: arm64v8
- tags:
- - arm64
-
-# This is not used by any test job as we only run Yocto on arm based machines.
-# Keep it here so that someone having x86 hardware can easily add jobs.
-.yocto-test-x86-64:
- extends: .yocto-test
- variables:
- YOCTO_HOST: amd64
- tags:
- - x86_64
-
# Test jobs
build-each-commit-gcc:
extends: .test-jobs-common
@@ -317,19 +288,3 @@ qemu-smoke-riscv64-gcc:
- ./automation/scripts/qemu-smoke-riscv64.sh 2>&1 | tee ${LOGFILE}
needs:
- archlinux-current-gcc-riscv64-debug
-
-# Yocto test jobs
-yocto-qemuarm64:
- extends: .yocto-test-arm64
- variables:
- YOCTO_BOARD: qemuarm64
-
-yocto-qemuarm:
- extends: .yocto-test-arm64
- variables:
- YOCTO_BOARD: qemuarm
-
-yocto-qemux86-64:
- extends: .yocto-test-arm64
- variables:
- YOCTO_BOARD: qemux86-64
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3 2/3] automation: add binaries/ to artifacts for Yocto arm32 job
2023-02-18 0:07 [PATCH v3 0/3] automation: add arm32 xl domU creation test Stefano Stabellini
2023-02-18 0:07 ` [PATCH v3 1/3] automation: move yocto jobs to build stage Stefano Stabellini
@ 2023-02-18 0:07 ` Stefano Stabellini
2023-02-24 9:56 ` Michal Orzel
2023-02-18 0:07 ` [PATCH v3 3/3] automation: expand arm32 dom0 test adding xl domain creation Stefano Stabellini
2 siblings, 1 reply; 6+ messages in thread
From: Stefano Stabellini @ 2023-02-18 0:07 UTC (permalink / raw
To: xen-devel; +Cc: sstabellini, cardoe, michal.orzel, Stefano Stabellini
From: Stefano Stabellini <stefano.stabellini@amd.com>
Copy the build output of Yocto builds to binaries/ for the arm32 target,
and export binaries/ among the jobs artifacts so that they can be reused
by other jobs.
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
Changes in v2:
- add --copy-output so that whether the binaries get copied or not is
user selectable
- rename OUTPUT to OUTPUTDIR and move it up in the file
---
automation/build/yocto/build-yocto.sh | 16 ++++++++++++++++
automation/gitlab-ci/build.yaml | 4 +++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/automation/build/yocto/build-yocto.sh b/automation/build/yocto/build-yocto.sh
index 3601cebc3c..93ce81ce82 100755
--- a/automation/build/yocto/build-yocto.sh
+++ b/automation/build/yocto/build-yocto.sh
@@ -18,6 +18,7 @@ CACHEDIR="$HOME/yocto-cache"
LOGDIR="$HOME/logs"
XENDIR="$HOME/xen"
BUILDDIR="$HOME/build"
+OUTPUTDIR=`pwd`/binaries
# what yocto bsp we support
TARGET_SUPPORTED="qemuarm qemuarm64 qemux86-64"
@@ -31,6 +32,7 @@ do_build="y"
do_run="y"
do_localsrc="n"
do_dump="n"
+do_copy="n"
build_result=0
# layers to include in the project
@@ -166,6 +168,16 @@ function project_build() {
source "${YOCTODIR}/poky/oe-init-build-env" "${destdir}"
bitbake "${build_image}" || exit 1
+ if [ $do_copy = "y" ]
+ then
+ if [ $target = "qemuarm" ]
+ then
+ mkdir -p $OUTPUTDIR
+ cp $BUILDDIR/tmp/deploy/images/qemuarm/zImage $OUTPUTDIR
+ cp $BUILDDIR/tmp/deploy/images/qemuarm/xen-qemuarm $OUTPUTDIR
+ cp $BUILDDIR/tmp/deploy/images/qemuarm/xen-image-minimal-qemuarm.tar.bz2 $OUTPUTDIR
+ fi
+ fi
) || return 1
}
@@ -235,6 +247,7 @@ Options:
Default: ${CACHEDIR}
--layer-dir=DIR directory containing the checkout of yocto layers
Default: ${YOCTODIR}
+ --copy-output Copy output binaries to binaries/
EOF
}
@@ -290,6 +303,9 @@ do
--layer-dir=*)
YOCTODIR="${OPTION#*=}"
;;
+ --copy-output)
+ do_copy="y"
+ ;;
--*)
echo "Invalid option ${OPTION}"
help
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index b6ae1c663b..d731642785 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -208,13 +208,14 @@
- /^coverity-tested\/.*/
- /^stable-.*/
script:
- - ./automation/build/yocto/build-yocto.sh -v --log-dir=./logs --xen-dir=`pwd` ${YOCTO_BOARD}
+ - ./automation/build/yocto/build-yocto.sh -v --log-dir=./logs --xen-dir=`pwd` ${YOCTO_BOARD} ${YOCTO_OUTPUT}
variables:
YOCTO_VERSION: kirkstone
CONTAINER: yocto:${YOCTO_VERSION}-${YOCTO_BOARD}-${YOCTO_HOST}
artifacts:
paths:
- 'logs/*'
+ - binaries/
when: always
needs: []
@@ -744,6 +745,7 @@ yocto-qemuarm:
extends: .yocto-test-arm64
variables:
YOCTO_BOARD: qemuarm
+ YOCTO_OUTPUT: --copy-output
yocto-qemux86-64:
extends: .yocto-test-arm64
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3 3/3] automation: expand arm32 dom0 test adding xl domain creation
2023-02-18 0:07 [PATCH v3 0/3] automation: add arm32 xl domU creation test Stefano Stabellini
2023-02-18 0:07 ` [PATCH v3 1/3] automation: move yocto jobs to build stage Stefano Stabellini
2023-02-18 0:07 ` [PATCH v3 2/3] automation: add binaries/ to artifacts for Yocto arm32 job Stefano Stabellini
@ 2023-02-18 0:07 ` Stefano Stabellini
2023-02-24 10:08 ` Michal Orzel
2 siblings, 1 reply; 6+ messages in thread
From: Stefano Stabellini @ 2023-02-18 0:07 UTC (permalink / raw
To: xen-devel; +Cc: sstabellini, cardoe, michal.orzel, Stefano Stabellini
From: Stefano Stabellini <stefano.stabellini@amd.com>
As part of the arm32 dom0 test, also create a simple domU using xl. To
do that, we need the toolstack installed in the dom0 rootfs. We switch
to using the kernel and rootfs built by the Yocto arm32 job.
Remove the PCI node from the host device tree: it is unused but causes a
Linux hang at boot.
Use xen-watchdog to trigger the domU creation for convience
(/etc/local.d is not handled by rootfs.)
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
Changes in v2:
- remove unsued debian-unstable-gcc-arm32 dependency for
qemu-smoke-dom0-arm32-gcc
- remove job qemu-smoke-dom0-arm32-gcc-debug as it doesn't make sense
anymore
- grep for both dom0 and domU prompts in qemu-smoke-dom0-arm32.sh
---
automation/gitlab-ci/test.yaml | 11 +----
automation/scripts/qemu-smoke-dom0-arm32.sh | 52 +++++++++++++++------
2 files changed, 41 insertions(+), 22 deletions(-)
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 00273b21c8..6d09c97702 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -171,15 +171,7 @@ qemu-smoke-dom0-arm32-gcc:
- ./automation/scripts/qemu-smoke-dom0-arm32.sh 2>&1 | tee ${LOGFILE}
needs:
- *arm32-test-needs
- - debian-unstable-gcc-arm32
-
-qemu-smoke-dom0-arm32-gcc-debug:
- extends: .qemu-arm32
- script:
- - ./automation/scripts/qemu-smoke-dom0-arm32.sh 2>&1 | tee ${LOGFILE}
- needs:
- - *arm32-test-needs
- - debian-unstable-gcc-arm32-debug
+ - yocto-qemuarm
qemu-smoke-dom0less-arm32-gcc:
extends: .qemu-arm32
@@ -244,6 +236,7 @@ qemu-smoke-dom0less-arm32-gcc-debug-without-dom0:
needs:
- *arm32-test-needs
- debian-unstable-gcc-arm32-debug
+ - yocto-qemuarm
qemu-alpine-x86_64-gcc:
extends: .qemu-x86-64
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index 98e4d481f6..2c80df089f 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -3,14 +3,37 @@
set -ex
cd binaries
-# Use the kernel from Debian
-curl --fail --silent --show-error --location --output vmlinuz http://http.us.debian.org/debian/dists/bullseye/main/installer-armhf/current/images/netboot/vmlinuz
-# Use a tiny initrd based on busybox from Alpine Linux
-curl --fail --silent --show-error --location --output initrd.tar.gz https://dl-cdn.alpinelinux.org/alpine/v3.15/releases/armhf/alpine-minirootfs-3.15.1-armhf.tar.gz
+mkdir rootfs
+cd rootfs
+tar xvf ../xen-image-minimal-qemuarm.tar.bz2
+mkdir -p ./root
+echo "name=\"test\"
+memory=400
+vcpus=1
+kernel=\"/root/zImage\"
+ramdisk=\"/root/initrd.cpio.gz\"
+extra=\"console=hvc0 root=/dev/ram0 rdinit=/bin/sh\"
+" > root/test.cfg
+echo "#!/bin/bash
+
+xl list
+
+xl create -c /root/test.cfg
+
+" > ./root/xen.start
+echo "bash /root/xen.start" >> ./etc/init.d/xen-watchdog
+
+curl --fail --silent --show-error --location --output initrd.tar.gz https://dl-cdn.alpinelinux.org/alpine/v3.15/releases/armhf/alpine-minirootfs-3.15.1-armhf.tar.gz
mkdir rootfs
cd rootfs
tar xvzf ../initrd.tar.gz
+find . | cpio -H newc -o | gzip > ../root/initrd.cpio.gz
+cd ..
+rm -rf rootfs
+rm initrd.tar.gz
+
+cp ../zImage ./root
find . | cpio -H newc -o | gzip > ../initrd.gz
cd ..
@@ -20,22 +43,25 @@ curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-machine virt \
-machine virtualization=true \
-smp 4 \
- -m 1024 \
+ -m 2048 \
-serial stdio \
-monitor none \
-display none \
-machine dumpdtb=virt.dtb
+# XXX disable pci to avoid Linux hang
+fdtput virt.dtb -p -t s /pcie@10000000 status disabled
+
# ImageBuilder
echo 'MEMORY_START="0x40000000"
-MEMORY_END="0x80000000"
+MEMORY_END="0xC0000000"
DEVICE_TREE="virt.dtb"
-XEN="xen"
-DOM0_KERNEL="vmlinuz"
+XEN="xen-qemuarm"
+DOM0_KERNEL="zImage"
DOM0_RAMDISK="initrd.gz"
-DOM0_CMD="console=hvc0 earlyprintk clk_ignore_unused root=/dev/ram0 rdinit=/bin/sh"
-XEN_CMD="console=dtuart dom0_mem=512M bootscrub=0"
+DOM0_CMD="console=hvc0 earlyprintk clk_ignore_unused root=/dev/ram0 rdinit=/sbin/init"
+XEN_CMD="console=dtuart dom0_mem=1024M bootscrub=0"
NUM_DOMUS=0
@@ -51,12 +77,12 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
rm -f smoke.serial
set +e
echo " virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
-timeout -k 1 240 \
+timeout -k 1 720 \
./qemu-system-arm \
-machine virt \
-machine virtualization=true \
-smp 4 \
- -m 1024 \
+ -m 2048 \
-serial stdio \
-monitor none \
-display none \
@@ -66,5 +92,5 @@ timeout -k 1 240 \
-bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& tee smoke.serial
set -e
-(grep -q "^/ #" smoke.serial) || exit 1
+(grep -q "Domain-0" smoke.serial && grep -q "^/ #" smoke.serial) || exit 1
exit 0
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3 2/3] automation: add binaries/ to artifacts for Yocto arm32 job
2023-02-18 0:07 ` [PATCH v3 2/3] automation: add binaries/ to artifacts for Yocto arm32 job Stefano Stabellini
@ 2023-02-24 9:56 ` Michal Orzel
0 siblings, 0 replies; 6+ messages in thread
From: Michal Orzel @ 2023-02-24 9:56 UTC (permalink / raw
To: Stefano Stabellini, xen-devel; +Cc: cardoe, Stefano Stabellini
Hi Stefano,
On 18/02/2023 01:07, Stefano Stabellini wrote:
>
>
> From: Stefano Stabellini <stefano.stabellini@amd.com>
>
> Copy the build output of Yocto builds to binaries/ for the arm32 target,
> and export binaries/ among the jobs artifacts so that they can be reused
> by other jobs.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
~Michal
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 3/3] automation: expand arm32 dom0 test adding xl domain creation
2023-02-18 0:07 ` [PATCH v3 3/3] automation: expand arm32 dom0 test adding xl domain creation Stefano Stabellini
@ 2023-02-24 10:08 ` Michal Orzel
0 siblings, 0 replies; 6+ messages in thread
From: Michal Orzel @ 2023-02-24 10:08 UTC (permalink / raw
To: Stefano Stabellini, xen-devel; +Cc: cardoe, Stefano Stabellini
Hi Stefano,
On 18/02/2023 01:07, Stefano Stabellini wrote:
>
>
> From: Stefano Stabellini <stefano.stabellini@amd.com>
>
> As part of the arm32 dom0 test, also create a simple domU using xl. To
> do that, we need the toolstack installed in the dom0 rootfs. We switch
> to using the kernel and rootfs built by the Yocto arm32 job.
>
> Remove the PCI node from the host device tree: it is unused but causes a
> Linux hang at boot.
>
> Use xen-watchdog to trigger the domU creation for convience
> (/etc/local.d is not handled by rootfs.)
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> ---
> Changes in v2:
> - remove unsued debian-unstable-gcc-arm32 dependency for
> qemu-smoke-dom0-arm32-gcc
> - remove job qemu-smoke-dom0-arm32-gcc-debug as it doesn't make sense
> anymore
> - grep for both dom0 and domU prompts in qemu-smoke-dom0-arm32.sh
> ---
> automation/gitlab-ci/test.yaml | 11 +----
> automation/scripts/qemu-smoke-dom0-arm32.sh | 52 +++++++++++++++------
> 2 files changed, 41 insertions(+), 22 deletions(-)
>
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index 00273b21c8..6d09c97702 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -171,15 +171,7 @@ qemu-smoke-dom0-arm32-gcc:
> - ./automation/scripts/qemu-smoke-dom0-arm32.sh 2>&1 | tee ${LOGFILE}
> needs:
> - *arm32-test-needs
> - - debian-unstable-gcc-arm32
> -
> -qemu-smoke-dom0-arm32-gcc-debug:
> - extends: .qemu-arm32
> - script:
> - - ./automation/scripts/qemu-smoke-dom0-arm32.sh 2>&1 | tee ${LOGFILE}
> - needs:
> - - *arm32-test-needs
> - - debian-unstable-gcc-arm32-debug
> + - yocto-qemuarm
>
> qemu-smoke-dom0less-arm32-gcc:
> extends: .qemu-arm32
> @@ -244,6 +236,7 @@ qemu-smoke-dom0less-arm32-gcc-debug-without-dom0:
> needs:
> - *arm32-test-needs
> - debian-unstable-gcc-arm32-debug
> + - yocto-qemuarm
I assume this was placed here by accident as this is a dom0less arm32 test.
With this removed:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
~Michal
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-02-24 10:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-18 0:07 [PATCH v3 0/3] automation: add arm32 xl domU creation test Stefano Stabellini
2023-02-18 0:07 ` [PATCH v3 1/3] automation: move yocto jobs to build stage Stefano Stabellini
2023-02-18 0:07 ` [PATCH v3 2/3] automation: add binaries/ to artifacts for Yocto arm32 job Stefano Stabellini
2023-02-24 9:56 ` Michal Orzel
2023-02-18 0:07 ` [PATCH v3 3/3] automation: expand arm32 dom0 test adding xl domain creation Stefano Stabellini
2023-02-24 10:08 ` Michal Orzel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).