[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1] automation: add x86_64 xilinx smoke test


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: <victorm.lira@xxxxxxx>
  • Date: Fri, 26 Jul 2024 18:56:39 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=com1FW1lk64G/Gzr/egji+D781kvGjwH+ntR26SMN8s=; b=PzGF/5EOrkMnwJz5bW3LrQPAdrkq0kt6A3RPmjZLGfBPGFeGNywYYx6IAkudkSqNL/p92Soy3XX+MgkORSsDJghVJUzOjmtud1m+WqZsd+NkN7YXiSEDW9LEf3gfPK9i22uetE6zrM0dlHtrxjR8Vuui2yP4B09JXLsHVTfJQMSjQVgSbqEbwAxNIg9p4NGqCzX6VpfVJ7ES1HP6kzUDzfWrBhDvos2kmZ1NdYwV/xXKRsKPzMC3D7a5do6ZRMvHpCquXPx3MGIeRSPI+/ku1avmoT3oCIm01KWSQhxvJm8yZoBytGXB8juQ4k5JKkxtcMiPSXyCjLpH+w+7/1NdYw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=G/VXJUZzrlkN1prrYNXr7khurNUJi8TI7lTkx4CtAwcT4XyjsKEpq5oWZvtNElyrhVpSM/TO8Yq3uzcsCNfmpO9szWGsZTlAPAFGR6qqJtTo6H7IgYjbuxVvsJMeNjEXUqLcR7Q7u3+1SiFgHBdjBt6DzXohqmj22qpIygjBQye5D6q3o3Rwx7gzVACwLe4Cj0/NOsQMJYEe94/mYMMKgPaOs4Mhxmq+EfdX3AtEyGcIx2NXLiHIR+ROfy3jPmkqbjC0r8Ce3XZfnpG+LM5fRpbxtZBfeeg2BZyJGOpb3f3/sy0GvfsbqdV3EOJB+NIZTdcof8fe50+2U3WF09my1Q==
  • Cc: Victor Lira <victorm.lira@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>
  • Delivery-date: Sat, 27 Jul 2024 01:57:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Victor Lira <victorm.lira@xxxxxxx>

Add a test script and related job for running x86_64 dom0 tests.

Signed-off-by: Victor Lira <victorm.lira@xxxxxxx>
---
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Doug Goldstein <cardoe@xxxxxxxxxx>
---
 automation/gitlab-ci/test.yaml                |  24 +++
 .../scripts/xilinx-smoke-dom0-x86_64.sh       | 144 ++++++++++++++++++
 2 files changed, 168 insertions(+)
 create mode 100755 automation/scripts/xilinx-smoke-dom0-x86_64.sh

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index d89e41f244..4e74946419 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -96,6 +96,22 @@
   tags:
     - xilinx

+.xilinx-x86_64:
+  extends: .test-jobs-common
+  variables:
+    CONTAINER: ubuntu:xenial-xilinx
+    LOGFILE: xilinx-smoke-x86_64.log
+  artifacts:
+    paths:
+      - smoke.serial
+      - '*.log'
+    when: always
+  only:
+    variables:
+      - $XILINX_JOBS == "true" && $CI_COMMIT_REF_PROTECTED == "true"
+  tags:
+    - xilinx
+
 .adl-x86-64:
   extends: .test-jobs-common
   variables:
@@ -159,6 +175,14 @@ xilinx-smoke-dom0less-arm64-gcc-debug-gem-passthrough:
     - *arm64-test-needs
     - alpine-3.18-gcc-debug-arm64

