Skip to contentSkip to conversation

tests/acceptance: bound the size of readline in s390_ccw_virtio

PATCH In review Alex Bennée 5 participants 5 messages Jan 5, 2021 – Jan 6, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/acceptance: bound the size of readline in s390_ccw_virtio

The read binary data as text via a PPM export of the frame buffer seems a bit sketchy and it did blow up in the real world when the assertion failed:

https://gitlab.com/qemu-project/qemu/-/jobs/943183183

However short of cleaning up the test to be more binary focused at least limit the attempt to dump the whole file as hexified zeros in the logs.

---
 tests/acceptance/machine_s390_ccw_virtio.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/acceptance/machine_s390_ccw_virtio.py +1 -1
index 0f81af9950..5141d6abb2 100644
@@ -241,7 +241,7 @@ class S390CCWVirtioMachine(Test):
             self.assertEqual(line, b"1024 768\n")
             line = ppmfile.readline()
             self.assertEqual(line, b"255\n")
-            line = ppmfile.readline()
+            line = ppmfile.readline(size=256)
             self.assertEqual(line, b"The quick fox jumps over a lazy dog\n")
 
         # Hot-plug a virtio-crypto device and see whether it gets accepted
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Alex Bennée

The read binary data as text via a PPM export of the frame buffer seems a bit sketchy and it did blow up in the real world when the assertion failed:

https://gitlab.com/qemu-project/qemu/-/jobs/943183183

Quoted 8 lines

However short of cleaning up the test to be more binary focused at least limit the attempt to dump the whole file as hexified zeros in the logs.

---
 tests/acceptance/machine_s390_ccw_virtio.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by on v1 1/1
#2 lore raw
In reply to Alex Bennée
Quoted 7 lines · Alex Bennée

The read binary data as text via a PPM export of the frame buffer seems a bit sketchy and it did blow up in the real world when the assertion failed:

https://gitlab.com/qemu-project/qemu/-/jobs/943183183

Quoted 9 lines

However short of cleaning up the test to be more binary focused at least limit the attempt to dump the whole file as hexified zeros in the logs.

---
 tests/acceptance/machine_s390_ccw_virtio.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by on v1 1/1
#3 lore raw
In reply to Alex Bennée
Quoted 11 lines · On Tue, 5 Jan 2021 12:44:05 +0000 Alex Bennée <[email protected]> wrote:

The read binary data as text via a PPM export of the frame buffer seems a bit sketchy and it did blow up in the real world when the assertion failed:

https://gitlab.com/qemu-project/qemu/-/jobs/943183183

However short of cleaning up the test to be more binary focused at least limit the attempt to dump the whole file as hexified zeros in the logs.

Thanks!

Quoted 17 lines
---
 tests/acceptance/machine_s390_ccw_virtio.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/acceptance/machine_s390_ccw_virtio.py +1 -1
index 0f81af9950..5141d6abb2 100644
@@ -241,7 +241,7 @@ class S390CCWVirtioMachine(Test):
             self.assertEqual(line, b"1024 768\n")
             line = ppmfile.readline()
             self.assertEqual(line, b"255\n")
-            line = ppmfile.readline()
+            line = ppmfile.readline(size=256)
             self.assertEqual(line, b"The quick fox jumps over a lazy dog\n")
 
         # Hot-plug a virtio-crypto device and see whether it gets accepted
Acked-by on v1 1/1
#4 lore raw
In reply to Alex Bennée
Quoted 21 lines · Alex Bennée

The read binary data as text via a PPM export of the frame buffer seems a bit sketchy and it did blow up in the real world when the assertion failed:

   https://gitlab.com/qemu-project/qemu/-/jobs/943183183

However short of cleaning up the test to be more binary focused at least limit the attempt to dump the whole file as hexified zeros in the logs.

---
  tests/acceptance/machine_s390_ccw_virtio.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/acceptance/machine_s390_ccw_virtio.py +0 -0
index 0f81af9950..5141d6abb2 100644

tests/acceptance/machine_s390_ccw_virtio.py class S390CCWVirtioMachine(Test): · line 247

Quoted 8 lines
tests/acceptance/machine_s390_ccw_virtio.py +1 -1
@@ -241,7 +241,7 @@ class S390CCWVirtioMachine(Test):
              self.assertEqual(line, b"1024 768\n")
              line = ppmfile.readline()
              self.assertEqual(line, b"255\n")
-            line = ppmfile.readline()
+            line = ppmfile.readline(size=256)
              self.assertEqual(line, b"The quick fox jumps over a lazy dog\n")
 
          # Hot-plug a virtio-crypto device and see whether it gets accepted