From 26e2da72796c534ba3bc927a55a757d85bd10a3d Mon Sep 17 00:00:00 2001 From: Jeff Cody Date: Tue, 13 May 2014 10:00:53 -0400 Subject: [PATCH] block: add test for vhdx image created by Disk2VHD This adds a test for VHDX images created by Microsoft's tool, Disk2VHD. VHDX images created by this tool have 2 identical header sections, with identical sequence numbers. This makes sure we detect VHDX images with identical headers, and do not flag them as corrupt. Signed-off-by: Jeff Cody Reviewed-by: Fam Zheng Signed-off-by: Kevin Wolf --- tests/qemu-iotests/070 | 7 +++++++ tests/qemu-iotests/070.out | 7 +++++++ .../sample_images/test-disk2vhd.vhdx.bz2 | Bin 0 -> 1424 bytes 3 files changed, 14 insertions(+) create mode 100644 tests/qemu-iotests/sample_images/test-disk2vhd.vhdx.bz2 diff --git a/tests/qemu-iotests/070 b/tests/qemu-iotests/070 index ce71fa4a22..ea0dae7e9c 100755 --- a/tests/qemu-iotests/070 +++ b/tests/qemu-iotests/070 @@ -72,6 +72,13 @@ echo "=== Verify open image read-only succeeds after log replay ===" $QEMU_IO -r -c "read -pP 0xa5 0 18M" "$TEST_IMG" 2>&1 | _filter_testdir \ | _filter_qemu_io +_cleanup_test_img +_use_sample_img test-disk2vhd.vhdx.bz2 + +echo +echo "=== Verify image created by Disk2VHD can be opened ===" +$QEMU_IMG info "$TEST_IMG" 2>&1 | _filter_testdir | _filter_qemu + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/070.out b/tests/qemu-iotests/070.out index 922d62cb51..15f1fc1471 100644 --- a/tests/qemu-iotests/070.out +++ b/tests/qemu-iotests/070.out @@ -18,4 +18,11 @@ No errors were found on the image. === Verify open image read-only succeeds after log replay === read 18874368/18874368 bytes at offset 0 18 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=== Verify image created by Disk2VHD can be opened === +image: TEST_DIR/test-disk2vhd.vhdx +file format: vhdx +virtual size: 256M (268435456 bytes) +disk size: 260M +cluster_size: 2097152 *** done diff --git a/tests/qemu-iotests/sample_images/test-disk2vhd.vhdx.bz2 b/tests/qemu-iotests/sample_images/test-disk2vhd.vhdx.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..2891c9a6d62908e0195d3791817284016249aaee GIT binary patch literal 1424 zcmZ>Y%CIzaj8qGbG}k{O$Xb_J|NsC0KmUCH-JDzhyZ-zC_y7OrRo{&NR|gc{RqOEm z=imPqn0Gw*bmiUDGLEd7O!Jz9a-FYyG%@kz4`91;!B*gMCgZ|o{hrI3-5eMf7&2U( ze2MLfRMjk#3m2F92b;9b3)~wx*_X}#(!AiWP7J&Z7Z*rLWn7%V=F8TQk#Sieg@GYO z%H#s$1cuB7Co(4-Ibm{f0b4Ia3Io%!MYdbrr~3cDvda022}1^3FSCOb0|sEu@-&&Z zd{yQz7v?J$7%p6>a$t6L0IPy1Hi78)%CahBQlrSX^b=2 zQf8bIGb{Zh_kHjC@8`d&KfM}#^|g=#lbQEvqpGz5Ed?!#9L1S`SKYn`R8T$Vx#hW1 zCM6{$l_f4NE*^KTTb?Ukoc4OXmY1i>B+sy}&s%2&>@2zH!^iM2gHz2Te8X9{cMVoM z;{=)JSmb5gwe(qeljqKyZ`#t=IU7>$_6lS~Td$G%SNN0X?aCy3waorU$G7pHk*Ma- zYE<;TxbKbjzRG&1nl|xWH#-&9b+6?O;aW$X+xPMFR3&d_YRW#T@i-OCo2#W_wCnEbBIs?xo=)HQ$R z>o>}_dZp{atdD$}H#<@;Max;n$qQfE(*sioE9rtPc(Y*#s7 zpKUfvXG`_DIWbLeatZPZ^(zWe`GGwaHqI+yFZw>+A3{QKrRzAG9SB77d|ev|%_V)0-` z-JZ?tMvvIkH2+6tf9dm9+PF?_erw&^`i@ni63vV(0;eV%=E*Bq#jok#6Tz6rbtWUl zLX<`8`FCKbFRwON)jb?9dDZx@toqN7-~A3R)HZBdvAAbTO@<1S0Fy|{so18Xs4bHB zS53EGJoP`Mc;n-Ibe}Q4&w=3p0|SQwgF%C@o6`c-m0S(e=_6mW?bJO+Z@mKy2Ux)N dpW$4UIbn)dbcj%=_t85O{X|r_v(Ec8000NwOCSIM literal 0 HcmV?d00001