Xen-Devel Archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] automation: dom0less arm32 testing
@ 2023-02-14 15:38 Michal Orzel
  2023-02-14 15:38 ` [PATCH v2 1/5] automation: Switch arm32 cross builds to run on arm64 Michal Orzel
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Michal Orzel @ 2023-02-14 15:38 UTC (permalink / raw
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini

This patch series aims at improving the arm32 CI testing by introducing
the dom0less-based tests. It creates a foundation for further test expansion.
This is particularly important now, when OSSTEST arm32 stuff is down and we
need to have at least some coverage in gitlab CI.

Note:
First patch is added to the series for convenience. It switches the arm32
cross builds to be executed on arm64 instead of x86, as the latter has a lot
less resources resulting in slowing down the whole pipeline.

CI pipeline performed on top of this series + cppcheck patch:
https://gitlab.com/xen-project/people/morzel/xen-orzelmichal/-/pipelines/777181033

Michal Orzel (5):
  automation: Switch arm32 cross builds to run on arm64
  automation: Add arm32 dom0less testing
  automation: Add a static memory allocation test on arm32
  automation: Add a gzip compressed kernel image test on arm32
  automation: Add a true dom0less test on arm32

 ... => unstable-arm64v8-arm32-gcc.dockerfile} |   3 +-
 automation/gitlab-ci/build.yaml               |  30 +++-
 automation/gitlab-ci/test.yaml                |  64 ++++++++
 .../scripts/qemu-smoke-dom0less-arm32.sh      | 142 ++++++++++++++++++
 4 files changed, 232 insertions(+), 7 deletions(-)
 rename automation/build/debian/{unstable-arm32-gcc.dockerfile => unstable-arm64v8-arm32-gcc.dockerfile} (94%)
 create mode 100755 automation/scripts/qemu-smoke-dom0less-arm32.sh

-- 
2.25.1



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/5] automation: Switch arm32 cross builds to run on arm64
  2023-02-14 15:38 [PATCH v2 0/5] automation: dom0less arm32 testing Michal Orzel
@ 2023-02-14 15:38 ` Michal Orzel
  2023-02-14 23:19   ` Stefano Stabellini
  2023-02-14 15:38 ` [PATCH v2 2/5] automation: Add arm32 dom0less testing Michal Orzel
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Michal Orzel @ 2023-02-14 15:38 UTC (permalink / raw
  To: xen-devel
  Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini, andrew.cooper3

Due to the limited x86 CI resources slowing down the whole pipeline,
switch the arm32 cross builds to be executed on arm64 which is much more
capable. For that, rename the existing debian container dockerfile
from unstable-arm32-gcc to unstable-arm64v8-arm32-gcc and use
arm64v8/debian:unstable as an image. Note, that we cannot use the same
container name as we have to keep the backwards compatibility.
Take the opportunity to remove extra empty line at the end of a file.

Modify the tag of .arm32-cross-build-tmpl to arm64 and update the build
jobs accordingly.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v2:
 - new patch

For convenience and own testing, I built and pushed the new container
to registry.
---
 ...ockerfile => unstable-arm64v8-arm32-gcc.dockerfile} |  3 +--
 automation/gitlab-ci/build.yaml                        | 10 +++++-----
 2 files changed, 6 insertions(+), 7 deletions(-)
 rename automation/build/debian/{unstable-arm32-gcc.dockerfile => unstable-arm64v8-arm32-gcc.dockerfile} (94%)

diff --git a/automation/build/debian/unstable-arm32-gcc.dockerfile b/automation/build/debian/unstable-arm64v8-arm32-gcc.dockerfile
similarity index 94%
rename from automation/build/debian/unstable-arm32-gcc.dockerfile
rename to automation/build/debian/unstable-arm64v8-arm32-gcc.dockerfile
index b41a57f19729..11860425a6a2 100644
--- a/automation/build/debian/unstable-arm32-gcc.dockerfile
+++ b/automation/build/debian/unstable-arm64v8-arm32-gcc.dockerfile
@@ -1,4 +1,4 @@
-FROM debian:unstable
+FROM arm64v8/debian:unstable
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
@@ -21,4 +21,3 @@ RUN apt-get update && \
         apt-get autoremove -y && \
         apt-get clean && \
         rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
-
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index a053c5c7325d..f8e156e0a994 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -123,7 +123,7 @@
   variables:
     XEN_TARGET_ARCH: arm32
   tags:
-    - x86_64
+    - arm64
 
 .arm32-cross-build:
   extends: .arm32-cross-build-tmpl
@@ -542,26 +542,26 @@ alpine-3.12-clang-debug:
 debian-unstable-gcc-arm32:
   extends: .gcc-arm32-cross-build
   variables:
-    CONTAINER: debian:unstable-arm32-gcc
+    CONTAINER: debian:unstable-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
 
 debian-unstable-gcc-arm32-debug:
   extends: .gcc-arm32-cross-build-debug
   variables:
-    CONTAINER: debian:unstable-arm32-gcc
+    CONTAINER: debian:unstable-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
 
 debian-unstable-gcc-arm32-randconfig:
   extends: .gcc-arm32-cross-build
   variables:
-    CONTAINER: debian:unstable-arm32-gcc
+    CONTAINER: debian:unstable-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
     RANDCONFIG: y
 
 debian-unstable-gcc-arm32-debug-randconfig:
   extends: .gcc-arm32-cross-build-debug
   variables:
