xref: /qemu/tests/qemu-iotests/239 (revision 76f1cf0a5e279a28fb833104b97ea561e4293c47)
1*76f1cf0aSyuchenlin#!/bin/bash
2*76f1cf0aSyuchenlin#
3*76f1cf0aSyuchenlin# Test case for dmg
4*76f1cf0aSyuchenlin#
5*76f1cf0aSyuchenlin# Copyright (C) 2019 yuchenlin <npes87184@gmail.com>
6*76f1cf0aSyuchenlin#
7*76f1cf0aSyuchenlin# This program is free software; you can redistribute it and/or modify
8*76f1cf0aSyuchenlin# it under the terms of the GNU General Public License as published by
9*76f1cf0aSyuchenlin# the Free Software Foundation; either version 2 of the License, or
10*76f1cf0aSyuchenlin# (at your option) any later version.
11*76f1cf0aSyuchenlin#
12*76f1cf0aSyuchenlin# This program is distributed in the hope that it will be useful,
13*76f1cf0aSyuchenlin# but WITHOUT ANY WARRANTY; without even the implied warranty of
14*76f1cf0aSyuchenlin# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*76f1cf0aSyuchenlin# GNU General Public License for more details.
16*76f1cf0aSyuchenlin#
17*76f1cf0aSyuchenlin# You should have received a copy of the GNU General Public License
18*76f1cf0aSyuchenlin# along with this program.  If not, see <http://www.gnu.org/licenses/>.
19*76f1cf0aSyuchenlin#
20*76f1cf0aSyuchenlin
21*76f1cf0aSyuchenlin# creator
22*76f1cf0aSyuchenlinowner=npes87184@gmail.com
23*76f1cf0aSyuchenlin
24*76f1cf0aSyuchenlinseq=`basename $0`
25*76f1cf0aSyuchenlinecho "QA output created by $seq"
26*76f1cf0aSyuchenlin
27*76f1cf0aSyuchenlinstatus=1	# failure is the default!
28*76f1cf0aSyuchenlin
29*76f1cf0aSyuchenlin_cleanup()
30*76f1cf0aSyuchenlin{
31*76f1cf0aSyuchenlin    rm -f "$TEST_IMG.raw"
32*76f1cf0aSyuchenlin    _cleanup_test_img
33*76f1cf0aSyuchenlin}
34*76f1cf0aSyuchenlintrap "_cleanup; exit \$status" 0 1 2 3 15
35*76f1cf0aSyuchenlin
36*76f1cf0aSyuchenlin# get standard environment, filters and checks
37*76f1cf0aSyuchenlin. ./common.rc
38*76f1cf0aSyuchenlin
39*76f1cf0aSyuchenlin_supported_fmt dmg
40*76f1cf0aSyuchenlin_supported_proto file
41*76f1cf0aSyuchenlin_supported_os Linux
42*76f1cf0aSyuchenlin
43*76f1cf0aSyuchenlinecho
44*76f1cf0aSyuchenlinecho "== Testing conversion to raw should success =="
45*76f1cf0aSyuchenlin_use_sample_img simple-dmg.dmg.bz2
46*76f1cf0aSyuchenlinif ! $QEMU_IMG convert -f $IMGFMT -O raw "$TEST_IMG" "$TEST_IMG.raw" ; then
47*76f1cf0aSyuchenlin    exit 1
48*76f1cf0aSyuchenlinfi
49*76f1cf0aSyuchenlin
50*76f1cf0aSyuchenlin# success, all done
51*76f1cf0aSyuchenlinecho "*** done"
52*76f1cf0aSyuchenlinrm -f $seq.full
53*76f1cf0aSyuchenlinstatus=0
54