qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio
at master 63 lines 1.6 kB view raw
1#!/bin/sh 2 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 15if [ "$#" -ne 0 ]; then 16 format_list="$@" 17fi 18 19if 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 22fi 23 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 35 echo "Sanitizers are enabled ==> Not running the qemu-iotests." 36 exit 0 37fi 38 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 48 49if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then 50 if ! command -v gsed >/dev/null 2>&1; then 51 echo "GNU sed not available ==> Not running the qemu-iotests." 52 exit 0 53 fi 54fi 55 56cd tests/qemu-iotests 57 58ret=0 59for fmt in $format_list ; do 60 ./check -makecheck -$fmt $group || ret=1 61done 62 63exit $ret