-    CONTAINER: debian:unstable-arm32-gcc
+    CONTAINER: debian:unstable-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
     RANDCONFIG: y
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 2/5] automation: Add arm32 dom0less testing
  2023-02-14 15:38 [PATCH v2 0/5] automation: dom0less arm32 testing Michal Orzel
  2023-02-14 15:38 ` [PATCH v2 1/5] automation: Switch arm32 cross builds to run on arm64 Michal Orzel
@ 2023-02-14 15:38 ` Michal Orzel
  2023-02-14 23:21   ` Stefano Stabellini
  2023-02-14 15:38 ` [PATCH v2 3/5] automation: Add a static memory allocation test on arm32 Michal Orzel
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Michal Orzel @ 2023-02-14 15:38 UTC (permalink / raw
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini

At the moment, we only perform a single arm32 test in our CI, checking
whether dom0 boots successfully or not. This is mostly because we do not
have any arm32 runners and we only execute a hypervisor only build.

In order not to leave the arm32 testing in such a poor state, add a
script qemu-smoke-dom0less-arm32.sh to start testing dom0less
configuration, while keeping dom0 to make the test more interesting.

The script is mostly based on the one used for dom0 arm32 testing as well
as the one used for dom0less arm64 testing. We obtain Debian Bullseye
kernel and Alpine Linux busybox-based rootfs. Depending on the test
variant, we prepare a test case contained within domU_check variable,
that will be executed as part of /init script from domU rootfs.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v2:
 - keep dom0 around by default to make tests more interesting
---
 automation/gitlab-ci/test.yaml                | 16 +++
 .../scripts/qemu-smoke-dom0less-arm32.sh      | 99 +++++++++++++++++++
 2 files changed, 115 insertions(+)
 create mode 100755 automation/scripts/qemu-smoke-dom0less-arm32.sh

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index ce543ef5c0ef..84ab1fee50a4 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -210,6 +210,22 @@ qemu-smoke-dom0-arm32-gcc-debug:
     - *arm32-test-needs
     - debian-unstable-gcc-arm32-debug
 
+qemu-smoke-dom0less-arm32-gcc:
+  extends: .qemu-arm32
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh 2>&1 | tee ${LOGFILE}
+  needs:
+    - *arm32-test-needs
+    - debian-unstable-gcc-arm32
+
+qemu-smoke-dom0less-arm32-gcc-debug:
+  extends: .qemu-arm32
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh 2>&1 | tee ${LOGFILE}
+  needs:
+    - *arm32-test-needs
+    - debian-unstable-gcc-arm32-debug
+
 qemu-alpine-x86_64-gcc:
   extends: .qemu-x86-64
   script:
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
new file mode 100755
index 000000000000..e3f2b28f3f89
--- /dev/null
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -0,0 +1,99 @@
+#!/bin/bash
+
+set -ex
+
+test_variant=$1
+
+# Prompt to grep for to check if dom0 booted successfully
+dom0_prompt="^/ #"
+
+cd binaries
+# Use the kernel from Debian
+curl --fail --silent --show-error --location --output vmlinuz https://deb.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
+
+if [ -z "${test_variant}" ]; then
+    passed="generic test passed"
+    domU_check="
+echo \"${passed}\"
+"
+fi
+
+# dom0/domU rootfs
+# We are using the same rootfs for dom0 and domU. The only difference is
+# that for the former, we set explictly rdinit to /bin/sh, whereas for the
+# latter we rely on using custom /init script with test case inside.
+mkdir rootfs
+cd rootfs
+tar xvzf ../initrd.tar.gz
+echo "#!/bin/sh
+
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+mount -t devtmpfs devtmpfs /dev
+${domU_check}
+/bin/sh" > init
+chmod +x init
+find . | cpio -H newc -o | gzip > ../initrd.gz
+cd ..
+
+# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
+curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
+./qemu-system-arm \
+    -machine virt \
+    -machine virtualization=true \
+    -smp 4 \
+    -m 2048 \
+    -serial stdio \
+    -monitor none \
+    -display none \
+    -machine dumpdtb=virt.dtb
+
+# ImageBuilder
+echo 'MEMORY_START="0x40000000"
+MEMORY_END="0xC0000000"
+
+DEVICE_TREE="virt.dtb"
+XEN="xen"
+XEN_CMD="console=dtuart dom0_mem=512M bootscrub=0"
+
+DOM0_KERNEL="vmlinuz"
+DOM0_RAMDISK="initrd.gz"
+DOM0_CMD="console=hvc0 earlyprintk clk_ignore_unused root=/dev/ram0 rdinit=/bin/sh"
+
+DOMU_KERNEL[0]="vmlinuz"
+DOMU_RAMDISK[0]="initrd.gz"
+DOMU_MEM[0]="512"
+NUM_DOMUS=1
+
+LOAD_CMD="tftpb"
+BOOT_CMD="bootm"
+UBOOT_SOURCE="boot.source"
+UBOOT_SCRIPT="boot.scr"' > config
+
+rm -rf imagebuilder
+git clone https://gitlab.com/ViryaOS/imagebuilder
+bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
+
+# Run the test
+rm -f smoke.serial
+set +e
+echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
+timeout -k 1 240 \
+./qemu-system-arm \
+    -machine virt \
+    -machine virtualization=true \
+    -smp 4 \
+    -m 2048 \
+    -serial stdio \
+    -monitor none \
+    -display none \
+    -no-reboot \
+    -device virtio-net-pci,netdev=n0 \
+    -netdev user,id=n0,tftp=./ \
+    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& tee smoke.serial
+
+set -e
+(grep -q "${dom0_prompt}" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
+exit 0
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 3/5] automation: Add a static memory allocation test on arm32
  2023-02-14 15:38 [PATCH v2 0/5] automation: dom0less arm32 testing Michal Orzel
  2023-02-14 15:38 ` [PATCH v2 1/5] automation: Switch arm32 cross builds to run on arm64 Michal Orzel
  2023-02-14 15:38 ` [PATCH v2 2/5] automation: Add arm32 dom0less testing Michal Orzel
@ 2023-02-14 15:38 ` Michal Orzel
  2023-02-14 23:21   ` Stefano Stabellini
  2023-02-16  1:19   ` Andrew Cooper
  2023-02-14 15:38 ` [PATCH v2 4/5] automation: Add a gzip compressed kernel image " Michal Orzel
  2023-02-14 15:38 ` [PATCH v2 5/5] automation: Add a true dom0less " Michal Orzel
  4 siblings, 2 replies; 12+ messages in thread
From: Michal Orzel @ 2023-02-14 15:38 UTC (permalink / raw
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini

Add a new test job qemu-smoke-dom0less-arm32-gcc-staticmem in debug
and non-debug variant that will execute qemu-smoke-dom0less-arm32.sh
script to test static memory allocation feature. The test case itself
is directly taken from dom0less arm64 testing.

Populate build jobs to compile Xen with config options necessary to
enable static memory feature. Populate test jobs passing "static-mem"
as a test variant. The test configures domU with a static memory region
(direct-mapped) and adds a check using /proc/iomem to determine the
memory region marked as "System RAM".

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v2:
 - take into account new container for arm32 cross builds
 - drop Rb as a result of code changes
---
 automation/gitlab-ci/build.yaml               | 20 +++++++++++++++++++
 automation/gitlab-ci/test.yaml                | 16 +++++++++++++++
 .../scripts/qemu-smoke-dom0less-arm32.sh      | 17 ++++++++++++++++
 3 files changed, 53 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index f8e156e0a994..079e9b73f659 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -565,6 +565,26 @@ debian-unstable-gcc-arm32-debug-randconfig:
     HYPERVISOR_ONLY: y
     RANDCONFIG: y
 
+debian-unstable-gcc-arm32-staticmem:
+  extends: .gcc-arm32-cross-build
+  variables:
+    CONTAINER: debian:unstable-arm64v8-arm32-gcc
+    HYPERVISOR_ONLY: y
+    EXTRA_XEN_CONFIG: |
+      CONFIG_EXPERT=y
+      CONFIG_UNSUPPORTED=y
+      CONFIG_STATIC_MEMORY=y
+
+debian-unstable-gcc-arm32-debug-staticmem:
+  extends: .gcc-arm32-cross-build-debug
+  variables:
+    CONTAINER: debian:unstable-arm64v8-arm32-gcc
+    HYPERVISOR_ONLY: y
+    EXTRA_XEN_CONFIG: |
+      CONFIG_EXPERT=y
+      CONFIG_UNSUPPORTED=y
+      CONFIG_STATIC_MEMORY=y
+
 # Arm builds
 
 debian-unstable-gcc-arm64:
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 84ab1fee50a4..c2bcc5d4d3e5 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -226,6 +226,22 @@ qemu-smoke-dom0less-arm32-gcc-debug:
     - *arm32-test-needs
     - debian-unstable-gcc-arm32-debug
 
+qemu-smoke-dom0less-arm32-gcc-staticmem:
+  extends: .qemu-arm32
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh static-mem 2>&1 | tee ${LOGFILE}
+  needs:
+    - *arm32-test-needs
+    - debian-unstable-gcc-arm32-staticmem
+
+qemu-smoke-dom0less-arm32-gcc-debug-staticmem:
+  extends: .qemu-arm32
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh static-mem 2>&1 | tee ${LOGFILE}
+  needs:
+    - *arm32-test-needs
+    - debian-unstable-gcc-arm32-debug-staticmem
+
 qemu-alpine-x86_64-gcc:
   extends: .qemu-x86-64
   script:
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index e3f2b28f3f89..bd89a3f8b45e 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -20,6 +20,19 @@ echo \"${passed}\"
 "
 fi
 
+if [[ "${test_variant}" == "static-mem" ]]; then
+    # Memory range that is statically allocated to domU1
+    domu_base="0x50000000"
+    domu_size="0x20000000"
+    passed="${test_variant} test passed"
+    domU_check="
+mem_range=$(printf \"%08x-%08x\" ${domu_base} $(( ${domu_base} + ${domu_size} - 1 )))
+if grep -q -x \"\${mem_range} : System RAM\" /proc/iomem; then
+    echo \"${passed}\"
+fi
+"
+fi
+
 # dom0/domU rootfs
 # We are using the same rootfs for dom0 and domU. The only difference is
 # that for the former, we set explictly rdinit to /bin/sh, whereas for the
@@ -72,6 +85,10 @@ BOOT_CMD="bootm"
 UBOOT_SOURCE="boot.source"
 UBOOT_SCRIPT="boot.scr"' > config
 
+if [[ "${test_variant}" == "static-mem" ]]; then
+    echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base} ${domu_size}\"" >> config
+fi
+
 rm -rf imagebuilder
 git clone https://gitlab.com/ViryaOS/imagebuilder
 bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 4/5] automation: Add a gzip compressed kernel image test on arm32
  2023-02-14 15:38 [PATCH v2 0/5] automation: dom0less arm32 testing Michal Orzel
                   ` (2 preceding siblings ...)
  2023-02-14 15:38 ` [PATCH v2 3/5] automation: Add a static memory allocation test on arm32 Michal Orzel
@ 2023-02-14 15:38 ` Michal Orzel
  2023-02-14 23:22   ` Stefano Stabellini
  2023-02-14 15:38 ` [PATCH v2 5/5] automation: Add a true dom0less " Michal Orzel
  4 siblings, 1 reply; 12+ messages in thread
From: Michal Orzel @ 2023-02-14 15:38 UTC (permalink / raw
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini

Xen supports booting gzip compressed kernels, therefore add a new test
job qemu-smoke-dom0less-arm32-gcc-gzip in debug and non-debug variant
that will execute qemu-smoke-dom0less-arm32.sh script to test booting
a domU with a gzip compressed kernel image (in our case zImage).

By passing "gzip" as a test variant, the test will call gzip command
to compress kernel image and use it in ImageBuilder configuration for
domU1. No need for a specific check to be executed from domU. Being able
to see a test message from a boot log is sufficient to mark a test as
passed.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v2:
 - take into account dom0 presence
 - drop Rb as a result of code changes
---
 automation/gitlab-ci/test.yaml                  | 16 ++++++++++++++++
 automation/scripts/qemu-smoke-dom0less-arm32.sh | 13 +++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index c2bcc5d4d3e5..be7a55d89708 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -242,6 +242,22 @@ qemu-smoke-dom0less-arm32-gcc-debug-staticmem:
     - *arm32-test-needs
     - debian-unstable-gcc-arm32-debug-staticmem
 
+qemu-smoke-dom0less-arm32-gcc-gzip:
+  extends: .qemu-arm32
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh gzip 2>&1 | tee ${LOGFILE}
+  needs:
+    - *arm32-test-needs
+    - debian-unstable-gcc-arm32
+
+qemu-smoke-dom0less-arm32-gcc-debug-gzip:
+  extends: .qemu-arm32
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh gzip 2>&1 | tee ${LOGFILE}
+  needs:
+    - *arm32-test-needs
+    - debian-unstable-gcc-arm32-debug
+
 qemu-alpine-x86_64-gcc:
   extends: .qemu-x86-64
   script:
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index bd89a3f8b45e..c2e331451d99 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -33,6 +33,15 @@ fi
 "
 fi
 
+if [[ "${test_variant}" == "gzip" ]]; then
+    # Compress kernel image with gzip (keep unmodified one for dom0)
+    gzip -k vmlinuz
+    passed="${test_variant} test passed"
+    domU_check="
+echo \"${passed}\"
+"
+fi
+
 # dom0/domU rootfs
 # We are using the same rootfs for dom0 and domU. The only difference is
 # that for the former, we set explictly rdinit to /bin/sh, whereas for the
@@ -89,6 +98,10 @@ if [[ "${test_variant}" == "static-mem" ]]; then
     echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base} ${domu_size}\"" >> config
 fi
 
+if [[ "${test_variant}" == "gzip" ]]; then
+    sed -i 's/DOMU_KERNEL\[0\]=.*/DOMU_KERNEL\[0\]="vmlinuz.gz"/' config
+fi
+
 rm -rf imagebuilder
 git clone https://gitlab.com/ViryaOS/imagebuilder
 bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 5/5] automation: Add a true dom0less test on arm32
  2023-02-14 15:38 [PATCH v2 0/5] automation: dom0less arm32 testing Michal Orzel
                   ` (3 preceding siblings ...)
  2023-02-14 15:38 ` [PATCH v2 4/5] automation: Add a gzip compressed kernel image " Michal Orzel
