xref: /openbmc/qemu/tests/qemu-iotests/239 (revision 0e324626)
1f3d07ce8SThomas Huth#!/usr/bin/env bash
2*9dd003a9SVladimir Sementsov-Ogievskiy# group: rw quick
376f1cf0aSyuchenlin#
476f1cf0aSyuchenlin# Test case for dmg
576f1cf0aSyuchenlin#
676f1cf0aSyuchenlin# Copyright (C) 2019 yuchenlin <npes87184@gmail.com>
776f1cf0aSyuchenlin#
876f1cf0aSyuchenlin# This program is free software; you can redistribute it and/or modify
976f1cf0aSyuchenlin# it under the terms of the GNU General Public License as published by
1076f1cf0aSyuchenlin# the Free Software Foundation; either version 2 of the License, or
1176f1cf0aSyuchenlin# (at your option) any later version.
1276f1cf0aSyuchenlin#
1376f1cf0aSyuchenlin# This program is distributed in the hope that it will be useful,
1476f1cf0aSyuchenlin# but WITHOUT ANY WARRANTY; without even the implied warranty of
1576f1cf0aSyuchenlin# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1676f1cf0aSyuchenlin# GNU General Public License for more details.
1776f1cf0aSyuchenlin#
1876f1cf0aSyuchenlin# You should have received a copy of the GNU General Public License
1976f1cf0aSyuchenlin# along with this program.  If not, see <http://www.gnu.org/licenses/>.
2076f1cf0aSyuchenlin#
2176f1cf0aSyuchenlin
2276f1cf0aSyuchenlin# creator
2376f1cf0aSyuchenlinowner=npes87184@gmail.com
2476f1cf0aSyuchenlin
2576f1cf0aSyuchenlinseq=`basename $0`
2676f1cf0aSyuchenlinecho "QA output created by $seq"
2776f1cf0aSyuchenlin
2876f1cf0aSyuchenlinstatus=1	# failure is the default!
2976f1cf0aSyuchenlin
3076f1cf0aSyuchenlin_cleanup()
3176f1cf0aSyuchenlin{
3276f1cf0aSyuchenlin    rm -f "$TEST_IMG.raw"
3376f1cf0aSyuchenlin    _cleanup_test_img
3476f1cf0aSyuchenlin}
3576f1cf0aSyuchenlintrap "_cleanup; exit \$status" 0 1 2 3 15
3676f1cf0aSyuchenlin
3776f1cf0aSyuchenlin# get standard environment, filters and checks
3876f1cf0aSyuchenlin. ./common.rc
3976f1cf0aSyuchenlin
4076f1cf0aSyuchenlin_supported_fmt dmg
4176f1cf0aSyuchenlin_supported_proto file
4276f1cf0aSyuchenlin_supported_os Linux
4376f1cf0aSyuchenlin
4476f1cf0aSyuchenlinecho
4576f1cf0aSyuchenlinecho "== Testing conversion to raw should success =="
4676f1cf0aSyuchenlin_use_sample_img simple-dmg.dmg.bz2
4776f1cf0aSyuchenlinif ! $QEMU_IMG convert -f $IMGFMT -O raw "$TEST_IMG" "$TEST_IMG.raw" ; then
4876f1cf0aSyuchenlin    exit 1
4976f1cf0aSyuchenlinfi
5076f1cf0aSyuchenlin
5176f1cf0aSyuchenlin# success, all done
5276f1cf0aSyuchenlinecho "*** done"
5376f1cf0aSyuchenlinrm -f $seq.full
5476f1cf0aSyuchenlinstatus=0
55