xref: /openbmc/qemu/tests/qemu-iotests/105 (revision 42a5009d)
111a82d14SPhilippe Mathieu-Daudé#!/usr/bin/env bash
29dd003a9SVladimir Sementsov-Ogievskiy# group: rw auto quick
3d1319b07SFam Zheng#
4d1319b07SFam Zheng# Create, read, write big image
5d1319b07SFam Zheng#
6d1319b07SFam Zheng# Copyright (C) 2014 Red Hat, Inc.
7d1319b07SFam Zheng#
8d1319b07SFam Zheng# This program is free software; you can redistribute it and/or modify
9d1319b07SFam Zheng# it under the terms of the GNU General Public License as published by
10d1319b07SFam Zheng# the Free Software Foundation; either version 2 of the License, or
11d1319b07SFam Zheng# (at your option) any later version.
12d1319b07SFam Zheng#
13d1319b07SFam Zheng# This program is distributed in the hope that it will be useful,
14d1319b07SFam Zheng# but WITHOUT ANY WARRANTY; without even the implied warranty of
15d1319b07SFam Zheng# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16d1319b07SFam Zheng# GNU General Public License for more details.
17d1319b07SFam Zheng#
18d1319b07SFam Zheng# You should have received a copy of the GNU General Public License
19d1319b07SFam Zheng# along with this program.  If not, see <http://www.gnu.org/licenses/>.
20d1319b07SFam Zheng#
21d1319b07SFam Zheng
22d1319b07SFam Zheng# creator
23*42a5009dSJohn Snowowner=fam@euphon.net
24d1319b07SFam Zheng
25d1319b07SFam Zhengseq=`basename $0`
26d1319b07SFam Zhengecho "QA output created by $seq"
27d1319b07SFam Zheng
28d1319b07SFam Zhengstatus=1	# failure is the default!
29d1319b07SFam Zheng
30d1319b07SFam Zheng_cleanup()
31d1319b07SFam Zheng{
32d1319b07SFam Zheng	_cleanup_test_img
33d1319b07SFam Zheng}
34d1319b07SFam Zhengtrap "_cleanup; exit \$status" 0 1 2 3 15
35d1319b07SFam Zheng
36d1319b07SFam Zheng# get standard environment, filters and checks
37d1319b07SFam Zheng. ./common.rc
38d1319b07SFam Zheng. ./common.filter
39d1319b07SFam Zheng
40d1319b07SFam Zheng_supported_fmt qcow2 vmdk vhdx qed
41d1319b07SFam Zheng_supported_proto generic
42d1319b07SFam Zheng_unsupported_imgopts "subformat=twoGbMaxExtentFlat" \
43325dd915SMax Reitz                     "subformat=twoGbMaxExtentSparse" \
44325dd915SMax Reitz                     "subformat=streamOptimized"
45d1319b07SFam Zheng
46d1319b07SFam Zhengecho
47d1319b07SFam Zhengecho "creating large image"
48d1319b07SFam Zheng_make_test_img 16T
49d1319b07SFam Zheng
50d1319b07SFam Zhengecho
51d1319b07SFam Zhengecho "small read"
52d1319b07SFam Zheng$QEMU_IO -c "read 1024 4096" "$TEST_IMG" | _filter_qemu_io
53d1319b07SFam Zheng
54d1319b07SFam Zhengecho
55d1319b07SFam Zhengecho "small write"
56d1319b07SFam Zheng$QEMU_IO -c "write 8192 4096" "$TEST_IMG" | _filter_qemu_io
57d1319b07SFam Zheng
58d1319b07SFam Zhengecho
59d1319b07SFam Zhengecho "small read at high offset"
60d1319b07SFam Zheng$QEMU_IO -c "read 14T 4096" "$TEST_IMG" | _filter_qemu_io
61d1319b07SFam Zheng
62d1319b07SFam Zhengecho
63d1319b07SFam Zhengecho "small write at high offset"
64d1319b07SFam Zheng$QEMU_IO -c "write 14T 4096" "$TEST_IMG" | _filter_qemu_io
65d1319b07SFam Zheng
66d1319b07SFam Zheng# success, all done
67d1319b07SFam Zhengecho "*** done"
68d1319b07SFam Zhengrm -f $seq.full
69d1319b07SFam Zhengstatus=0
70