Skip to contentSkip to conversation

iotests: Skip test for ENOMEM error

PATCH In review Fam Zheng 3 participants 3 messages Mar 1, 2018 – Mar 5, 2018

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 iotests: Skip test for ENOMEM error

The AFL image is to exercise the code validating image size, which doesn't work on 32 bit or when out of memory (there is a large allocation before the interesting point). So check that and skip the test, instead of faking the result.

---
 tests/qemu-iotests/059 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tests/qemu-iotests/059 +2 -3
index 40f89eae18..530bbbe6ce 100755
@@ -152,9 +152,8 @@ done
 echo
 echo "=== Testing afl image with a very large capacity ==="
 _use_sample_img afl9.vmdk.bz2
-# The sed makes this test pass on machines with little RAM
-# (and also with 32 bit builds)
-_img_info | sed -e 's/Cannot allocate memory/Invalid argument/'
+_img_info | grep -q 'Cannot allocate memory' && _notrun "Insufficent memory, skipped test"
+_img_info
 _cleanup_test_img
 
 # success, all done
Signature · 1 line
2.14.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Fam Zheng

The AFL image is to exercise the code validating image size, which doesn't work on 32 bit or when out of memory (there is a large allocation before the interesting point). So check that and skip the test, instead of faking the result.

---
  tests/qemu-iotests/059 | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
Quoted 18 lines
tests/qemu-iotests/059 +2 -3
index 40f89eae18..530bbbe6ce 100755
@@ -152,9 +152,8 @@ done
  echo
  echo "=== Testing afl image with a very large capacity ==="
  _use_sample_img afl9.vmdk.bz2
-# The sed makes this test pass on machines with little RAM
-# (and also with 32 bit builds)
-_img_info | sed -e 's/Cannot allocate memory/Invalid argument/'
+_img_info | grep -q 'Cannot allocate memory' && _notrun "Insufficent memory, skipped test"
+_img_info
  _cleanup_test_img
 
  # success, all done
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#2 lore raw
In reply to Fam Zheng
Quoted 9 lines · Fam Zheng

The AFL image is to exercise the code validating image size, which doesn't work on 32 bit or when out of memory (there is a large allocation before the interesting point). So check that and skip the test, instead of faking the result.

---
 tests/qemu-iotests/059 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Thanks! Applied to my block branch:

https://github.com/XanClic/qemu/commits/block

Max