1*11a82d14SPhilippe Mathieu-Daudé#!/usr/bin/env bash 2b93d6d24SKevin Wolf# 3b93d6d24SKevin Wolf# Regression test for commit b7ab0fea (which was a corruption fix, 4b93d6d24SKevin Wolf# despite the commit message claiming otherwise) 5b93d6d24SKevin Wolf# 6b93d6d24SKevin Wolf# Copyright (C) 2013 Red Hat, Inc. 7b93d6d24SKevin Wolf# 8b93d6d24SKevin Wolf# This program is free software; you can redistribute it and/or modify 9b93d6d24SKevin Wolf# it under the terms of the GNU General Public License as published by 10b93d6d24SKevin Wolf# the Free Software Foundation; either version 2 of the License, or 11b93d6d24SKevin Wolf# (at your option) any later version. 12b93d6d24SKevin Wolf# 13b93d6d24SKevin Wolf# This program is distributed in the hope that it will be useful, 14b93d6d24SKevin Wolf# but WITHOUT ANY WARRANTY; without even the implied warranty of 15b93d6d24SKevin Wolf# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16b93d6d24SKevin Wolf# GNU General Public License for more details. 17b93d6d24SKevin Wolf# 18b93d6d24SKevin Wolf# You should have received a copy of the GNU General Public License 19b93d6d24SKevin Wolf# along with this program. If not, see <http://www.gnu.org/licenses/>. 20b93d6d24SKevin Wolf# 21b93d6d24SKevin Wolf 22b93d6d24SKevin Wolf# creator 23b93d6d24SKevin Wolfowner=kwolf@redhat.com 24b93d6d24SKevin Wolf 25b93d6d24SKevin Wolfseq=`basename $0` 26b93d6d24SKevin Wolfecho "QA output created by $seq" 27b93d6d24SKevin Wolf 28b93d6d24SKevin Wolfstatus=1 # failure is the default! 29b93d6d24SKevin Wolf 30b93d6d24SKevin Wolf_cleanup() 31b93d6d24SKevin Wolf{ 32b93d6d24SKevin Wolf _cleanup_test_img 33b93d6d24SKevin Wolf} 34b93d6d24SKevin Wolftrap "_cleanup; exit \$status" 0 1 2 3 15 35b93d6d24SKevin Wolf 36b93d6d24SKevin Wolf# get standard environment, filters and checks 37b93d6d24SKevin Wolf. ./common.rc 38b93d6d24SKevin Wolf. ./common.filter 39b93d6d24SKevin Wolf 40b93d6d24SKevin Wolf_supported_fmt qcow2 41b93d6d24SKevin Wolf_supported_proto generic 42b93d6d24SKevin Wolf_supported_os Linux 43b93d6d24SKevin Wolf 44b93d6d24SKevin Wolfsize=128M 45b93d6d24SKevin Wolf 46b93d6d24SKevin Wolf_make_test_img $size 47b93d6d24SKevin Wolf 488cedcffdSEric Blakeqemu_io_cmds() 49b93d6d24SKevin Wolf{ 50b93d6d24SKevin Wolfcat <<EOF 51b93d6d24SKevin Wolfwrite -P 0x66 0 320k 52b93d6d24SKevin Wolfwrite 320k 128k 53b93d6d24SKevin Wolfwrite -P 0x55 1M 128k 54b93d6d24SKevin Wolfwrite -P 0x88 448k 128k 55b93d6d24SKevin Wolfdiscard 320k 128k 56b93d6d24SKevin Wolfaio_flush 57b93d6d24SKevin Wolf 58b93d6d24SKevin Wolfwrite -P 0x77 0 480k 59b93d6d24SKevin Wolfaio_flush 60b93d6d24SKevin Wolf 61b93d6d24SKevin Wolfread -P 0x77 0 480k 62b93d6d24SKevin Wolfread -P 0x88 480k 96k 63b93d6d24SKevin Wolfread -P 0x55 1M 128k 64b93d6d24SKevin WolfEOF 65b93d6d24SKevin Wolf} 66b93d6d24SKevin Wolf 67fef9c191SJeff Codyqemu_io_cmds | $QEMU_IO "$TEST_IMG" | _filter_qemu_io 68b93d6d24SKevin Wolf_check_test_img 69b93d6d24SKevin Wolf 70b93d6d24SKevin Wolf# success, all done 71b93d6d24SKevin Wolfecho "*** done" 72b93d6d24SKevin Wolfrm -f $seq.full 73b93d6d24SKevin Wolfstatus=0 74