summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2018-12-15 22:00:07 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2018-12-16 00:10:18 +0100
commitbad1438992019c053a360c3ad481c50c6f5e3cbf (patch)
tree2b182d2dd0cfb94ad1588311f002c6e9bbfa2841
parentf3bdfaa34c1ca66131ee079c85a68cdac55dbff0 (diff)
downloadgenimage-bad1438992019c053a360c3ad481c50c6f5e3cbf.tar.gz
genimage-bad1438992019c053a360c3ad481c50c6f5e3cbf.tar.xz
test: use partitions with actual content
The partitions where accidentally created with /dev/null so the size was zero. Use /dev/zero to get the expected size. Update all test results to match this. Rewrite the qemu check. Different versions of qemu-img produce different image sizes so let qemu-img compare the image to a reference file. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--Makefile.am2
-rwxr-xr-xtest/basic-images.test15
-rw-r--r--test/flash.md52
-rw-r--r--test/qemu.info8
-rw-r--r--test/qemu.qcow.gzbin0 -> 540 bytes
5 files changed, 8 insertions, 19 deletions
diff --git a/Makefile.am b/Makefile.am
index 7c08470..e1668ab 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -69,7 +69,7 @@ EXTRA_DIST += \
test/mke2fs.config \
test/mke2fs.dump \
test/qemu.config \
- test/qemu.info \
+ test/qemu.qcow.gz \
test/sharness.sh \
test/squashfs.config \
test/tar.config \
diff --git a/test/basic-images.test b/test/basic-images.test
index 29a6e08..4085dfc 100755
--- a/test/basic-images.test
+++ b/test/basic-images.test
@@ -177,8 +177,8 @@ test_expect_success mke2fs,e2fsck "mke2fs" "
setup_test_images() {
rm -rf input &&
mkdir input &&
- dd if=/dev/null of=input/part1.img bs=512 count=7 &&
- dd if=/dev/null of=input/part2.img bs=512 count=11
+ dd if=/dev/zero of=input/part1.img bs=512 count=7 &&
+ dd if=/dev/zero of=input/part2.img bs=512 count=11
}
exec_test_set_prereq dd
@@ -193,14 +193,14 @@ exec_test_set_prereq sfdisk
test_expect_success "hdimage" "
setup_test_images &&
run_genimage hdimage.config test.hdimage &&
- check_size images/test.hdimage 9437184 &&
+ check_size images/test.hdimage 9442816 &&
# check the this identifier
fdisk -l images/test.hdimage | grep identifier: > hdimage.fdisk &&
# check partitions; filter output to handle different sfdisk versions
sfdisk -d images/test.hdimage 2>/dev/null | grep '^images/' | \
sed -e 's/ *//g' -e 's;Id=;type=;' >> hdimage.fdisk &&
test_cmp '${testdir}/hdimage.fdisk' hdimage.fdisk &&
- check_size images/test.hdimage-2 11534336 &&
+ check_size images/test.hdimage-2 11539968 &&
# check the this identifier
fdisk -l images/test.hdimage-2 | grep identifier: > hdimage.fdisk-2 &&
# check partitions; filter output to handle different sfdisk versions
@@ -227,12 +227,9 @@ exec_test_set_prereq qemu-img
test_expect_success dd,diff,qemu-img "qemu" "
setup_test_images &&
run_genimage qemu.config test.qcow &&
- check_size images/test.qcow 196608 &&
qemu-img check images/test.qcow &&
- qemu-img info images/test.qcow | \
- sed -e '/refcount bits:/d' -e '/corrupt:/d' > qemu.info &&
- test_cmp '${testdir}/qemu.info' qemu.info &&
- check_filelist
+ zcat '${testdir}/qemu.qcow.gz' > qemu.qcow &&
+ qemu-img compare images/test.qcow qemu.qcow
"
exec_test_set_prereq mksquashfs
diff --git a/test/flash.md5 b/test/flash.md5
index f8beb8e..2349569 100644
--- a/test/flash.md5
+++ b/test/flash.md5
@@ -1 +1 @@
-b23b5d09162b92c0284923a7f628d2a5 images/test.flash
+3ac27658859853c3c49b1c8f4524e9cc images/test.flash
diff --git a/test/qemu.info b/test/qemu.info
deleted file mode 100644
index c918c38..0000000
--- a/test/qemu.info
+++ /dev/null
@@ -1,8 +0,0 @@
-image: images/test.qcow
-file format: qcow2
-virtual size: 0 (0 bytes)
-disk size: 192K
-cluster_size: 65536
-Format specific information:
- compat: 1.1
- lazy refcounts: false
diff --git a/test/qemu.qcow.gz b/test/qemu.qcow.gz
new file mode 100644
index 0000000..3ce1af7
--- /dev/null
+++ b/test/qemu.qcow.gz
Binary files differ