git \
gzip \
file \
+ expect \
&& \
apt-get autoremove -y && \
apt-get clean && \
variables:
CONTAINER: ubuntu:xenial-xilinx
LOGFILE: qemu-smoke-xilinx.log
+ TEST_TIMEOUT: 120
artifacts:
paths:
- smoke.serial
LOGFILE: xilinx-smoke-x86_64.log
XEN_CMD_CONSOLE: "console=com2 com2=115200,8n1,0x2F8,4"
TEST_BOARD: "crater"
+ TEST_TIMEOUT: 1000
artifacts:
paths:
- smoke.serial
--- /dev/null
+#!/usr/bin/expect -f
+
+if {[info exists env(TEST_TIMEOUT)]} {
+ set timeout $env(TEST_TIMEOUT)
+} else {
+ set timeout 1500
+}
+
+log_file -a $env(TEST_LOG)
+
+match_max 10000
+
+eval spawn $env(TEST_CMD)
+
+expect_after {
+ -re "(.*)\r" {
+ exp_continue -continue_timer
+ }
+ timeout {send_error "ERROR-Timeout!\n"; exit 1}
+ eof {send_error "ERROR-EOF!\n"; exit 1}
+}
+
+if {[info exists env(UBOOT_CMD)]} {
+ expect "=>"
+
+ send "$env(UBOOT_CMD)\r"
+}
+
+if {[info exists env(LOG_MSG)]} {
+ expect {
+ "$env(PASSED)" {
+ expect "$env(LOG_MSG)"
+ exit 0
+ }
+ "$env(LOG_MSG)" {
+ expect "$env(PASSED)"
+ exit 0
+ }
+ }
+}
+
+expect {
+ "$env(PASSED)" {
+ exit 0
+ }
+}
+
+expect eof
+
# Run the test
rm -f smoke.serial
-export QEMU_CMD="qemu-system-x86_64 \
+export TEST_CMD="qemu-system-x86_64 \
-cpu qemu64,+svm \
-m 2G -smp 2 \
-monitor none -serial stdio \
-device virtio-net-pci,netdev=n0 \
-netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"
-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
export LOG_MSG="Domain-0"
export PASSED="BusyBox"
-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
+++ /dev/null
-#!/usr/bin/expect -f
-
-if {[info exists env(QEMU_TIMEOUT)]} {
- set timeout $env(QEMU_TIMEOUT)
-} else {
- set timeout 1500
-}
-
-log_file -a $env(QEMU_LOG)
-
-match_max 10000
-
-eval spawn $env(QEMU_CMD)
-
-expect_after {
- -re "(.*)\r" {
- exp_continue -continue_timer
- }
- timeout {send_error "ERROR-Timeout!\n"; exit 1}
- eof {send_error "ERROR-EOF!\n"; exit 1}
-}
-
-if {[info exists env(UBOOT_CMD)]} {
- expect "=>"
-
- send "$env(UBOOT_CMD)\r"
-}
-
-if {[info exists env(LOG_MSG)]} {
- expect {
- "$env(PASSED)" {
- expect "$env(LOG_MSG)"
- exit 0
- }
- "$env(LOG_MSG)" {
- expect "$env(PASSED)"
- exit 0
- }
- }
-}
-
-expect {
- "$env(PASSED)" {
- exit 0
- }
-}
-
-expect eof
-
bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
rm -f ${serial_log}
-export QEMU_CMD="./qemu-system-arm \
+export TEST_CMD="./qemu-system-arm \
-machine virt \
-machine virtualization=true \
-smp 4 \
-bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="${serial_log}"
+export TEST_LOG="${serial_log}"
export LOG_MSG="Domain-0"
export PASSED="/ #"
-../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+../automation/scripts/console.exp | sed 's/\r\+$//'
# Run the test
rm -f smoke.serial
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD="./binaries/qemu-system-aarch64 \
-machine virtualization=true \
-cpu cortex-a57 -machine type=virt \
-m 2048 -monitor none -serial stdio \
-bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
export LOG_MSG="Domain-0"
export PASSED="BusyBox"
-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
# Run the test
rm -f ${serial_log}
-export QEMU_CMD="./qemu-system-arm \
+export TEST_CMD="./qemu-system-arm \
-machine virt \
-machine virtualization=true \
-smp 4 \
-bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="${serial_log}"
+export TEST_LOG="${serial_log}"
export LOG_MSG="${dom0_prompt}"
export PASSED="${passed}"
-../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+../automation/scripts/console.exp | sed 's/\r\+$//'
# Run the test
rm -f smoke.serial
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD="./binaries/qemu-system-aarch64 \
-machine virtualization=true \
-cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
-m 2048 -monitor none -serial stdio \
-bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
export LOG_MSG="Welcome to Alpine Linux"
export PASSED="${passed}"
-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
# Run the test
rm -f ${serial_log}
-export QEMU_CMD="qemu-system-ppc64 \
+export TEST_CMD="qemu-system-ppc64 \
-bios skiboot.lid \
-M $machine \
-m 2g \
-serial stdio \
-kernel binaries/xen"
-export QEMU_LOG="${serial_log}"
+export TEST_LOG="${serial_log}"
export PASSED="Hello, ppc64le!"
-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
# Run the test
rm -f smoke.serial
-export QEMU_CMD="qemu-system-riscv64 \
+export TEST_CMD="qemu-system-riscv64 \
-M virt \
-smp 1 \
-nographic \
-m 2g \
-kernel binaries/xen"
-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
export PASSED="All set up"
-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
esac
rm -f smoke.serial
-export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
+export TEST_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
-initrd xtf/tests/example/$k \
-append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
-m 512 -monitor none -serial stdio"
-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
export PASSED="Test result: SUCCESS"
-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
# Run the test
rm -f smoke.serial
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD="./binaries/qemu-system-aarch64 \
-machine virtualization=true \
-cpu cortex-a57 -machine type=virt \
-m 2048 -monitor none -serial stdio \
-bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
export PASSED="${passed}"
-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
-#!/bin/sh
+#!/usr/bin/env bash
# Run x86_64 dom0 tests on hardware.
-set -ex
+set -ex -o pipefail
fatal() {
echo "$(basename "$0") $*" >&2
vif = [ "bridge=xenbr0", ]
disk = [ ]
'
-TIMEOUT_SECONDS=200
# Select test variant.
if [ "${TEST}" = "ping" ]; then
# Power cycle board and collect serial port output.
SERIAL_DEV="/dev/serial/${TEST_BOARD}"
-SERIAL_CMD="cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
sleep 5
sh /scratch/gitlab-runner/${TEST_BOARD}.sh 1
sleep 5
set +e
stty -F ${SERIAL_DEV} 115200
-timeout -k 1 ${TIMEOUT_SECONDS} nohup sh -c "${SERIAL_CMD}"
-sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
-
-set -e
-if grep -q "${PASS_MSG}" smoke.serial; then
- exit 0
-fi
+# Capture test result and power off board before exiting.
+export PASSED="${PASS_MSG}"
+export TEST_CMD="cat ${SERIAL_DEV}"
+export TEST_LOG="smoke.serial"
-fatal "Test failed"
+./automation/scripts/console.exp | sed 's/\r\+$//'
+TEST_RESULT=$?
+sh "/scratch/gitlab-runner/${TEST_BOARD}.sh" 2
+exit ${TEST_RESULT}
#!/bin/bash
-set -ex
+set -ex -o pipefail
test_variant=$1
SERIAL_DEV="/dev/serial/zynq"
set +e
stty -F ${SERIAL_DEV} 115200
-timeout -k 1 120 nohup sh -c "cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
-# stop the board
-cd /scratch/gitlab-runner
-bash zcu102.sh 2
-cd $START
+# Capture test result and power off board before exiting.
+export PASSED="${passed}"
+export LOG_MSG="Welcome to Alpine Linux"
+export TEST_CMD="cat ${SERIAL_DEV}"
+export TEST_LOG="smoke.serial"
-set -e
-(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
-exit 0
+./automation/scripts/console.exp | sed 's/\r\+$//'
+TEST_RESULT=$?
+sh "/scratch/gitlab-runner/zcu102.sh" 2
+exit ${TEST_RESULT}