Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / qa / workunits / rbd / qemu-iotests.sh
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
8 testlist='001 002 003 004 005 008 009 010 011 021 025 032 033 055'
9
10 git clone https://github.com/qemu/qemu.git
11 cd qemu
12 if lsb_release -da | grep -iq xenial; then
13     # Xenial requires a recent test harness
14     git checkout v2.3.0
15 else
16     # use v2.2.0-rc3 (last released version that handles all the tests
17     git checkout 2528043f1f299e0e88cb026f1ca7c40bbb4e1f80
18
19 fi
20
21 cd tests/qemu-iotests
22 mkdir bin
23 # qemu-iotests expects a binary called just 'qemu' to be available
24 if [ -x '/usr/bin/qemu-system-x86_64' ]
25 then
26     QEMU='/usr/bin/qemu-system-x86_64'
27 else
28     QEMU='/usr/libexec/qemu-kvm'
29
30     # disable test 055 since qemu-kvm (RHEL/CentOS) doesn't support the
31     # required QMP commands
32     testlist=$(echo ${testlist} | sed "s/ 055//g")
33 fi
34 ln -s $QEMU bin/qemu
35
36 # this is normally generated by configure, but has nothing but a python
37 # binary definition, which we don't care about.  for some reason it is
38 # not present on trusty.
39 touch common.env
40
41 # TEST_DIR is the pool for rbd
42 TEST_DIR=rbd PATH="$PATH:$PWD/bin" ./check -rbd $testlist
43
44 cd ../../..
45 rm -rf qemu