aboutsummaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests/common.pattern
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qemu-iotests/common.pattern')
-rw-r--r--tests/qemu-iotests/common.pattern15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/qemu-iotests/common.pattern b/tests/qemu-iotests/common.pattern
index 9e7f2f20d..12f813d81 100644
--- a/tests/qemu-iotests/common.pattern
+++ b/tests/qemu-iotests/common.pattern
@@ -18,6 +18,21 @@
# USA
#
+function do_is_allocated() {
+ local start=$1
+ local size=$(( $2 / 512))
+ local step=$3
+ local count=$4
+
+ for i in `seq 1 $count`; do
+ echo alloc $(( start + i * step )) $size
+ done
+}
+
+function is_allocated() {
+ do_is_allocated "$@" | $QEMU_IO $TEST_IMG | _filter_qemu_io
+}
+
function do_io() {
local op=$1
local start=$2