diff mbox

[13/18] iotests: maintain several vms in test

Message ID 1471343175-14945-14-git-send-email-vsementsov@virtuozzo.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vladimir Sementsov-Ogievskiy Aug. 16, 2016, 10:26 a.m. UTC
The only problem with it is the same qmp socket name (which is
vm._monitor_path) for all vms. And because of this second vm couldn't be
lauched (vm.launch() fails because of socket is already in use).
This patch adds a number of vm into vm._monitor_path

Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 tests/qemu-iotests/iotests.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index dbe0ee5..fade81e 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -130,11 +130,14 @@  def log(msg, filters=[]):
 
 class VM(qtest.QEMUQtestMachine):
     '''A QEMU VM'''
+    nb_vms = 0
 
     def __init__(self):
-        super(VM, self).__init__(qemu_prog, qemu_opts, test_dir=test_dir,
+        super(VM, self).__init__(qemu_prog, qemu_opts,
+                                 name = 'vm-%d' % VM.nb_vms, test_dir=test_dir,
                                  socket_scm_helper=socket_scm_helper)
         self._num_drives = 0
+        VM.nb_vms += 1
 
     def add_drive_raw(self, opts):
         self._args.append('-drive')