Run s390x test in qemu system instead of qemu user
This commit is contained in:
parent
e83f20bc0d
commit
cd2e87d575
@ -1,12 +1,18 @@
|
||||
FROM ubuntu:17.10
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc libc6-dev qemu-user ca-certificates \
|
||||
gcc-s390x-linux-gnu libc6-dev-s390x-cross
|
||||
curl ca-certificates \
|
||||
gcc libc6-dev \
|
||||
gcc-s390x-linux-gnu libc6-dev-s390x-cross \
|
||||
qemu-system-s390x \
|
||||
cpio
|
||||
|
||||
COPY linux-s390x.sh /
|
||||
RUN bash /linux-s390x.sh
|
||||
|
||||
COPY test-runner-linux /
|
||||
|
||||
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
|
||||
# TODO: in theory we should execute this, but qemu segfaults immediately :(
|
||||
# CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /usr/s390x-linux-gnu" \
|
||||
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER=true \
|
||||
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux s390x" \
|
||||
CC_s390x_unknown_linux_gnu=s390x-linux-gnu-gcc \
|
||||
PATH=$PATH:/rust/bin
|
||||
|
18
ci/linux-s390x.sh
Normal file
18
ci/linux-s390x.sh
Normal file
@ -0,0 +1,18 @@
|
||||
set -ex
|
||||
|
||||
mkdir -m 777 /qemu
|
||||
cd /qemu
|
||||
|
||||
curl -LO https://github.com/qemu/qemu/raw/master/pc-bios/s390-ccw.img
|
||||
curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/kernel.debian
|
||||
curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/initrd.debian
|
||||
|
||||
mv kernel.debian kernel
|
||||
mv initrd.debian initrd.gz
|
||||
|
||||
mkdir init
|
||||
cd init
|
||||
gunzip -c ../initrd.gz | cpio -id
|
||||
rm ../initrd.gz
|
||||
cp /usr/s390x-linux-gnu/lib/libgcc_s.so.1 usr/lib/
|
||||
chmod a+w .
|
23
ci/test-runner-linux
Executable file
23
ci/test-runner-linux
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
arch=$1
|
||||
prog=$2
|
||||
|
||||
cd /qemu/init
|
||||
cp -f $2 prog
|
||||
find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
|
||||
cd ..
|
||||
|
||||
timeout 30s qemu-system-$arch \
|
||||
-m 1024 \
|
||||
-nographic \
|
||||
-kernel kernel \
|
||||
-initrd initrd.gz \
|
||||
-append init=/prog > output || true
|
||||
|
||||
# remove kernel messages
|
||||
tr -d '\r' < output | egrep -v '^\['
|
||||
|
||||
grep PASSED output > /dev/null
|
Loading…
Reference in New Issue
Block a user