summaryrefslogtreecommitdiffstats
path: root/tests/i_qcow
diff options
context:
space:
mode:
Diffstat (limited to 'tests/i_qcow')
-rw-r--r--tests/i_qcow/i_qcow.crc15
-rw-r--r--tests/i_qcow/image1024.orig.bz2bin0 -> 322312 bytes
-rw-r--r--tests/i_qcow/image2048.orig.bz2bin0 -> 321388 bytes
-rw-r--r--tests/i_qcow/image4096.orig.bz2bin0 -> 312342 bytes
-rw-r--r--tests/i_qcow/script64
5 files changed, 79 insertions, 0 deletions
diff --git a/tests/i_qcow/i_qcow.crc b/tests/i_qcow/i_qcow.crc
new file mode 100644
index 0000000..8591ae4
--- /dev/null
+++ b/tests/i_qcow/i_qcow.crc
@@ -0,0 +1,15 @@
+i_qcow/image1024.orig
+image 2161078647
+raw_image 467277198
+qcow_image 2164212449
+qcow_to_raw 467277198
+i_qcow/image2048.orig
+image 672740642
+raw_image 3688408350
+qcow_image 3821412753
+qcow_to_raw 3688408350
+i_qcow/image4096.orig
+image 4077552412
+raw_image 4159471388
+qcow_image 636354894
+qcow_to_raw 4159471388
diff --git a/tests/i_qcow/image1024.orig.bz2 b/tests/i_qcow/image1024.orig.bz2
new file mode 100644
index 0000000..ac90f86
--- /dev/null
+++ b/tests/i_qcow/image1024.orig.bz2
Binary files differ
diff --git a/tests/i_qcow/image2048.orig.bz2 b/tests/i_qcow/image2048.orig.bz2
new file mode 100644
index 0000000..18d07a8
--- /dev/null
+++ b/tests/i_qcow/image2048.orig.bz2
Binary files differ
diff --git a/tests/i_qcow/image4096.orig.bz2 b/tests/i_qcow/image4096.orig.bz2
new file mode 100644
index 0000000..e17b5a3
--- /dev/null
+++ b/tests/i_qcow/image4096.orig.bz2
Binary files differ
diff --git a/tests/i_qcow/script b/tests/i_qcow/script
new file mode 100644
index 0000000..6bf995e
--- /dev/null
+++ b/tests/i_qcow/script
@@ -0,0 +1,64 @@
+test_description="create/convert raw/qcow2 images"
+if test -x $E2IMAGE_EXE; then
+
+ORIG_IMAGES="image1024.orig image2048.orig image4096.orig"
+
+RAW_IMG=_image.raw
+QCOW2_IMG=_image.qcow2
+QCOW2_TO_RAW=_image.qcow2.raw
+OUT=$test_name.log
+CRC=$SRCDIR/$test_name/$test_name.crc
+CRC_TMP=$test_name.crc.tmp
+
+rm -f $CRC_TMP $OUT >/dev/null 2>&1
+
+(
+for i in $ORIG_IMAGES; do
+ ORIG_IMG=$test_name/$i
+ echo $ORIG_IMG >> $CRC_TMP
+
+ IMAGE=$(mktemp ${TMPDIR:-/tmp}/$i.XXXXXX)
+ RAW_IMG="${IMAGE}.raw"
+ QCOW2_IMG="${IMAGE}.qcow2"
+ QCOW2_TO_RAW="${IMAGE}.qcow2.raw"
+
+ bunzip2 < $SRCDIR/$ORIG_IMG.bz2 > $IMAGE
+ echo "image $($CRCSUM $IMAGE)" >> $CRC_TMP
+
+ rm -f $RAW_IMG
+ echo "e2image -r $ORIG_IMG $RAW_IMG"
+ $E2IMAGE -r $IMAGE $RAW_IMG
+ echo "raw_image $($CRCSUM $RAW_IMG)" >> $CRC_TMP
+
+ echo "e2image -Q $ORIG_IMG $QCOW2_IMG"
+ $E2IMAGE -Q $IMAGE $QCOW2_IMG
+ echo "qcow_image $($CRCSUM $QCOW2_IMG)" >> $CRC_TMP
+
+ rm -f $QCOW2_TO_RAW
+ echo "e2image -r $QCOW2_IMG $QCOW2_TO_RAW"
+ $E2IMAGE -r $QCOW2_IMG $QCOW2_TO_RAW
+ echo "qcow_to_raw $($CRCSUM $QCOW2_TO_RAW)" >> $CRC_TMP
+
+ rm -f $IMAGE $RAW_IMG $QCOW2_IMG $QCOW2_TO_RAW
+done
+) >> $OUT 2>&1
+
+echo "checksum:" >> $OUT
+cat $CRC_TMP >> $OUT
+echo "" >> $OUT
+
+diff $CRC $CRC_TMP >> $OUT 2>&1
+
+if [ $? -eq 0 ]; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ ln -f $test_name.log $test_name.failed
+ echo "$test_name: $test_description: failed"
+fi
+
+rm -f $CRC_TMP >/dev/null 2>&1
+
+else #if test -x $E2IMAGE_EXE; then
+ echo "$test_name: $test_description: skipped"
+fi