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 <vsement...@virtuozzo.com> --- tests/qemu-iotests/iotests.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 85c5a99..7fb330a 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -200,6 +200,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: -- 2.1.4