]> git.proxmox.com Git - ceph.git/blob - ceph/qa/workunits/rbd/qemu-iotests.sh
b723fa26d80c235ebb0f6ba3890092a80f8ee789
[ceph.git] / 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'
9
10 git clone https://github.com/qemu/qemu.git
11 cd qemu
12
13
14 if grep -iqE '(bionic|focal|jammy)' /etc/os-release; then
15 # Bionic requires a matching test harness
16 git checkout v2.11.0
17 elif grep -iqE '(xenial|platform:el8)' /etc/os-release; then
18 # Xenial requires a recent test harness
19 git checkout v2.3.0
20 else
21 # use v2.2.0-rc3 (last released version that handles all the tests
22 git checkout 2528043f1f299e0e88cb026f1ca7c40bbb4e1f80
23 fi
24
25 cd tests/qemu-iotests
26 mkdir bin
27 # qemu-iotests expects a binary called just 'qemu' to be available
28 if [ -x '/usr/bin/qemu-system-x86_64' ]
29 then
30 QEMU='/usr/bin/qemu-system-x86_64'
31
32 # Bionic (v2.11.0) tests expect all tools in current directory
33 ln -s $QEMU qemu
34 ln -s /usr/bin/qemu-img
35 ln -s /usr/bin/qemu-io
36 ln -s /usr/bin/qemu-nbd
37 else
38 QEMU='/usr/libexec/qemu-kvm'
39 fi
40 ln -s $QEMU bin/qemu
41
42 # this is normally generated by configure, but has nothing but a python
43 # binary definition, which we don't care about. for some reason it is
44 # not present on trusty.
45 touch common.env
46
47 # TEST_DIR is the pool for rbd
48 TEST_DIR=rbd PATH="$PATH:$PWD/bin" ./check -rbd $testlist
49
50 cd ../../..
51 rm -rf qemu