]> git.proxmox.com Git - mirror_qemu.git/blame - tests/check-block.sh
migration/tls: Use qcrypto_tls_creds_check_endpoint()
[mirror_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
24496fe8
DB
24# Disable tests with any sanitizer except for specific ones
25SANITIZE_FLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null )
26ALLOWED_SANITIZE_FLAGS="safe-stack cfi-icall"
27#Remove all occurrencies of allowed Sanitize flags
28for j in ${ALLOWED_SANITIZE_FLAGS}; do
29 TMP_FLAGS=${SANITIZE_FLAGS}
30 SANITIZE_FLAGS=""
31 for i in ${TMP_FLAGS}; do
32 if ! echo ${i} | grep -q "${j}" 2>/dev/null; then
33 SANITIZE_FLAGS="${SANITIZE_FLAGS} ${i}"
d6d1a65c 34 fi
24496fe8 35 done
d6d1a65c
DB
36done
37if echo ${SANITIZE_FLAGS} | grep -q "\-fsanitize" 2>/dev/null; then
38 # Have a sanitize flag that is not allowed, stop
2cc4d1c5
TH
39 echo "Sanitizers are enabled ==> Not running the qemu-iotests."
40 exit 0
41fi
42
bdd95e47
TH
43if [ -z "$(find . -name 'qemu-system-*' -print)" ]; then
44 echo "No qemu-system binary available ==> Not running the qemu-iotests."
45 exit 0
46fi
47
48if ! command -v bash >/dev/null 2>&1 ; then
49 echo "bash not available ==> Not running the qemu-iotests."
50 exit 0
51fi
b8c6f29e 52
0f3231bf
TH
53if LANG=C bash --version | grep -q 'GNU bash, version [123]' ; then
54 echo "bash version too old ==> Not running the qemu-iotests."
55 exit 0
56fi
57
bdd95e47
TH
58if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then
59 if ! command -v gsed >/dev/null 2>&1; then
60 echo "GNU sed not available ==> Not running the qemu-iotests."
61 exit 0
62 fi
872cda9c
TH
63else
64 # Double-check that we're not using BusyBox' sed which says
65 # that "This is not GNU sed version 4.0" ...
66 if sed --version | grep -q 'not GNU sed' ; then
67 echo "BusyBox sed not supported ==> Not running the qemu-iotests."
68 exit 0
69 fi
b8c6f29e
KW
70fi
71
7467d94c 72cd tests/qemu-iotests
b8c6f29e 73
33fe08fc
TH
74# QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests
75export QEMU_CHECK_BLOCK_AUTO=1
f203080b 76export PYTHONUTF8=1
33fe08fc 77
b8c6f29e 78ret=0
bdd95e47 79for fmt in $format_list ; do
f203080b 80 ${PYTHON} ./check -makecheck -$fmt $group || ret=1
c2519009 81done
b8c6f29e
KW
82
83exit $ret