@ 2023-02-14 15:38 ` Michal Orzel
  2023-02-14 23:22   ` Stefano Stabellini
  4 siblings, 1 reply; 12+ messages in thread
From: Michal Orzel @ 2023-02-14 15:38 UTC (permalink / raw
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini

Add a new test job qemu-smoke-dom0less-arm32-gcc-without-dom0 in debug
and non-debug variant that will execute qemu-smoke-dom0less-arm32.sh
script to test dom0less domU boot without dom0 (i.e. true dom0less
configuration).

By passing "without-dom0" as a test variant, the test will clear the
dom0 prompt that we grep for as a last step and remove all the DOM0
related options in ImageBuilder configuration.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v2:
 - new patch created as a result of deciding to keep dom0 by default. We still
   need to test true dom0less configuration, hence added a new test.
---
 automation/gitlab-ci/test.yaml                  | 16 ++++++++++++++++
 automation/scripts/qemu-smoke-dom0less-arm32.sh | 13 +++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index be7a55d89708..c0b4a90e0d29 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -258,6 +258,22 @@ qemu-smoke-dom0less-arm32-gcc-debug-gzip:
     - *arm32-test-needs
     - debian-unstable-gcc-arm32-debug
 
+qemu-smoke-dom0less-arm32-gcc-without-dom0:
+  extends: .qemu-arm32
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh without-dom0 2>&1 | tee ${LOGFILE}
+  needs:
+    - *arm32-test-needs
+    - debian-unstable-gcc-arm32
+
+qemu-smoke-dom0less-arm32-gcc-debug-without-dom0:
+  extends: .qemu-arm32
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh without-dom0 2>&1 | tee ${LOGFILE}
+  needs:
+    - *arm32-test-needs
+    - debian-unstable-gcc-arm32-debug
+
 qemu-alpine-x86_64-gcc:
   extends: .qemu-x86-64
   script:
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index c2e331451d99..cc91238f4222 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -42,6 +42,15 @@ echo \"${passed}\"
 "
 fi
 
+if [[ "${test_variant}" == "without-dom0" ]]; then
+    # Clear dom0 prompt
+    dom0_prompt=""
+    passed="${test_variant} test passed"
+    domU_check="
+echo \"${passed}\"
+"
+fi
+
 # dom0/domU rootfs
 # We are using the same rootfs for dom0 and domU. The only difference is
 # that for the former, we set explictly rdinit to /bin/sh, whereas for the
@@ -102,6 +111,10 @@ if [[ "${test_variant}" == "gzip" ]]; then
     sed -i 's/DOMU_KERNEL\[0\]=.*/DOMU_KERNEL\[0\]="vmlinuz.gz"/' config
 fi
 
+if [[ "${test_variant}" == "without-dom0" ]]; then
+    sed -i '/^DOM0/d' config
+fi
+
 rm -rf imagebuilder
 git clone https://gitlab.com/ViryaOS/imagebuilder
 bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/5] automation: Switch arm32 cross builds to run on arm64
  2023-02-14 15:38 ` [PATCH v2 1/5] automation: Switch arm32 cross builds to run on arm64 Michal Orzel
@ 2023-02-14 23:19   ` Stefano Stabellini
  0 siblings, 0 replies; 12+ messages in thread
