@@ -226,6 +226,25 @@ 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()
+ 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 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:
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 <vsementsov@virtuozzo.com> --- tests/qemu-iotests/iotests.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)