aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/common.pattern
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2018-11-16 15:50:02 -0600
committerEric Blake <eblake@redhat.com>2018-11-19 11:16:46 -0600
commit8cedcffdc195bc39aeb1373826ba0a45629741e0 (patch)
tree46509d211d6dcf12f6d2923e9a37a1667177f762 /tests/qemu-iotests/common.pattern
parentbb39c47d70e84acf5066f79eba27ae5945b837be (diff)
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: Eric Blake <eblake@redhat.com> Message-Id: <20181116215002.2124581-1-eblake@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/common.pattern')
-rw-r--r--tests/qemu-iotests/common.pattern16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/qemu-iotests/common.pattern b/tests/qemu-iotests/common.pattern
index 34f4a8dc9b..b67bb34136 100644
--- a/tests/qemu-iotests/common.pattern
+++ b/tests/qemu-iotests/common.pattern
@@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-function do_is_allocated() {
+do_is_allocated() {
local start=$1
local size=$2
local step=$3
@@ -27,11 +27,11 @@ function do_is_allocated() {
done
}
-function is_allocated() {
+is_allocated() {
do_is_allocated "$@" | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
}
-function do_io() {
+do_io() {
local op=$1
local start=$2
local size=$3
@@ -45,22 +45,22 @@ function do_io() {
done
}
-function io_pattern() {
+io_pattern() {
do_io "$@" | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
}
-function io() {
+io() {
local start=$2
local pattern=$(( (start >> 9) % 256 ))
do_io "$@" $pattern | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
}
-function io_zero() {
+io_zero() {
do_io "$@" 0 | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
}
-function io_test() {
+io_test() {
local op=$1
local offset=$2
local cluster_size=$3
@@ -100,7 +100,7 @@ function io_test() {
offset=$((offset + num_large * ( l2_size + half_cluster )))
}
-function io_test2() {
+io_test2() {
local orig_offset=$1
local cluster_size=$2
local num=$3