[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 19/22] iotests: add VM.test_launcn()
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-devel] [PATCH 19/22] iotests: add VM.test_launcn() |
Date: |
Tue, 15 Mar 2016 23:04:25 +0300 |
Test vm can launch and print output in case of fail. This function is
needed for testing erroneous cases
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
tests/qemu-iotests/iotests.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 6807b07..187b434 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -226,6 +226,26 @@ class VM(object):
os.remove(self._monitor_path)
raise
+ def test_launch(self):
+ '''Launch the VM, an error is expected'''
+ try:
+ self.launch()
+ except:
+ self._popen.wait()
+ regex = re.compile(r"qemu-system-\w+")
+ print "Test launch failed: %d" % self._popen.returncode
+ print "--- qemu output ---"
+ for line in open(self._qemu_log_path):
+ #filter qtest comments
+ if not "] OPENED" in line:
+ print regex.sub("qemu-system-*", line)
+ print "--- end qemu output ---"
+ return False
+
+ print "Tast launch successed!"
+ self.shutdown()
+ return True
+
def shutdown(self):
'''Terminate the VM and clean up'''
if not self._popen is None:
--
1.8.3.1
- [Qemu-devel] [PATCH 11/22] qcow2: add dirty bitmaps extension, (continued)
- [Qemu-devel] [PATCH 11/22] qcow2: add dirty bitmaps extension, Vladimir Sementsov-Ogievskiy, 2016/03/15
- [Qemu-devel] [PATCH 10/22] qcow2-dirty-bitmap: add qcow2_bitmap_store(), Vladimir Sementsov-Ogievskiy, 2016/03/15
- [Qemu-devel] [PATCH 12/22] qcow2-dirty-bitmap: add qcow2_bitmap_load_check(), Vladimir Sementsov-Ogievskiy, 2016/03/15
- [Qemu-devel] [PATCH 13/22] block: store persistent dirty bitmaps, Vladimir Sementsov-Ogievskiy, 2016/03/15
- [Qemu-devel] [PATCH 15/22] qcow2-dirty-bitmap: add autoclear bit, Vladimir Sementsov-Ogievskiy, 2016/03/15
- [Qemu-devel] [PATCH 14/22] block: add bdrv_load_dirty_bitmap(), Vladimir Sementsov-Ogievskiy, 2016/03/15
- [Qemu-devel] [PATCH 16/22] qemu: command line option for dirty bitmaps, Vladimir Sementsov-Ogievskiy, 2016/03/15
- [Qemu-devel] [PATCH 19/22] iotests: add VM.test_launcn(),
Vladimir Sementsov-Ogievskiy <=
- [Qemu-devel] [PATCH 17/22] qcow2-dirty-bitmap: add IN_USE flag, Vladimir Sementsov-Ogievskiy, 2016/03/15
- [Qemu-devel] [PATCH 18/22] qcow2-dirty-bitmaps: disallow stroing bitmap to other bs, Vladimir Sementsov-Ogievskiy, 2016/03/15
- [Qemu-devel] [PATCH 21/22] qcow2-dirty-bitmap: add AUTO flag, Vladimir Sementsov-Ogievskiy, 2016/03/15
- [Qemu-devel] [PATCH 22/22] qcow2-dirty-bitmap: add EXTRA_DATA_COMPATIBLE flag, Vladimir Sementsov-Ogievskiy, 2016/03/15
- [Qemu-devel] [PATCH 20/22] iotests: test internal persistent dirty bitmap, Vladimir Sementsov-Ogievskiy, 2016/03/15