• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1test_description="create/convert raw/qcow2 images"
2if test -x $E2IMAGE_EXE; then
3
4ORIG_IMAGES="image1024.orig image2048.orig image4096.orig"
5
6RAW_IMG=_image.raw
7QCOW2_IMG=_image.qcow2
8QCOW2_TO_RAW=_image.qcow2.raw
9OUT=$test_name.log
10CRC=$SRCDIR/$test_name/$test_name.crc
11CRC_TMP=$test_name.crc.tmp
12
13rm -f $test_name/_image.* $CRC_TMP $OUT >/dev/null 2>&1
14
15(
16for i in $ORIG_IMAGES; do
17	ORIG_IMG=$test_name/$i
18	echo $ORIG_IMG >> $CRC_TMP
19
20	bunzip2 < $SRCDIR/$ORIG_IMG.bz2 > $i
21	echo "$($CRCSUM $i)	$i" >> $CRC_TMP
22
23	rm -f $RAW_IMG
24	echo "e2image -r $ORIG_IMG $RAW_IMG"
25	$E2IMAGE      -r $i $RAW_IMG
26	echo "$($CRCSUM $RAW_IMG)	$RAW_IMG"  >> $CRC_TMP
27
28	echo "e2image -Q $ORIG_IMG $QCOW2_IMG"
29	$E2IMAGE      -Q $i $QCOW2_IMG
30	echo "$($CRCSUM $QCOW2_IMG)	$QCOW2_IMG"  >> $CRC_TMP
31
32	rm -f $QCOW2_TO_RAW
33	echo "e2image -r $QCOW2_IMG $QCOW2_TO_RAW"
34	$E2IMAGE      -r $i $QCOW2_TO_RAW
35	echo "$($CRCSUM $QCOW2_TO_RAW)	$QCOW2_TO_RAW" >> $CRC_TMP
36
37	rm -f $i
38done
39) >> $OUT 2>&1
40
41echo "checksum:" >> $OUT
42cat $CRC_TMP >> $OUT
43echo "" >> $OUT
44
45diff $CRC $CRC_TMP >> $OUT 2>&1
46
47if [ $? -eq 0 ]; then
48	echo "$test_name: $test_description: ok"
49	touch $test_name.ok
50else
51	ln -f $test_name.log $test_name.failed
52	echo "$test_name: $test_description: failed"
53fi
54
55rm -f _image.* $CRC_TMP >/dev/null 2>&1
56
57else #if test -x $E2IMAGE_EXE; then
58	echo "$test_name: $test_description: skipped"
59fi
60