|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 8/9] automation: add a tools-tests variant to the Xilinx arm64 script
The tests from tools/tests/* are only run on x86 hardware, by the
*-tools-tests-{pv,pvh}-x86_64-* CI jobs. Currently nothing runs them on
Arm. So, add a tools-tests variant to xilinx-smoke-dom0less-arm64.sh, to
run them on the Xilinx ZCU102 board.
The variant boots dom0 only, without a domU. Like on the x86 runners,
dom0 runs the tests with automation/scripts/run-tools-tests. As there is
no network access to the board, dom0 prints the JUnit report on the
console, which gets extracted from the log afterwards.
The domains created by test-mem-claim, test-paging-mempool and
test-resource have no P2M pool on Arm, so these tests would fail.
Exclude them for now.
Signed-off-by: Julian Vetter <julian.vetter@xxxxxxxxxx>
---
Changes in v8:
- New patch
---
.../scripts/xilinx-smoke-dom0less-arm64.sh | 45 ++++++++++++++++++-
1 file changed, 43 insertions(+), 2 deletions(-)
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 0060bdbd9b..fdf3c477df 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -5,9 +5,12 @@ set -ex -o pipefail
# One of: Testing:
# - (none) dom0less domU, ping dom0 via a vif
# - gem-passthrough dom0less domU, ping the gateway via a passed through
GEM
+# - tools-tests Run tests from tools/tests/* in dom0
test_variant=$1
### defaults
+failed=
+junit=
dom0_check=
domU_check=
domU_passthrough_dtb=
@@ -52,6 +55,31 @@ echo \"${passed}\"
domU_passthrough_path="/amba/ethernet@ff0e0000"
;;
+ ### test: tools-tests
+ "tools-tests")
+ passed="test passed"
+ failed="test failed"
+
+ # The domains these tests create on Arm have no P2M pool, so the
+ # tests fail. Exclude them until that is resolved.
+ tools_tests_exclude="test-mem-claim test-paging-mempool test-resource"
+
+ # Print the JUNIT output to the console.
+ junit=1
+ dom0_check="
+if /root/run-tools-tests /usr/lib/xen/tests /tmp/tests-junit.xml
${tools_tests_exclude}; then
+ result=\"${passed}\"
+else
+ result=\"${failed}\"
+fi
+
+echo '@@@ JUNIT BEGIN'
+cat /tmp/tests-junit.xml
+echo '@@@ JUNIT END'
+echo \"\${result}\"
+"
+ ;;
+
*)
echo "Unrecognised test_variant '${test_variant}'" >&2
exit 1
@@ -83,7 +111,8 @@ cat binaries/xen-tools.cpio.gz >>
binaries/dom0-rootfs.cpio.gz
# test-local configuration
mkdir -p rootfs
cd rootfs
-mkdir -p etc/local.d
+mkdir -p etc/local.d root
+cp -a ../automation/scripts/run-tools-tests root/
echo "#!/bin/bash
bash /etc/init.d/xencommons start
@@ -161,7 +190,7 @@ set +e
stty -F ${SERIAL_DEV} 115200 -echo
# Capture test result and power off board before exiting.
-export PASSED="${passed}"
+export PASSED="${passed}${failed:+|${failed}}"
export BOOT_MSG="Latest ChangeSet: "
export LOG_MSG="Welcome to Alpine Linux"
export TEST_CMD="cat ${SERIAL_DEV}"
@@ -170,4 +199,16 @@ export TEST_LOG="smoke.serial"
./automation/scripts/console.exp |& sed 's/\r\+$//'
TEST_RESULT=$?
sh "/scratch/gitlab-runner/zcu102.sh" 2
+
+if [ -n "${junit}" ]; then
+ # Extract the JUnit report from the console.
+ sed -e 's/\r\+$//' -e '1,/^@@@ JUNIT BEGIN$/d' -e '/^@@@ JUNIT END$/,$d' \
+ smoke.serial | grep -v -e '^(XEN)' -e '^$' > tests-junit.xml
+fi
+
+# console.exp also stops on the failure message.
+if [ -n "${failed}" ] && ! grep -q "^${passed}$" <(sed 's/\r\+$//'
smoke.serial); then
+ TEST_RESULT=1
+fi
+
exit ${TEST_RESULT}
--
2.53.0
--
Julian Vetter | Vates Hypervisor & Kernel Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |