Commit 8cedcffd authored by Eric Blake's avatar Eric Blake
Browse files

iotests: Drop use of bash keyword 'function'



Bash allows functions to be declared with or without the leading
keyword 'function'; but including the keyword does not comply with
POSIX syntax, and is confusing to ksh users where the use of the
keyword changes the scoping rules for functions.  Stick to the
POSIX form through iotests.

Done mechanically with:
  sed -i 's/^function //' $(git ls-files tests/qemu-iotests)

Signed-off-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <20181116215002.2124581-1-eblake@redhat.com>
Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
parent bb39c47d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ echo
echo "creating image"
_make_test_img $size

function generate_requests() {
generate_requests() {
    for i in $(seq 0 63); do
        echo "aio_write ${i}M 512"
        echo "aio_write ${i}M 512"
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ TEST_IMG="$TEST_IMG.base"

_make_test_img $size

function backing_io()
backing_io()
{
    local offset=$1
    local sectors=$2
+3 −3
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ TEST_IMG="$TEST_IMG.base"

_make_test_img $size

function backing_io()
backing_io()
{
    local offset=$1
    local sectors=$2
@@ -76,7 +76,7 @@ _make_test_img -b "$TEST_IMG.base" 6G
echo
echo "== Some concurrent requests touching the same cluster =="

function overlay_io()
overlay_io()
{
    # Start with a request touching two clusters
    echo aio_write -P 0x80 2020k 80k
@@ -102,7 +102,7 @@ overlay_io | $QEMU_IO "$TEST_IMG" | _filter_qemu_io |\
echo
echo "== Verify image content =="

function verify_io()
verify_io()
{
    echo read -P 31 2016k 4k
    echo read -P 0x80 2020k 80k
+3 −3
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ echo "== creating backing file for COW tests =="

_make_test_img $size

function backing_io()
backing_io()
{
    local offset=$1
    local sectors=$2
@@ -73,7 +73,7 @@ _make_test_img -b "$TEST_IMG.base" 6G
echo
echo "== Some concurrent requests touching the same cluster =="

function overlay_io()
overlay_io()
{
# Allocate middle of cluster 1, then write to somewhere before and after it
cat  <<EOF
@@ -189,7 +189,7 @@ overlay_io | $QEMU_IO blkdebug::"$TEST_IMG" | _filter_qemu_io |\
echo
echo "== Verify image content =="

function verify_io()
verify_io()
{
    if ($QEMU_IMG info -U -f "$IMGFMT" "$TEST_IMG" | grep "compat: 0.10" > /dev/null); then
        # For v2 images, discarded clusters are read from the backing file
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ size=128M

_make_test_img $size

function qemu_io_cmds()
qemu_io_cmds()
{
cat <<EOF
write -P 0x66 0 320k
Loading