]> Git Repo - qemu.git/blame - tests/check-block.sh
tests/avocado: clean-up socket directory after run
[qemu.git] / tests / check-block.sh
CommitLineData
b8c6f29e
KW
1#!/bin/sh
2
bdd95e47
TH
3# Honor the SPEED environment variable, just like we do it for the qtests.
4if [ "$SPEED" = "slow" ]; then
5 format_list="raw qcow2"
6 group=
7elif [ "$SPEED" = "thorough" ]; then
8 format_list="raw qcow2 qed vmdk vpc"
9 group=
10else
11 format_list=qcow2
12 group="-g auto"
13fi
14
c2519009 15if [ "$#" -ne 0 ]; then
bdd95e47
TH
16 format_list="$@"
17fi
18
4cc600d2 19if grep -q "CONFIG_GPROF=y" config-host.mak 2>/dev/null ; then
bdd95e47
TH
20 echo "GPROF is enabled ==> Not running the qemu-iotests."
21 exit 0
c2519009
DL
22fi
23
d6d1a65c
DB
24# Disable tests with any sanitizer except for SafeStack
25CFLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null )
26SANITIZE_FLAGS=""
27#Remove all occurrencies of -fsanitize=safe-stack
28for i in ${CFLAGS}; do
29 if [ "${i}" != "-fsanitize=safe-stack" ]; then
30 SANITIZE_FLAGS="${SANITIZE_FLAGS} ${i}"
31 fi
32done
33if echo ${SANITIZE_FLAGS} | grep -q "\-fsanitize" 2>/dev/null; then
34 # Have a sanitize flag that is not allowed, stop
2cc4d1c5
TH
35 echo "Sanitizers are enabled ==> Not running the qemu-iotests."
36 exit 0
37fi
38
bdd95e47
TH
39if [ -z "$(find . -name 'qemu-system-*' -print)" ]; then
40 echo "No qemu-system binary available ==> Not running the qemu-iotests."
41 exit 0
42fi
43
44if ! command -v bash >/dev/null 2>&1 ; then
45 echo "bash not available ==> Not running the qemu-iotests."
46 exit 0
47fi
b8c6f29e 48
0f3231bf
TH
49if LANG=C bash --version | grep -q 'GNU bash, version [123]' ; then
50 echo "bash version too old ==> Not running the qemu-iotests."
51 exit 0
52fi
53
bdd95e47
TH
54if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then
55 if ! command -v gsed >/dev/null 2>&1; then
56 echo "GNU sed not available ==> Not running the qemu-iotests."
57 exit 0
58 fi
b8c6f29e
KW
59fi
60
7467d94c 61cd tests/qemu-iotests
b8c6f29e 62
33fe08fc
TH
63# QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests
64export QEMU_CHECK_BLOCK_AUTO=1
65
b8c6f29e 66ret=0
bdd95e47
TH
67for fmt in $format_list ; do
68 ./check -makecheck -$fmt $group || ret=1
c2519009 69done
b8c6f29e
KW
70
71exit $ret
This page took 0.463433 seconds and 4 git commands to generate.