From: Stefano Stabellini @ 2023-02-14 23:19 UTC (permalink / raw
  To: Michal Orzel
  Cc: xen-devel, Doug Goldstein, Stefano Stabellini, andrew.cooper3

On Tue, 14 Feb 2023, Michal Orzel wrote:
> Due to the limited x86 CI resources slowing down the whole pipeline,
> switch the arm32 cross builds to be executed on arm64 which is much more
> capable. For that, rename the existing debian container dockerfile
> from unstable-arm32-gcc to unstable-arm64v8-arm32-gcc and use
> arm64v8/debian:unstable as an image. Note, that we cannot use the same
> container name as we have to keep the backwards compatibility.
> Take the opportunity to remove extra empty line at the end of a file.
> 
> Modify the tag of .arm32-cross-build-tmpl to arm64 and update the build
> jobs accordingly.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
>  - new patch
> 
> For convenience and own testing, I built and pushed the new container
> to registry.

Thanks!


> ---
>  ...ockerfile => unstable-arm64v8-arm32-gcc.dockerfile} |  3 +--
>  automation/gitlab-ci/build.yaml                        | 10 +++++-----
>  2 files changed, 6 insertions(+), 7 deletions(-)
>  rename automation/build/debian/{unstable-arm32-gcc.dockerfile => unstable-arm64v8-arm32-gcc.dockerfile} (94%)
> 
> diff --git a/automation/build/debian/unstable-arm32-gcc.dockerfile b/automation/build/debian/unstable-arm64v8-arm32-gcc.dockerfile
> similarity index 94%
> rename from automation/build/debian/unstable-arm32-gcc.dockerfile
> rename to automation/build/debian/unstable-arm64v8-arm32-gcc.dockerfile
> index b41a57f19729..11860425a6a2 100644
> --- a/automation/build/debian/unstable-arm32-gcc.dockerfile
> +++ b/automation/build/debian/unstable-arm64v8-arm32-gcc.dockerfile
> @@ -1,4 +1,4 @@
> -FROM debian:unstable
> +FROM arm64v8/debian:unstable
>  LABEL maintainer.name="The Xen Project" \
>        maintainer.email="xen-devel@lists.xenproject.org"
>  
> @@ -21,4 +21,3 @@ RUN apt-get update && \
>          apt-get autoremove -y && \
>          apt-get clean && \
>          rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
> -
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index a053c5c7325d..f8e156e0a994 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -123,7 +123,7 @@
>    variables:
>      XEN_TARGET_ARCH: arm32
>    tags:
> -    - x86_64
> +    - arm64
>  
>  .arm32-cross-build:
>    extends: .arm32-cross-build-tmpl
> @@ -542,26 +542,26 @@ alpine-3.12-clang-debug:
>  debian-unstable-gcc-arm32:
>    extends: .gcc-arm32-cross-build
>    variables:
> -    CONTAINER: debian:unstable-arm32-gcc
> +    CONTAINER: debian:unstable-arm64v8-arm32-gcc
>      HYPERVISOR_ONLY: y
>  
>  debian-unstable-gcc-arm32-debug:
>    extends: .gcc-arm32-cross-build-debug
>    variables:
> -    CONTAINER: debian:unstable-arm32-gcc
> +    CONTAINER: debian:unstable-arm64v8-arm32-gcc
>      HYPERVISOR_ONLY: y
>  
>  debian-unstable-gcc-arm32-randconfig:
>    extends: .gcc-arm32-cross-build
>    variables:
> -    CONTAINER: debian:unstable-arm32-gcc
> +    CONTAINER: debian:unstable-arm64v8-arm32-gcc
>      HYPERVISOR_ONLY: y
>      RANDCONFIG: y
>  
>  debian-unstable-gcc-arm32-debug-randconfig:
>    extends: .gcc-arm32-cross-build-debug
>    variables:
> -    CONTAINER: debian:unstable-arm32-gcc
> +    CONTAINER: debian:unstable-arm64v8-arm32-gcc
>      HYPERVISOR_ONLY: y
>      RANDCONFIG: y
>  
> -- 
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/5] automation: Add arm32 dom0less testing
  2023-02-14 15:38 ` [PATCH v2 2/5] automation: Add arm32 dom0less testing Michal Orzel
@ 2023-02-14 23:21   ` Stefano Stabellini
  0 siblings, 0 replies; 12+ messages in thread
