qdev: add "check if address free" callback for buses
[qemu/kevin.git] / tests / check-block.sh
blobf6b1bda7b97b484291a25576a90922f82acfb88f
1 #!/bin/sh
3 # Honor the SPEED environment variable, just like we do it for the qtests.
4 if [ "$SPEED" = "slow" ]; then
5 format_list="raw qcow2"
6 group=
7 elif [ "$SPEED" = "thorough" ]; then
8 format_list="raw qcow2 qed vmdk vpc"
9 group=
10 else
11 format_list=qcow2
12 group="-g auto"
15 if [ "$#" -ne 0 ]; then
16 format_list="$@"
19 if grep -q "CONFIG_GPROF=y" config-host.mak 2>/dev/null ; then
20 echo "GPROF is enabled ==> Not running the qemu-iotests."
21 exit 0
24 # Disable tests with any sanitizer except for SafeStack
25 CFLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null )
26 SANITIZE_FLAGS=""
27 #Remove all occurrencies of -fsanitize=safe-stack
28 for i in ${CFLAGS}; do
29 if [ "${i}" != "-fsanitize=safe-stack" ]; then
30 SANITIZE_FLAGS="${SANITIZE_FLAGS} ${i}"
32 done
33 if echo ${SANITIZE_FLAGS} | grep -q "\-fsanitize" 2>/dev/null; then
34 # Have a sanitize flag that is not allowed, stop
35 echo "Sanitizers are enabled ==> Not running the qemu-iotests."
36 exit 0
39 if [ -z "$(find . -name 'qemu-system-*' -print)" ]; then
40 echo "No qemu-system binary available ==> Not running the qemu-iotests."
41 exit 0
44 if ! command -v bash >/dev/null 2>&1 ; then
45 echo "bash not available ==> Not running the qemu-iotests."
46 exit 0
49 if 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
54 if ! (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
61 cd tests/qemu-iotests
63 # QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests
64 export QEMU_CHECK_BLOCK_AUTO=1
66 ret=0
67 for fmt in $format_list ; do
68 ./check -makecheck -$fmt $group || ret=1
69 done
71 exit $ret