Skip to contentSkip to conversation

iotests: Fix CID for VMDK afl image

PATCH Applied Fam Zheng 4 participants 8 messages Jan 30, 2018 – Feb 1, 2018

v1 of 3 Applied Latest is v3 →

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 iotests: Fix CID for VMDK afl image

This reverts commit 76bf133c4 which updated the reference output, and fixed the reference image, because the code path we want to exercise is actually the invalid image size.

The descriptor block in the image, which includes the CID to verify, has been invalid since the reference image was added. Since commit 9877860e7bd we report this error earlier than the "file too large", so 059.out mismatches.

The binary change is generated along the operations of:

  $ bunzip2 afl9.vmdk.bz2
  $ qemu-img create -f vmdk fix.vmdk 1G
  $ dd if=afl9.vmdk.bz2 of=fix.vmdk bs=512 count=1 conv=notrunc
  $ mv fix.vmdk afl9.vmdk
  $ bzip2 afl9.vmdk

---

v2: Fix commit message "qcow2 -> vmdk". [Kevin]

    Revert 76bf133c4.
---
 tests/qemu-iotests/059.out                     |   2 +-
 tests/qemu-iotests/sample_images/afl9.vmdk.bz2 | Bin 178 -> 618 bytes
 2 files changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/059.out +1 -1
index 1ac5d56233..f6dce7947c 100644
@@ -2358,5 +2358,5 @@ Offset          Length          Mapped to       File
 0x140000000     0x10000         0x50000         TEST_DIR/t-s003.vmdk
 
 === Testing afl image with a very large capacity ===
-qemu-img: Could not open 'TEST_DIR/afl9.IMGFMT': Could not open 'TEST_DIR/afl9.IMGFMT': Invalid argument
+qemu-img: Can't get image size 'TEST_DIR/afl9.IMGFMT': File too large
 *** done
tests/qemu-iotests/sample_images/afl9.vmdk.bz2 binary +0 -0
index 03615d36a12425cf4240bab86f4cfe648db14572..9fcd0af45a815431acf4689e0845ecf2d333cd58 100644
GIT binary patch
Signature · 1 line
2.14.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Fam Zheng

This reverts commit 76bf133c4 which updated the reference output, and fixed the reference image, because the code path we want to exercise is actually the invalid image size.

The descriptor block in the image, which includes the CID to verify, has been invalid since the reference image was added. Since commit 9877860e7bd we report this error earlier than the "file too large", so 059.out mismatches.

Quoted 5 lines

The binary change is generated along the operations of:

  $ bunzip2 afl9.vmdk.bz2
  $ qemu-img create -f vmdk fix.vmdk 1G
  $ dd if=afl9.vmdk.bz2 of=fix.vmdk bs=512 count=1 conv=notrunc

Is the .bz2 suffix spurious here?

Quoted 7 lines
  $ mv fix.vmdk afl9.vmdk
  $ bzip2 afl9.vmdk

---

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
author
#2 lore raw
Quoted 9 lines · Eric Blake
Quoted 8 lines · Fam Zheng

This reverts commit 76bf133c4 which updated the reference output, and fixed the reference image, because the code path we want to exercise is actually the invalid image size.

The descriptor block in the image, which includes the CID to verify, has been invalid since the reference image was added. Since commit 9877860e7bd we report this error earlier than the "file too large", so 059.out mismatches.

Quoted 7 lines
Quoted 5 lines

The binary change is generated along the operations of:

  $ bunzip2 afl9.vmdk.bz2
  $ qemu-img create -f vmdk fix.vmdk 1G
  $ dd if=afl9.vmdk.bz2 of=fix.vmdk bs=512 count=1 conv=notrunc

Is the .bz2 suffix spurious here?

Hmm, yes. I have no idea why it is here. :-/

Fam

Quoted 16 lines
Quoted 8 lines
  $ mv fix.vmdk afl9.vmdk
  $ bzip2 afl9.vmdk

---

--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org

Applied
#3 lore raw
In reply to Fam Zheng

Am 30.01.2018 um 07:25 hat Fam Zheng geschrieben:

Quoted 10 lines

This reverts commit 76bf133c4 which updated the reference output, and fixed the reference image, because the code path we want to exercise is actually the invalid image size.

The descriptor block in the image, which includes the CID to verify, has been invalid since the reference image was added. Since commit 9877860e7bd we report this error earlier than the "file too large", so 059.out mismatches.

The binary change is generated along the operations of:

Quoted 7 lines
  $ bunzip2 afl9.vmdk.bz2
  $ qemu-img create -f vmdk fix.vmdk 1G
  $ dd if=afl9.vmdk.bz2 of=fix.vmdk bs=512 count=1 conv=notrunc
  $ mv fix.vmdk afl9.vmdk
  $ bzip2 afl9.vmdk

Thanks, applied to the block branch.

Kevin

#4 lore raw
In reply to Fam Zheng
Quoted 16 lines · Fam Zheng

