diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2014-09-30 12:17:44 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2017-07-24 12:38:05 +0100 |
commit | 639348834f14ff689ad32ecbb21011eace4e2b6d (patch) | |
tree | 263923c3c1e1bfe8896e5160e62cddc134edf1ae /ubuntu | |
parent | 9752efabbe6d11ef127f19fb905fdd6d40fbb912 (diff) |
new: add qemu build and LTP tests
This introduces two test definitions to aid with build and test of qemu.
They are:
- build-qemu-from-source.yaml - build and install
- install-qemu-chroot - installing chroots for test
There is also a change to make the ubuntu LTP tests use a script for
running so the whole thing can be wrapped in a chroot and run under QEMU
control. As we need the HEAD of the LTP tests for aarch64 currently
added a mode to build against the latest LTP tests
Change-Id: I4b0571f845d73da190c1362e43bb2fe1e323c0f3
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
v3
- better error checking/reporting
- add wget dependancy
- Use PWD to bind mount /lava-${HOST}
v4
- re-base against latest definitions
- fixes for PWD/OLDPWD changing
- handle moving LAVA_DIR
- fix script for handling snapshots
v5
- use ${HOME} where appropriate to avoid hardwiring
- add || true to carry on if we crash out of the LTP tests in QEMU
- remove a libseccomp-dev dependency from QEMU (not available on aarch64)
- add a safety mkdir -p for chroot in case /home not there
- use correct fixup dictionary
v6
- re-base, rm rt-ltp.yaml
v7
- re-base
v8
- speed up build using submodule pre-seed
- move gnutls pkg install to script (Jessie vs Trusty)
v9
- re-base
- --disable-gnutls for QEMU build
build-qemu: disable-gnutls
This causes problems with dependencies and static builds as well as not
being really used.
v10
- fix chroot - the old chroot had gone stale
Diffstat (limited to 'ubuntu')
-rw-r--r-- | ubuntu/build-qemu-from-source.yaml | 59 | ||||
-rw-r--r-- | ubuntu/install-qemu-chroot.yaml | 46 | ||||
-rw-r--r-- | ubuntu/ltp-realtime.yaml | 26 | ||||
-rw-r--r-- | ubuntu/ltp.yaml | 17 | ||||
-rwxr-xr-x | ubuntu/scripts/ltp-build.sh | 56 |
5 files changed, 189 insertions, 15 deletions
diff --git a/ubuntu/build-qemu-from-source.yaml b/ubuntu/build-qemu-from-source.yaml new file mode 100644 index 0000000..2b91a24 --- /dev/null +++ b/ubuntu/build-qemu-from-source.yaml @@ -0,0 +1,59 @@ +metadata: + name: qemu-build + format: "Lava-Test-Shell Test Definition 1.0" + description: "Build QEMU from source" + maintainer: + - alex.bennee@linaro.org + os: + - ubuntu + scope: + - functional + devices: + - kvm + - x86 + +params: + REPO: git://git.qemu.org/qemu.git + BRANCH: master + TARGET: arm-linux-user + BUILD_OPTS: --static --disable-strip --disable-gnutls + +install: + # As we sometimes need an installed QEMU for other steps the actual build will + # be done in the install steps. However we repeat the build targets to get the + # test results in the run steps. + steps: + - cd ${HOME} + - git clone ${REPO} qemu.git + - cd qemu.git + - git checkout -b build origin/${BRANCH} + - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ + - git submodule update --init --recursive + - ./configure ${BUILD_OPTS} --target-list=${TARGET} + - make + - make install + + deps: + - build-essential + - python + - git-core + - pkg-config + - autoconf + - automake + - autotools-dev + - libtool + - bison + - flex + - zlib1g-dev + - libglib2.0-dev + - libusb-1.0-0-dev + - librados-dev + - libncurses5-dev + - libnss3-dev + +run: + steps: + - cd ${HOME}/qemu.git + - lava-test-case qemu-make --shell make + - lava-test-case qemu-make-install --shell make install + - lava-test-case qemu-make-check --shell make check diff --git a/ubuntu/install-qemu-chroot.yaml b/ubuntu/install-qemu-chroot.yaml new file mode 100644 index 0000000..092dd8a --- /dev/null +++ b/ubuntu/install-qemu-chroot.yaml @@ -0,0 +1,46 @@ +metadata: + name: install-qemu-setup + format: "Lava-Test-Shell Test Definition 1.0" + description: "Setup a system QEMU chroot and set-up binfmt_misc" + maintainer: + - alex.bennee@linaro.org + os: + - ubuntu + scope: + - functional + devices: + - kvm + +params: + # Location of chroot + CHROOT: /home/chroot + ARCH: aarch64 + ROOTFS: https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-arm64-root.tar.gz + +install: + steps: + - TESTS_DIR=`dirname $PWD` + - LAVA_DIR=`dirname $TESTS_DIR` + - CHROOT_LAVA_DIR=${CHROOT}${LAVA_DIR} + - mkdir -p ${CHROOT} + - cd /home + - wget -O chroot.tar ${ROOTFS} + - tar -x -C ${CHROOT} -f chroot.tar + - mkdir -p ${CHROOT}/usr/local/bin + - mount -o bind /usr/local/bin ${CHROOT}/usr/local/bin + - mkdir -p ${CHROOT_LAVA_DIR} + - mount -o bind ${LAVA_DIR} ${CHROOT_LAVA_DIR} + - mkdir -p ${CHROOT}/home + - mount -o bind /home ${CHROOT}/home + - ${OLDPWD}/common/scripts/qemu-binfmt.sh || true + + deps: + - wget + - coreutils + - binfmt-support + +run: + steps: + - lava-test-case qemu-fetched-chroot --shell test -e /home/chroot.tar + - lava-test-case qemu-extracted-chroot --shell test -e ${CHROOT}/home + - lava-test-case qemu-setup-chroot --shell test -e /proc/sys/fs/binfmt_misc/${ARCH} diff --git a/ubuntu/ltp-realtime.yaml b/ubuntu/ltp-realtime.yaml index d807c2e..4fb7c82 100644 --- a/ubuntu/ltp-realtime.yaml +++ b/ubuntu/ltp-realtime.yaml @@ -15,25 +15,23 @@ metadata: - arndale - vexpress-a9 - vexpress-tc2 + - kvm + - x86 + +params: + # Modify chroot if you want to run inside a QEMU world after setting + # up a chroot with install-qemu-chroot.yaml + CHROOT: / + LTP_RELEASE: 20140422 install: steps: - - 'wget http://sourceforge.net/projects/ltp/files/LTP%20Source/ltp-20140422/ltp-full-20140422.tar.xz' - - 'tar --strip-components=1 -Jxf ltp-full-20140422.tar.xz' - - 'mkdir build' - - './configure --with-realtime-testsuite --prefix=$(readlink -f build)' - - 'make all' - - 'make SKIP_IDCHECK=1 install' - deps: - - bzip2 - - flex - - bison - - build-essential - - wget + - chroot ${CHROOT} apt-get update + - chroot ${CHROOT} apt-get install -y --force-yes git-core autoconf bzip2 flex bison build-essential wget + - chroot ${CHROOT} ${PWD}/ubuntu/scripts/ltp-build.sh -r ${LTP_RELEASE} -- --with-realtime-testsuite run: steps: - - 'cd build' - - 'sudo ./runltp -f test_realtime -p -q' + - chroot ${CHROOT} /home/ltp/build/runltp -f test_realtime -p -q parse: pattern: "^(?P<test_case_id>\\S+)\\s+\\d+\\s+(?P<result>\\w+)\\s+:\\s+.+" diff --git a/ubuntu/ltp.yaml b/ubuntu/ltp.yaml index 486ba88..80181dd 100644 --- a/ubuntu/ltp.yaml +++ b/ubuntu/ltp.yaml @@ -5,8 +5,10 @@ metadata: maintainer: - milosz.wasilewski@linaro.org - fathi.boudra@linaro.org + - alex.bennee@linaro.org os: - ubuntu + - debian scope: - functional devices: @@ -16,6 +18,8 @@ metadata: - vexpress-a9 - vexpress-tc2 - ifc6410 + - kvm + - x86 install: steps: @@ -38,6 +42,11 @@ install: - curl params: + # Modify chroot if you want to run inside a QEMU world after setting + # up a chroot with install-qemu-chroot.yaml + CHROOT: / + # Last snapshot used is 20150119, set to HEAD for tip of tree (bleeding edge) + LTP_RELEASE: 20150119 TST_CMDFILES: syscalls,mm,math,timers,fcntl-locktests,ipc,fsx,fs,hugetlb,io,nptl,pty,containers,fs_bind,filecaps,admin_tools,connectors # SKIPFILE can be a filename from dir ../common/scripts/ltp/ or an open URL # SKIPFILE: "skipfile-lsk-juno" @@ -47,9 +56,15 @@ params: # NOTE: busybox wget may not work with https link so pefer to use http SKIPFILE: "" +install: + steps: + - chroot ${CHROOT} apt-get update + - chroot ${CHROOT} apt-get install -y --force-yes git-core autoconf bzip2 flex bison build-essential wget + - chroot ${CHROOT} ${PWD}/ubuntu/scripts/ltp-build.sh -r ${LTP_RELEASE} + run: steps: - - './common/scripts/ltpfixup.sh -T $TST_CMDFILES -P /opt/ltp/build -S $SKIPFILE' + - chroot ${CHROOT} ${HOME}/ltp/build/runltp -f syscalls -p -q || true parse: pattern: "^(?!.+ED)(?P<test_case_id>\\w+)\\s+(?P<result>PASS|FAIL|CONF)\\s+\\d+" diff --git a/ubuntu/scripts/ltp-build.sh b/ubuntu/scripts/ltp-build.sh new file mode 100755 index 0000000..d03849a --- /dev/null +++ b/ubuntu/scripts/ltp-build.sh @@ -0,0 +1,56 @@ +#!/bin/sh +# +# Build and the LTP Tests in script form +# +# This is to work around doing the build steps in the yaml which would need +# magic chroot support (or a lot of hacking to exsiting script) +# +# ensure we follow the steps we run and bomb out +set -x +set -e + +LTP_RELEASE=20130904 + +# Print out some simple usage instructions +usage() { + echo "Usage: `basename $0` [-r RELEASE] <additional configure options>" + echo "" + echo "This script is used to install or run the LTP tests." + exit 1 +} + +while getopts "hr:" opt +do + case $opt in + h) + usage + ;; + r) + LTP_RELEASE=$OPTARG + ;; + + *) + echo "Unknown option." + usage + ;; + esac +done + +shift $(( $OPTIND -1 )) + +# Download and install the LTP tests +mkdir -p ${HOME}/ltp +cd ${HOME}/ltp +if [ "x${LTP_RELEASE}" = "xHEAD" ]; then + git clone http://github.com/linux-test-project/ltp.git . + make autotools +else + wget http://sourceforge.net/projects/ltp/files/LTP%20Source/ltp-${LTP_RELEASE}/ltp-full-${LTP_RELEASE}.tar.xz + tar --strip-components=1 -xf ltp-full-${LTP_RELEASE}.tar.xz +fi +mkdir build +./configure --prefix=$(readlink -f build) $@ +make all +make SKIP_IDCHECK=1 install + +exit 0 |