+xilinx-smoke-dom0-x86_64-gcc-debug:
+  extends: .xilinx-x86_64
+  script:
+    - ./automation/scripts/xilinx-smoke-dom0-x86_64.sh ping 2>&1 | tee 
${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 adl-smoke-x86-64-gcc-debug:
   extends: .adl-x86-64
   script:
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh 
b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
new file mode 100755
index 0000000000..e6e6fac6a5
--- /dev/null
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -0,0 +1,144 @@
+#!/bin/sh
+
+# Run x86_64 dom0 tests on hardware.
+
+set -ex
+
+fatal() {
+    echo "$(basename "$0") $*" >&2
+    exit 1
+}
+
+# Test parameter defaults.
+TEST="$1"
+PASS_MSG="Test passed: ${TEST}"
+XEN_CMD_CONSOLE="console=com1 com1=115200,8n1,0x3F8,4"
+XEN_CMD_DOM0="dom0=pvh dom0_max_vcpus=4 dom0_mem=4G"
+XEN_CMD_XEN="sched=null loglvl=all guest_loglvl=all console_timestamps=boot"
+XEN_CMD_EXTRA=""
+DOM0_CMD=""
+DOMU_CMD=""
+DOMU_CFG='
+type = "pvh"
+name = "domU"
+kernel = "/boot/vmlinuz"
+ramdisk = "/boot/initrd-domU"
+extra = "root=/dev/ram0 console=hvc0"
+memory = 512
+vif = [ "bridge=xenbr0", ]
+disk = [ ]
+'
+TIMEOUT_SECONDS=120
+
+# Select test variant.
+if [ "${TEST}" = "ping" ]; then
+    DOMU_MSG="domU online"
+    DOMU_CMD="
+ifconfig eth0 192.168.0.2
+until ping -c 10 192.168.0.1; do
+    sleep 1
+done
+echo \"${DOMU_MSG}\"
+"
+    DOM0_CMD="
+set +x
+until grep -q \"${DOMU_MSG}\" /var/log/xen/console/guest-domU.log; do
+    sleep 1
+done
+set -x
+echo \"${PASS_MSG}\"
+"
+else
+    fatal "Unknown test: ${TEST}"
+fi
+
+# Set up domU rootfs.
+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_CMD}
+" > etc/local.d/xen.start
+chmod +x etc/local.d/xen.start
+echo "rc_verbose=yes" >> etc/rc.conf
+sed -i -e 's/^Welcome/domU \0/' etc/issue
+find . | cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
+cd ..
+rm -rf rootfs
+
+# Set up dom0 rootfs.
+mkdir -p rootfs
+cd rootfs
+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
+
+# get domU console content into test log
+tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) 
/\" &
+xl create /etc/xen/domU.cfg
+${DOM0_CMD}
+" > etc/local.d/xen.start
+chmod +x etc/local.d/xen.start
+echo "${DOMU_CFG}" > 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 . | cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
+cd ..
+
+# Load software into TFTP server directory.
+TFTP="/scratch/gitlab-runner/tftp"
+XEN_CMDLINE="${XEN_CMD_CONSOLE} ${XEN_CMD_XEN} ${XEN_CMD_DOM0} 
${XEN_CMD_EXTRA}"
+cp -f binaries/xen ${TFTP}/pxelinux.cfg/xen
+cp -f binaries/bzImage ${TFTP}/pxelinux.cfg/vmlinuz
+cp -f binaries/dom0-rootfs.cpio.gz ${TFTP}/pxelinux.cfg/initrd-dom0
+echo "
+net_default_server=10.0.6.1
+multiboot2 (tftp)/pxelinux.cfg/xen ${XEN_CMDLINE}
+module2 (tftp)/pxelinux.cfg/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
+module2 (tftp)/pxelinux.cfg/initrd-dom0
+boot
+" > ${TFTP}/pxelinux.cfg/grub.cfg
+
+# Power cycle board and collect serial port output.
+SERIAL_CMD="cat /dev/ttyUSB9 | tee smoke.serial | sed 's/\r//'"
+sh /scratch/gitlab-runner/v2000a.sh 2
+sleep 5
+sh /scratch/gitlab-runner/v2000a.sh 1
+sleep 5
+set +e
+stty -F /dev/ttyUSB9 115200
+timeout -k 1 ${TIMEOUT_SECONDS} nohup sh -c "${SERIAL_CMD}"
+sh /scratch/gitlab-runner/v2000a.sh 2
+
+set -e
+
+if grep -q "${PASS_MSG}" smoke.serial; then
+    exit 0
+fi
+
+fatal "Test failed"
--
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.