1*89e91181SJeff Cody#!/bin/bash 2*89e91181SJeff Cody# 3*89e91181SJeff Cody# Test VHDX read/write from a sample image created with Hyper-V 4*89e91181SJeff Cody# 5*89e91181SJeff Cody# Copyright (C) 2013 Red Hat, Inc. 6*89e91181SJeff Cody# 7*89e91181SJeff Cody# This program is free software; you can redistribute it and/or modify 8*89e91181SJeff Cody# it under the terms of the GNU General Public License as published by 9*89e91181SJeff Cody# the Free Software Foundation; either version 2 of the License, or 10*89e91181SJeff Cody# (at your option) any later version. 11*89e91181SJeff Cody# 12*89e91181SJeff Cody# This program is distributed in the hope that it will be useful, 13*89e91181SJeff Cody# but WITHOUT ANY WARRANTY; without even the implied warranty of 14*89e91181SJeff Cody# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*89e91181SJeff Cody# GNU General Public License for more details. 16*89e91181SJeff Cody# 17*89e91181SJeff Cody# You should have received a copy of the GNU General Public License 18*89e91181SJeff Cody# along with this program. If not, see <http://www.gnu.org/licenses/>. 19*89e91181SJeff Cody# 20*89e91181SJeff Cody 21*89e91181SJeff Cody# creator 22*89e91181SJeff Codyowner=jcody@redhat.com 23*89e91181SJeff Cody 24*89e91181SJeff Codyseq=`basename $0` 25*89e91181SJeff Codyecho "QA output created by $seq" 26*89e91181SJeff Cody 27*89e91181SJeff Codyhere=`pwd` 28*89e91181SJeff Codytmp=/tmp/$$ 29*89e91181SJeff Codystatus=1 # failure is the default! 30*89e91181SJeff Cody 31*89e91181SJeff Cody_cleanup() 32*89e91181SJeff Cody{ 33*89e91181SJeff Cody _cleanup_test_img 34*89e91181SJeff Cody} 35*89e91181SJeff Codytrap "_cleanup; exit \$status" 0 1 2 3 15 36*89e91181SJeff Cody 37*89e91181SJeff Cody# get standard environment, filters and checks 38*89e91181SJeff Cody. ./common.rc 39*89e91181SJeff Cody. ./common.filter 40*89e91181SJeff Cody 41*89e91181SJeff Cody_supported_fmt vhdx 42*89e91181SJeff Cody_supported_proto generic 43*89e91181SJeff Cody_supported_os Linux 44*89e91181SJeff Cody 45*89e91181SJeff Cody_use_sample_img iotest-dynamic-1G.vhdx.bz2 46*89e91181SJeff Cody 47*89e91181SJeff Codyecho 48*89e91181SJeff Codyecho "=== Verify pattern 0xa5, 0 - 33MB ===" 49*89e91181SJeff Cody$QEMU_IO -r -c "read -pP 0xa5 0 33M" "$TEST_IMG" | _filter_qemu_io 50*89e91181SJeff Cody 51*89e91181SJeff Codyecho 52*89e91181SJeff Codyecho "=== Verify pattern 0x96, 33M - 66M ===" 53*89e91181SJeff Cody$QEMU_IO -r -c "read -pP 0x96 33M 33M" "$TEST_IMG" | _filter_qemu_io 54*89e91181SJeff Cody 55*89e91181SJeff Codyecho 56*89e91181SJeff Codyecho "=== Verify pattern 0x00, 66M - 1024M ===" 57*89e91181SJeff Cody$QEMU_IO -r -c "read -pP 0x00 66M 958M" "$TEST_IMG" | _filter_qemu_io 58*89e91181SJeff Cody 59*89e91181SJeff Cody# success, all done 60*89e91181SJeff Codyecho "*** done" 61*89e91181SJeff Codyrm -f $seq.full 62*89e91181SJeff Codystatus=0 63