]> git.proxmox.com Git - ceph.git/blame - ceph/qa/workunits/rbd/qemu-iotests.sh
import 15.2.0 Octopus source
[ceph.git] / ceph / qa / workunits / rbd / qemu-iotests.sh
CommitLineData
7c673cae
FG
1#!/bin/sh -ex
2
3# Run qemu-iotests against rbd. These are block-level tests that go
4# through qemu but do not involve running a full vm. Note that these
5# require the admin ceph user, as there's no way to pass the ceph user
6# to qemu-iotests currently.
7
8testlist='001 002 003 004 005 008 009 010 011 021 025 032 033 055'
9
10git clone https://github.com/qemu/qemu.git
11cd qemu
81eedcae
TL
12if lsb_release -da 2>&1 | grep -iq 'bionic'; then
13 # Bionic requires a matching test harness
14 git checkout v2.11.0
9f95a23c 15elif lsb_release -da 2>&1 | grep -iqE '(xenial|linux release 8)'; then
7c673cae
FG
16 # Xenial requires a recent test harness
17 git checkout v2.3.0
18else
19 # use v2.2.0-rc3 (last released version that handles all the tests
20 git checkout 2528043f1f299e0e88cb026f1ca7c40bbb4e1f80
7c673cae
FG
21fi
22
23cd tests/qemu-iotests
24mkdir bin
25# qemu-iotests expects a binary called just 'qemu' to be available
26if [ -x '/usr/bin/qemu-system-x86_64' ]
27then
28 QEMU='/usr/bin/qemu-system-x86_64'
81eedcae
TL
29
30 # Bionic (v2.11.0) tests expect all tools in current directory
31 ln -s $QEMU qemu
32 ln -s /usr/bin/qemu-img
33 ln -s /usr/bin/qemu-io
34 ln -s /usr/bin/qemu-nbd
7c673cae
FG
35else
36 QEMU='/usr/libexec/qemu-kvm'
37
38 # disable test 055 since qemu-kvm (RHEL/CentOS) doesn't support the
9f95a23c
TL
39 # required QMP commands under EL7 and Python 3 is not supported by
40 # the test under EL8
7c673cae
FG
41 testlist=$(echo ${testlist} | sed "s/ 055//g")
42fi
43ln -s $QEMU bin/qemu
44
45# this is normally generated by configure, but has nothing but a python
46# binary definition, which we don't care about. for some reason it is
47# not present on trusty.
48touch common.env
49
50# TEST_DIR is the pool for rbd
51TEST_DIR=rbd PATH="$PATH:$PWD/bin" ./check -rbd $testlist
52
53cd ../../..
54rm -rf qemu