This reverts commit 76bf133c4 which updated the reference output, and fixed the reference image, because the code path we want to exercise is actually the invalid image size.

The descriptor block in the image, which includes the CID to verify, has been invalid since the reference image was added. Since commit 9877860e7bd we report this error earlier than the "file too large", so 059.out mismatches.

The binary change is generated along the operations of:

  $ bunzip2 afl9.vmdk.bz2
  $ qemu-img create -f vmdk fix.vmdk 1G
  $ dd if=afl9.vmdk.bz2 of=fix.vmdk bs=512 count=1 conv=notrunc
  $ mv fix.vmdk afl9.vmdk
  $ bzip2 afl9.vmdk
Quoted 6 lines

---

v2: Fix commit message "qcow2 -> vmdk". [Kevin]

    Revert 76bf133c4.

Hmmmm, now this fails again on my 32 bit build. :-(

The issue there is that you get a "Cannot allocate memory" when trying to open the file. My current fix was 2291712c39111a732 which simply converted that to "Invalid argument", but now it's getting a bit more complicated... Should I just continue to play the game and check the output for "Cannot allocate memory" and print exactly what the reference output is expecting...?

Max

author
#5 lore raw
Quoted 24 lines · Max Reitz
Quoted 16 lines · Fam Zheng

This reverts commit 76bf133c4 which updated the reference output, and fixed the reference image, because the code path we want to exercise is actually the invalid image size.

The descriptor block in the image, which includes the CID to verify, has been invalid since the reference image was added. Since commit 9877860e7bd we report this error earlier than the "file too large", so 059.out mismatches.

The binary change is generated along the operations of:

  $ bunzip2 afl9.vmdk.bz2
  $ qemu-img create -f vmdk fix.vmdk 1G
  $ dd if=afl9.vmdk.bz2 of=fix.vmdk bs=512 count=1 conv=notrunc
  $ mv fix.vmdk afl9.vmdk
  $ bzip2 afl9.vmdk
Quoted 6 lines

---

v2: Fix commit message "qcow2 -> vmdk". [Kevin]

    Revert 76bf133c4.
Quoted 8 lines

Hmmmm, now this fails again on my 32 bit build. :-(

The issue there is that you get a "Cannot allocate memory" when trying to open the file. My current fix was 2291712c39111a732 which simply converted that to "Invalid argument", but now it's getting a bit more complicated... Should I just continue to play the game and check the output for "Cannot allocate memory" and print exactly what the reference output is expecting...?

Ahhh. OK, then, with a big comment.

I'd say let's just _notrun on 32 bit.

Fam

#6 lore raw
Quoted 34 lines · Fam Zheng
Quoted 24 lines · Max Reitz
Quoted 16 lines · Fam Zheng

This reverts commit 76bf133c4 which updated the reference output, and fixed the reference image, because the code path we want to exercise is actually the invalid image size.

The descriptor block in the image, which includes the CID to verify, has been invalid since the reference image was added. Since commit 9877860e7bd we report this error earlier than the "file too large", so 059.out mismatches.

The binary change is generated along the operations of:

  $ bunzip2 afl9.vmdk.bz2
  $ qemu-img create -f vmdk fix.vmdk 1G
  $ dd if=afl9.vmdk.bz2 of=fix.vmdk bs=512 count=1 conv=notrunc
  $ mv fix.vmdk afl9.vmdk
  $ bzip2 afl9.vmdk
Quoted 6 lines

---

v2: Fix commit message "qcow2 -> vmdk". [Kevin]

    Revert 76bf133c4.
Quoted 8 lines

Hmmmm, now this fails again on my 32 bit build. :-(

The issue there is that you get a "Cannot allocate memory" when trying to open the file. My current fix was 2291712c39111a732 which simply converted that to "Invalid argument", but now it's getting a bit more complicated... Should I just continue to play the game and check the output for "Cannot allocate memory" and print exactly what the reference output is expecting...?

Quoted 3 lines

Ahhh. OK, then, with a big comment.

I'd say let's just _notrun on 32 bit.

Sounds OK, but how would we test that? uname? Or just _notrun when we see the ENOMEM message?

Max

#7 lore raw
Quoted 9 lines · Max Reitz
Quoted 9 lines
Quoted 8 lines

Hmmmm, now this fails again on my 32 bit build. :-(

The issue there is that you get a "Cannot allocate memory" when trying to open the file. My current fix was 2291712c39111a732 which simply converted that to "Invalid argument", but now it's getting a bit more complicated... Should I just continue to play the game and check the output for "Cannot allocate memory" and print exactly what the reference output is expecting...?

Quoted 6 lines
Quoted 3 lines

Ahhh. OK, then, with a big comment.

I'd say let's just _notrun on 32 bit.

Sounds OK, but how would we test that? uname? Or just _notrun when we see the ENOMEM message?

_notrun when you detect ENOMEM seems reasonable (the equivalent of exit status 77 in skipping a test in an automake context)

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org