From: Stefano Stabellini @ 2023-02-14 23:21 UTC (permalink / raw
  To: Michal Orzel; +Cc: xen-devel, Doug Goldstein, Stefano Stabellini

On Tue, 14 Feb 2023, Michal Orzel wrote:
> At the moment, we only perform a single arm32 test in our CI, checking
> whether dom0 boots successfully or not. This is mostly because we do not
> have any arm32 runners and we only execute a hypervisor only build.
> 
> In order not to leave the arm32 testing in such a poor state, add a
> script qemu-smoke-dom0less-arm32.sh to start testing dom0less
> configuration, while keeping dom0 to make the test more interesting.
> 
> The script is mostly based on the one used for dom0 arm32 testing as well
> as the one used for dom0less arm64 testing. We obtain Debian Bullseye
> kernel and Alpine Linux busybox-based rootfs. Depending on the test
> variant, we prepare a test case contained within domU_check variable,
> that will be executed as part of /init script from domU rootfs.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
>  - keep dom0 around by default to make tests more interesting
> ---
>  automation/gitlab-ci/test.yaml                | 16 +++
>  .../scripts/qemu-smoke-dom0less-arm32.sh      | 99 +++++++++++++++++++
>  2 files changed, 115 insertions(+)
>  create mode 100755 automation/scripts/qemu-smoke-dom0less-arm32.sh
> 
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index ce543ef5c0ef..84ab1fee50a4 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -210,6 +210,22 @@ qemu-smoke-dom0-arm32-gcc-debug:
>      - *arm32-test-needs
>      - debian-unstable-gcc-arm32-debug
>  
> +qemu-smoke-dom0less-arm32-gcc:
> +  extends: .qemu-arm32
> +  script:
> +    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *arm32-test-needs
> +    - debian-unstable-gcc-arm32
> +
> +qemu-smoke-dom0less-arm32-gcc-debug:
> +  extends: .qemu-arm32
> +  script:
> +    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *arm32-test-needs
> +    - debian-unstable-gcc-arm32-debug
> +
>  qemu-alpine-x86_64-gcc:
>    extends: .qemu-x86-64
>    script:
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> new file mode 100755
> index 000000000000..e3f2b28f3f89
> --- /dev/null
> +++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> @@ -0,0 +1,99 @@
> +#!/bin/bash
> +
> +set -ex
> +
> +test_variant=$1
> +
> +# Prompt to grep for to check if dom0 booted successfully
> +dom0_prompt="^/ #"
> +
> +cd binaries
> +# Use the kernel from Debian
> +curl --fail --silent --show-error --location --output vmlinuz https://deb.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
> +
> +if [ -z "${test_variant}" ]; then
> +    passed="generic test passed"
> +    domU_check="
> +echo \"${passed}\"
> +"
> +fi
> +
> +# dom0/domU rootfs
> +# We are using the same rootfs for dom0 and domU. The only difference is
> +# that for the former, we set explictly rdinit to /bin/sh, whereas for the
> +# latter we rely on using custom /init script with test case inside.
> +mkdir rootfs
> +cd rootfs
> +tar xvzf ../initrd.tar.gz
> +echo "#!/bin/sh
> +
> +mount -t proc proc /proc
> +mount -t sysfs sysfs /sys
> +mount -t devtmpfs devtmpfs /dev
> +${domU_check}
> +/bin/sh" > init
> +chmod +x init
> +find . | cpio -H newc -o | gzip > ../initrd.gz
> +cd ..
> +
> +# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
> +curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
> +./qemu-system-arm \
> +    -machine virt \
> +    -machine virtualization=true \
> +    -smp 4 \
> +    -m 2048 \
> +    -serial stdio \
> +    -monitor none \
> +    -display none \
> +    -machine dumpdtb=virt.dtb
> +
> +# ImageBuilder
> +echo 'MEMORY_START="0x40000000"
> +MEMORY_END="0xC0000000"
> +
> +DEVICE_TREE="virt.dtb"
> +XEN="xen"
> +XEN_CMD="console=dtuart dom0_mem=512M bootscrub=0"
> +
> +DOM0_KERNEL="vmlinuz"
> +DOM0_RAMDISK="initrd.gz"
> +DOM0_CMD="console=hvc0 earlyprintk clk_ignore_unused root=/dev/ram0 rdinit=/bin/sh"
> +
> +DOMU_KERNEL[0]="vmlinuz"
> +DOMU_RAMDISK[0]="initrd.gz"
> +DOMU_MEM[0]="512"
> +NUM_DOMUS=1
> +
> +LOAD_CMD="tftpb"
> +BOOT_CMD="bootm"
> +UBOOT_SOURCE="boot.source"
> +UBOOT_SCRIPT="boot.scr"' > config
> +
> +rm -rf imagebuilder
> +git clone https://gitlab.com/ViryaOS/imagebuilder
> +bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
> +
> +# Run the test
> +rm -f smoke.serial
> +set +e
> +echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
> +timeout -k 1 240 \
> +./qemu-system-arm \
> +    -machine virt \
> +    -machine virtualization=true \
> +    -smp 4 \
> +    -m 2048 \
> +    -serial stdio \
> +    -monitor none \
> +    -display none \
> +    -no-reboot \
> +    -device virtio-net-pci,netdev=n0 \
> +    -netdev user,id=n0,tftp=./ \
> +    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& tee smoke.serial
> +
> +set -e
> +(grep -q "${dom0_prompt}" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
> +exit 0
> -- 
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 3/5] automation: Add a static memory allocation test on arm32
  2023-02-14 15:38 ` [PATCH v2 3/5] automation: Add a static memory allocation test on arm32 Michal Orzel
@ 2023-02-14 23:21   ` Stefano Stabellini
  2023-02-16  1:19   ` Andrew Cooper
  1 sibling, 0 replies; 12+ messages in thread
From: Stefano Stabellini @ 2023-02-14 23:21 UTC (permalink / raw
  To: Michal Orzel; +Cc: xen-devel, Doug Goldstein, Stefano Stabellini

On Tue, 14 Feb 2023, Michal Orzel wrote:
> Add a new test job qemu-smoke-dom0less-arm32-gcc-staticmem in debug
> and non-debug variant that will execute qemu-smoke-dom0less-arm32.sh
> script to test static memory allocation feature. The test case itself
> is directly taken from dom0less arm64 testing.
> 
> Populate build jobs to compile Xen with config options necessary to
> enable static memory feature. Populate test jobs passing "static-mem"
> as a test variant. The test configures domU with a static memory region
> (direct-mapped) and adds a check using /proc/iomem to determine the
> memory region marked as "System RAM".
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
>  - take into account new container for arm32 cross builds
>  - drop Rb as a result of code changes
> ---
>  automation/gitlab-ci/build.yaml               | 20 +++++++++++++++++++
>  automation/gitlab-ci/test.yaml                | 16 +++++++++++++++
>  .../scripts/qemu-smoke-dom0less-arm32.sh      | 17 ++++++++++++++++
>  3 files changed, 53 insertions(+)
> 
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index f8e156e0a994..079e9b73f659 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -565,6 +565,26 @@ debian-unstable-gcc-arm32-debug-randconfig:
>      HYPERVISOR_ONLY: y
>      RANDCONFIG: y
>  
> +debian-unstable-gcc-arm32-staticmem:
> +  extends: .gcc-arm32-cross-build
> +  variables:
> +    CONTAINER: debian:unstable-arm64v8-arm32-gcc
> +    HYPERVISOR_ONLY: y
> +    EXTRA_XEN_CONFIG: |
> +      CONFIG_EXPERT=y
> +      CONFIG_UNSUPPORTED=y
> +      CONFIG_STATIC_MEMORY=y
> +
> +debian-unstable-gcc-arm32-debug-staticmem:
> +  extends: .gcc-arm32-cross-build-debug
> +  variables:
> +    CONTAINER: debian:unstable-arm64v8-arm32-gcc
> +    HYPERVISOR_ONLY: y
> +    EXTRA_XEN_CONFIG: |
> +      CONFIG_EXPERT=y
> +      CONFIG_UNSUPPORTED=y
> +      CONFIG_STATIC_MEMORY=y
> +
>  # Arm builds
>  
>  debian-unstable-gcc-arm64:
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index 84ab1fee50a4..c2bcc5d4d3e5 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -226,6 +226,22 @@ qemu-smoke-dom0less-arm32-gcc-debug:
>      - *arm32-test-needs
>      - debian-unstable-gcc-arm32-debug
>  
> +qemu-smoke-dom0less-arm32-gcc-staticmem:
> +  extends: .qemu-arm32
> +  script:
> +    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh static-mem 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *arm32-test-needs
> +    - debian-unstable-gcc-arm32-staticmem
> +
> +qemu-smoke-dom0less-arm32-gcc-debug-staticmem:
> +  extends: .qemu-arm32
> +  script:
> +    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh static-mem 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *arm32-test-needs
> +    - debian-unstable-gcc-arm32-debug-staticmem
> +
>  qemu-alpine-x86_64-gcc:
>    extends: .qemu-x86-64
>    script:
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> index e3f2b28f3f89..bd89a3f8b45e 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> @@ -20,6 +20,19 @@ echo \"${passed}\"
>  "
>  fi
>  
> +if [[ "${test_variant}" == "static-mem" ]]; then
> +    # Memory range that is statically allocated to domU1
> +    domu_base="0x50000000"
> +    domu_size="0x20000000"
> +    passed="${test_variant} test passed"
> +    domU_check="
> +mem_range=$(printf \"%08x-%08x\" ${domu_base} $(( ${domu_base} + ${domu_size} - 1 )))
> +if grep -q -x \"\${mem_range} : System RAM\" /proc/iomem; then
> +    echo \"${passed}\"
> +fi
> +"
> +fi
> +
>  # dom0/domU rootfs
>  # We are using the same rootfs for dom0 and domU. The only difference is
>  # that for the former, we set explictly rdinit to /bin/sh, whereas for the
> @@ -72,6 +85,10 @@ BOOT_CMD="bootm"
>  UBOOT_SOURCE="boot.source"
>  UBOOT_SCRIPT="boot.scr"' > config
>  
> +if [[ "${test_variant}" == "static-mem" ]]; then
> +    echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base} ${domu_size}\"" >> config
> +fi
> +
>  rm -rf imagebuilder
>  git clone https://gitlab.com/ViryaOS/imagebuilder
>  bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
> -- 
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 4/5] automation: Add a gzip compressed kernel image test on arm32
  2023-02-14 15:38 ` [PATCH v2 4/5] automation: Add a gzip compressed kernel image " Michal Orzel
@ 2023-02-14 23:22   ` Stefano Stabellini
  0 siblings, 0 replies; 12+ messages in thread
From: Stefano Stabellini @ 2023-02-14 23:22 UTC (permalink / raw
  To: Michal Orzel; +Cc: xen-devel, Doug Goldstein, Stefano Stabellini

On Tue, 14 Feb 2023, Michal Orzel wrote:
> Xen supports booting gzip compressed kernels, therefore add a new test
> job qemu-smoke-dom0less-arm32-gcc-gzip in debug and non-debug variant
> that will execute qemu-smoke-dom0less-arm32.sh script to test booting
> a domU with a gzip compressed kernel image (in our case zImage).
> 
> By passing "gzip" as a test variant, the test will call gzip command
> to compress kernel image and use it in ImageBuilder configuration for
> domU1. No need for a specific check to be executed from domU. Being able
> to see a test message from a boot log is sufficient to mark a test as
> passed.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
>  - take into account dom0 presence
>  - drop Rb as a result of code changes
> ---
>  automation/gitlab-ci/test.yaml                  | 16 ++++++++++++++++
>  automation/scripts/qemu-smoke-dom0less-arm32.sh | 13 +++++++++++++
>  2 files changed, 29 insertions(+)
> 
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index c2bcc5d4d3e5..be7a55d89708 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -242,6 +242,22 @@ qemu-smoke-dom0less-arm32-gcc-debug-staticmem:
>      - *arm32-test-needs
>      - debian-unstable-gcc-arm32-debug-staticmem
>  
> +qemu-smoke-dom0less-arm32-gcc-gzip:
> +  extends: .qemu-arm32
> +  script:
> +    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh gzip 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *arm32-test-needs
> +    - debian-unstable-gcc-arm32
> +
> +qemu-smoke-dom0less-arm32-gcc-debug-gzip:
> +  extends: .qemu-arm32
> +  script:
> +    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh gzip 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *arm32-test-needs
> +    - debian-unstable-gcc-arm32-debug
> +
>  qemu-alpine-x86_64-gcc:
>    extends: .qemu-x86-64
>    script:
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> index bd89a3f8b45e..c2e331451d99 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> @@ -33,6 +33,15 @@ fi
>  "
>  fi
>  
> +if [[ "${test_variant}" == "gzip" ]]; then
> +    # Compress kernel image with gzip (keep unmodified one for dom0)
> +    gzip -k vmlinuz
> +    passed="${test_variant} test passed"
> +    domU_check="
> +echo \"${passed}\"
> +"
> +fi
> +
>  # dom0/domU rootfs
>  # We are using the same rootfs for dom0 and domU. The only difference is
>  # that for the former, we set explictly rdinit to /bin/sh, whereas for the
> @@ -89,6 +98,10 @@ if [[ "${test_variant}" == "static-mem" ]]; then
>      echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base} ${domu_size}\"" >> config
>  fi
>  
> +if [[ "${test_variant}" == "gzip" ]]; then
> +    sed -i 's/DOMU_KERNEL\[0\]=.*/DOMU_KERNEL\[0\]="vmlinuz.gz"/' config
> +fi
> +
>  rm -rf imagebuilder
>  git clone https://gitlab.com/ViryaOS/imagebuilder
>  bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
> -- 
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 5/5] automation: Add a true dom0less test on arm32
  2023-02-14 15:38 ` [PATCH v2 5/5] automation: Add a true dom0less " Michal Orzel
@ 2023-02-14 23:22   ` Stefano Stabellini
  0 siblings, 0 replies; 12+ messages in thread
From: Stefano Stabellini @ 2023-02-14 23:22 UTC (permalink / raw
  To: Michal Orzel; +Cc: xen-devel, Doug Goldstein, Stefano Stabellini

On Tue, 14 Feb 2023, Michal Orzel wrote:
> Add a new test job qemu-smoke-dom0less-arm32-gcc-without-dom0 in debug
> and non-debug variant that will execute qemu-smoke-dom0less-arm32.sh
> script to test dom0less domU boot without dom0 (i.e. true dom0less
> configuration).
> 
> By passing "without-dom0" as a test variant, the test will clear the
> dom0 prompt that we grep for as a last step and remove all the DOM0
> related options in ImageBuilder configuration.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
>  - new patch created as a result of deciding to keep dom0 by default. We still
>    need to test true dom0less configuration, hence added a new test.
> ---
>  automation/gitlab-ci/test.yaml                  | 16 ++++++++++++++++
>  automation/scripts/qemu-smoke-dom0less-arm32.sh | 13 +++++++++++++
>  2 files changed, 29 insertions(+)
> 
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index be7a55d89708..c0b4a90e0d29 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -258,6 +258,22 @@ qemu-smoke-dom0less-arm32-gcc-debug-gzip:
>      - *arm32-test-needs
>      - debian-unstable-gcc-arm32-debug
>  
> +qemu-smoke-dom0less-arm32-gcc-without-dom0:
> +  extends: .qemu-arm32
> +  script:
> +    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh without-dom0 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *arm32-test-needs
> +    - debian-unstable-gcc-arm32
> +
> +qemu-smoke-dom0less-arm32-gcc-debug-without-dom0:
> +  extends: .qemu-arm32
> +  script:
> +    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh without-dom0 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *arm32-test-needs
> +    - debian-unstable-gcc-arm32-debug
> +
>  qemu-alpine-x86_64-gcc:
>    extends: .qemu-x86-64
>    script:
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> index c2e331451d99..cc91238f4222 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> @@ -42,6 +42,15 @@ echo \"${passed}\"
>  "
>  fi
>  
> +if [[ "${test_variant}" == "without-dom0" ]]; then
> +    # Clear dom0 prompt
> +    dom0_prompt=""
> +    passed="${test_variant} test passed"
> +    domU_check="
> +echo \"${passed}\"
> +"
> +fi
> +
>  # dom0/domU rootfs
>  # We are using the same rootfs for dom0 and domU. The only difference is
>  # that for the former, we set explictly rdinit to /bin/sh, whereas for the
> @@ -102,6 +111,10 @@ if [[ "${test_variant}" == "gzip" ]]; then
>      sed -i 's/DOMU_KERNEL\[0\]=.*/DOMU_KERNEL\[0\]="vmlinuz.gz"/' config
>  fi
>  
> +if [[ "${test_variant}" == "without-dom0" ]]; then
> +    sed -i '/^DOM0/d' config
> +fi
> +
>  rm -rf imagebuilder
>  git clone https://gitlab.com/ViryaOS/imagebuilder
>  bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
> -- 
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 3/5] automation: Add a static memory allocation test on arm32
  2023-02-14 15:38 ` [PATCH v2 3/5] automation: Add a static memory allocation test on arm32 Michal Orzel
  2023-02-14 23:21   ` Stefano Stabellini
@ 2023-02-16  1:19   ` Andrew Cooper
  1 sibling, 0 replies; 12+ messages in thread
From: Andrew Cooper @ 2023-02-16  1:19 UTC (permalink / raw
  To: Michal Orzel, xen-devel; +Cc: Doug Goldstein, Stefano Stabellini

On 14/02/2023 3:38 pm, Michal Orzel wrote:
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index f8e156e0a994..079e9b73f659 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -565,6 +565,26 @@ debian-unstable-gcc-arm32-debug-randconfig:
>      HYPERVISOR_ONLY: y
>      RANDCONFIG: y
>  
> +debian-unstable-gcc-arm32-staticmem:
> +  extends: .gcc-arm32-cross-build
> +  variables:
> +    CONTAINER: debian:unstable-arm64v8-arm32-gcc
> +    HYPERVISOR_ONLY: y
> +    EXTRA_XEN_CONFIG: |
> +      CONFIG_EXPERT=y
> +      CONFIG_UNSUPPORTED=y
> +      CONFIG_STATIC_MEMORY=y

This is absurd.  Either

1) static mem is important enough to warrant testing.  By adding it to
CI, you have caused the maintainers to accept the responsibility of
fixing bugs found in it, making it by definition supported, or

2) it is not important enough to warrant testing, at which point it's
not ok to be using XenProject's limited testing resource like this, and
it's not ok to be a blocking test.

There is no such thing as an unsupported feature running in CI.  It is a
complete contradiction in terms.

~Andrew


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-02-16  1:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-14 15:38 [PATCH v2 0/5] automation: dom0less arm32 testing Michal Orzel
2023-02-14 15:38 ` [PATCH v2 1/5] automation: Switch arm32 cross builds to run on arm64 Michal Orzel
2023-02-14 23:19   ` Stefano Stabellini
2023-02-14 15:38 ` [PATCH v2 2/5] automation: Add arm32 dom0less testing Michal Orzel
2023-02-14 23:21   ` Stefano Stabellini
2023-02-14 15:38 ` [PATCH v2 3/5] automation: Add a static memory allocation test on arm32 Michal Orzel
2023-02-14 23:21   ` Stefano Stabellini
2023-02-16  1:19   ` Andrew Cooper
2023-02-14 15:38 ` [PATCH v2 4/5] automation: Add a gzip compressed kernel image " Michal Orzel
2023-02-14 23:22   ` Stefano Stabellini
2023-02-14 15:38 ` [PATCH v2 5/5] automation: Add a true dom0less " Michal Orzel
2023-02-14 23:22   ` Stefano Stabellini

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).