xref: /openbmc/qemu/tests/qemu-iotests/107 (revision 11a82d14)
1*11a82d14SPhilippe Mathieu-Daudé#!/usr/bin/env bash
21b2dd0beSMax Reitz#
31b2dd0beSMax Reitz# Tests updates of the qcow2 L1 table
41b2dd0beSMax Reitz#
51b2dd0beSMax Reitz# Copyright (C) 2014 Red Hat, Inc.
61b2dd0beSMax Reitz#
71b2dd0beSMax Reitz# This program is free software; you can redistribute it and/or modify
81b2dd0beSMax Reitz# it under the terms of the GNU General Public License as published by
91b2dd0beSMax Reitz# the Free Software Foundation; either version 2 of the License, or
101b2dd0beSMax Reitz# (at your option) any later version.
111b2dd0beSMax Reitz#
121b2dd0beSMax Reitz# This program is distributed in the hope that it will be useful,
131b2dd0beSMax Reitz# but WITHOUT ANY WARRANTY; without even the implied warranty of
141b2dd0beSMax Reitz# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151b2dd0beSMax Reitz# GNU General Public License for more details.
161b2dd0beSMax Reitz#
171b2dd0beSMax Reitz# You should have received a copy of the GNU General Public License
181b2dd0beSMax Reitz# along with this program.  If not, see <http://www.gnu.org/licenses/>.
191b2dd0beSMax Reitz#
201b2dd0beSMax Reitz
211b2dd0beSMax Reitz# creator
221b2dd0beSMax Reitzowner=mreitz@redhat.com
231b2dd0beSMax Reitz
241b2dd0beSMax Reitzseq="$(basename $0)"
251b2dd0beSMax Reitzecho "QA output created by $seq"
261b2dd0beSMax Reitz
271b2dd0beSMax Reitzstatus=1	# failure is the default!
281b2dd0beSMax Reitz
291b2dd0beSMax Reitz_cleanup()
301b2dd0beSMax Reitz{
311b2dd0beSMax Reitz	_cleanup_test_img
321b2dd0beSMax Reitz}
331b2dd0beSMax Reitztrap "_cleanup; exit \$status" 0 1 2 3 15
341b2dd0beSMax Reitz
351b2dd0beSMax Reitz# get standard environment, filters and checks
361b2dd0beSMax Reitz. ./common.rc
371b2dd0beSMax Reitz. ./common.filter
381b2dd0beSMax Reitz
391b2dd0beSMax Reitz_supported_fmt qcow2
409ea92c21SPeter Lieven_supported_proto file nfs
411b2dd0beSMax Reitz_supported_os Linux
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