qemu-patch-raspberry4/tests/check-block.sh
Mao Zhongyi e8d81a61e1 qemu-iotests: convert pwd and $(pwd) to $PWD
POSIX requires $PWD to be reliable, and we expect all
shells used by qemu scripts to be relatively close to
POSIX.  Thus, it is smarter to avoid forking the pwd
executable for something that is already available in
the environment.

So replace it with the following:

sed -i 's/\(`pwd`\|\$(pwd)\)/$PWD/g' $(git grep -l pwd)

Then delete a pointless line assigning PWD to itself.

Cc: kwolf@redhat.com
Cc: mreitz@redhat.com
Cc: eblake@redhat.com
Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Message-Id: <20181024094051.4470-2-maozhongyi@cmss.chinamobile.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: touch up commit message, reorder series, tweak a couple more files]
Signed-off-by: Eric Blake <eblake@redhat.com>
2018-11-19 10:08:19 -06:00

25 lines
443 B
Bash
Executable file

#!/bin/sh
FORMAT_LIST="raw qcow2 qed vmdk vpc"
if [ "$#" -ne 0 ]; then
FORMAT_LIST="$@"
fi
export QEMU_PROG="$PWD/x86_64-softmmu/qemu-system-x86_64"
export QEMU_IMG_PROG="$PWD/qemu-img"
export QEMU_IO_PROG="$PWD/qemu-io"
if [ ! -x $QEMU_PROG ]; then
echo "'make check-block' requires qemu-system-x86_64"
exit 1
fi
cd tests/qemu-iotests
ret=0
for FMT in $FORMAT_LIST ; do
./check -T -nocache -$FMT || ret=1
done
exit $ret