[xen staging] automation: add qemu smoke test

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen staging] automation: add qemu smoke test

patchbot
commit 29e284512f03e0b213372ebc4b983e5ef5994e29
Author:     Wei Liu <[hidden email]>
AuthorDate: Mon Nov 19 16:32:15 2018 +0000
Commit:     Wei Liu <[hidden email]>
CommitDate: Tue Nov 20 18:15:46 2018 +0000

    automation: add qemu smoke test
   
    This patch introduces a new test stage into the pipeline and provides
    a simple QEMU based smoke test.
   
    Signed-off-by: Wei Liu <[hidden email]>
    Acked-by: Doug Goldstein <[hidden email]>
---
 .gitlab-ci.yml                          | 20 ++++++++++++++++++++
 automation/scripts/qemu-smoke-x86-64.sh | 23 +++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a1672a9a91..b3ca779e21 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,6 @@
 stages:
   - build
+  - test
 
 .build-tmpl: &build
   stage: build
@@ -379,3 +380,22 @@ debian-unstable-gcc-debug-arm64-randconfig:
   variables:
     CONTAINER: debian:unstable-arm64v8
     RANDCONFIG: y
+
+
+# Test jobs
+qemu-smoke-x86-64:
+  stage: test
+  image: registry.gitlab.com/xen-project/xen/${CONTAINER}
+  variables:
+    CONTAINER: debian:stretch
+  script:
+    - ./automation/scripts/qemu-smoke-x86-64.sh 2>&1 | tee qemu-smoke-x86-64.log
+  artifacts:
+    paths:
+      - smoke.serial
+      - '*.log'
+    when: always
+  dependencies:
+    - debian-stretch-gcc-debug
+  tags:
+    - x86_64
diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
new file mode 100755
index 0000000000..7dc2c8542b
--- /dev/null
+++ b/automation/scripts/qemu-smoke-x86-64.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -ex
+
+# Install QEMU
+export DEBIAN_FRONTENT=noninteractive
+apt-get -qy update
+apt-get -qy install qemu-system-x86
+
+# Clone and build XTF
+git clone https://xenbits.xen.org/git-http/xtf.git
+cd xtf && make -j$(nproc) && cd -
+
+rm -f smoke.serial
+set +e
+timeout -k 1 10 \
+qemu-system-x86_64 -nographic -kernel binaries/xen \
+        -initrd xtf/tests/example/test-pv32pae-example \
+        -append 'loglvl=all com1=115200,,8n1 console=com1 noreboot' \
+        -m 512 -monitor none -serial file:smoke.serial
+set -e
+grep -q 'Test result: SUCCESS' smoke.serial || exit 1
+exit 0
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog