xref: /openbmc/qemu/tests/qemu-iotests/107 (revision 42a5009d)
111a82d14SPhilippe Mathieu-Daudé#!/usr/bin/env bash
29dd003a9SVladimir Sementsov-Ogievskiy# group: rw auto quick
31b2dd0beSMax Reitz#
41b2dd0beSMax Reitz# Tests updates of the qcow2 L1 table
51b2dd0beSMax Reitz#
61b2dd0beSMax Reitz# Copyright (C) 2014 Red Hat, Inc.
71b2dd0beSMax Reitz#
81b2dd0beSMax Reitz# This program is free software; you can redistribute it and/or modify
91b2dd0beSMax Reitz# it under the terms of the GNU General Public License as published by
101b2dd0beSMax Reitz# the Free Software Foundation; either version 2 of the License, or
111b2dd0beSMax Reitz# (at your option) any later version.
121b2dd0beSMax Reitz#
131b2dd0beSMax Reitz# This program is distributed in the hope that it will be useful,
141b2dd0beSMax Reitz# but WITHOUT ANY WARRANTY; without even the implied warranty of
151b2dd0beSMax Reitz# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
161b2dd0beSMax Reitz# GNU General Public License for more details.
171b2dd0beSMax Reitz#
181b2dd0beSMax Reitz# You should have received a copy of the GNU General Public License
191b2dd0beSMax Reitz# along with this program.  If not, see <http://www.gnu.org/licenses/>.
201b2dd0beSMax Reitz#
211b2dd0beSMax Reitz
221b2dd0beSMax Reitz# creator
23*42a5009dSJohn Snowowner=hreitz@redhat.com
241b2dd0beSMax Reitz
251b2dd0beSMax Reitzseq="$(basename $0)"
261b2dd0beSMax Reitzecho "QA output created by $seq"
271b2dd0beSMax Reitz
281b2dd0beSMax Reitzstatus=1	# failure is the default!
291b2dd0beSMax Reitz
301b2dd0beSMax Reitz_cleanup()
311b2dd0beSMax Reitz{
321b2dd0beSMax Reitz	_cleanup_test_img
331b2dd0beSMax Reitz}
341b2dd0beSMax Reitztrap "_cleanup; exit \$status" 0 1 2 3 15
351b2dd0beSMax Reitz
361b2dd0beSMax Reitz# get standard environment, filters and checks
371b2dd0beSMax Reitz. ./common.rc
381b2dd0beSMax Reitz. ./common.filter
391b2dd0beSMax Reitz
401b2dd0beSMax Reitz_supported_fmt qcow2
4157284d2aSMax Reitz_supported_proto file nfs fuse
421b2dd0beSMax Reitz
431b2dd0beSMax Reitz
441b2dd0beSMax ReitzIMG_SIZE=64K
451b2dd0beSMax Reitz
461b2dd0beSMax Reitzecho
471b2dd0beSMax Reitzecho '=== Updates should not write random data ==='
481b2dd0beSMax Reitzecho
491b2dd0beSMax Reitz
501b2dd0beSMax Reitz_make_test_img $IMG_SIZE
511b2dd0beSMax Reitz$QEMU_IO -c 'write 0 64k' "$TEST_IMG" | _filter_qemu_io
521b2dd0beSMax Reitz$QEMU_IO -c "open -o driver=raw $TEST_IMG" -c 'read -p -P 0 196616 65528' \
531b2dd0beSMax Reitz    | _filter_qemu_io
541b2dd0beSMax Reitz
551b2dd0beSMax Reitz# success, all done
561b2dd0beSMax Reitzecho "*** done"
571b2dd0beSMax Reitzrm -f $seq.full
581b2dd0beSMax Reitzstatus=0
591b2dd0beSMax Reitz
60