Skip to contentSkip to conversation

tests/.../reverse_debugging: Remove unsatisfiable condition

PATCH In review Yodel Eldar 2 participants 2 messages Feb 3

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/.../reverse_debugging: Remove unsatisfiable condition

get_qemu_img() already skips the test if qemu-img is not found and does not return None. Eliminate the check for None on its result, and the unreachable skipTest() gated by it.

---
 tests/functional/reverse_debugging.py | 3 ---
 1 file changed, 3 deletions(-)
tests/functional/reverse_debugging.py +0 -3
index 8e6f0b0e92..eaf178da49 100644
@@ -73,9 +73,6 @@ def reverse_debugging(self, gdb_arch, shift=7, args=None, big_endian=False):
         self.log.info('creating qcow2 image for VM snapshots')
         image_path = os.path.join(self.workdir, 'disk.qcow2')
         qemu_img = get_qemu_img(self)
-        if qemu_img is None:
-            self.skipTest('Could not find "qemu-img", which is required to '
-                          'create the temporary qcow2 image')
         out = check_output([qemu_img, 'create', '-f', 'qcow2', image_path, '128M'],
                            encoding='utf8')
         self.log.info("qemu-img: %s" % out)
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Yodel Eldar

get_qemu_img() already skips the test if qemu-img is not found and does not return None. Eliminate the check for None on its result, and the unreachable skipTest() gated by it.

---
  tests/functional/reverse_debugging.py | 3 ---
  1 file changed, 3 deletions(-)
tests/functional/reverse_debugging.py +0 -0
index 8e6f0b0e92..eaf178da49 100644

tests/functional/reverse_debugging.py def reverse_debugging(self, gdb_arch, shift=7, args=None, big_endian=False): · line 78

Quoted 9 lines
tests/functional/reverse_debugging.py +0 -3
@@ -73,9 +73,6 @@ def reverse_debugging(self, gdb_arch, shift=7, args=None, big_endian=False):
          self.log.info('creating qcow2 image for VM snapshots')
          image_path = os.path.join(self.workdir, 'disk.qcow2')
          qemu_img = get_qemu_img(self)
-        if qemu_img is None:
-            self.skipTest('Could not find "qemu-img", which is required to '
-                          'create the temporary qcow2 image')
          out = check_output([qemu_img, 'create', '-f', 'qcow2', image_path, '128M'],
                             encoding='utf8')
          self.log.info("qemu-img: %s" % out)