* [PATCH v2 0/4] Acceptance test: Extension of migration tests
@ 2020-02-25 13:12 Oksana Vohchana
2020-02-25 13:12 ` [PATCH v2 1/4] Acceptance test: adds param 'address' in _get_free_port Oksana Vohchana
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Oksana Vohchana @ 2020-02-25 13:12 UTC (permalink / raw)
To: qemu-devel; +Cc: ovoshcha, philmd, wainersm, crosa
This series adds a new migration test through RDMA.
To correct uses of migration need to add a new function to work
with RDMA service.
And as a part of migration tests, the series makes small updates to EXEC
migration and to _get_free_port function
V2:
- improves commit message in Acceptance test: adds param 'address'
in _get_free_port
- provides import check for netifaces library
- makes fix to _get_ip_rdma function
- adds skip to test if not upload python module
Oksana Vohchana (4):
Acceptance test: adds param 'address' in _get_free_port
Acceptance test: EXEC migration
Acceptance test: provides new functions
Acceptance test: provides to use RDMA transport for migration test
tests/acceptance/migration.py | 41 +++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
--
2.21.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/4] Acceptance test: adds param 'address' in _get_free_port
2020-02-25 13:12 [PATCH v2 0/4] Acceptance test: Extension of migration tests Oksana Vohchana
@ 2020-02-25 13:12 ` Oksana Vohchana
2020-02-25 13:13 ` [PATCH v2 2/4] Acceptance test: EXEC migration Oksana Vohchana
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Oksana Vohchana @ 2020-02-25 13:12 UTC (permalink / raw)
To: qemu-devel; +Cc: ovoshcha, philmd, wainersm, crosa
In the migration test function _get_free_port works only for localhost,
but in the case to use migration through an RDMA we need to get a free port
on the configured network RDMA-interface.
This patch is the start for another migration option
Signed-off-by: Oksana Vohchana <ovoshcha@redhat.com>
---
tests/acceptance/migration.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index a8367ca023..e4c39b85a1 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -52,8 +52,8 @@ class Migration(Test):
source_vm.qmp('migrate', uri=src_uri)
self.assert_migration(source_vm, dest_vm)
- def _get_free_port(self):
- port = network.find_free_port()
+ def _get_free_port(self, address='localhost'):
+ port = network.find_free_port(address=address)
if port is None:
self.cancel('Failed to find a free port')
return port
--
2.21.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/4] Acceptance test: EXEC migration
2020-02-25 13:12 [PATCH v2 0/4] Acceptance test: Extension of migration tests Oksana Vohchana
2020-02-25 13:12 ` [PATCH v2 1/4] Acceptance test: adds param 'address' in _get_free_port Oksana Vohchana
@ 2020-02-25 13:13 ` Oksana Vohchana
2020-02-25 13:13 ` [PATCH v2 3/4] Acceptance test: provides new functions Oksana Vohchana
2020-02-25 13:13 ` [PATCH v2 4/4] Acceptance test: provides to use RDMA transport for migration test Oksana Vohchana
3 siblings, 0 replies; 5+ messages in thread
From: Oksana Vohchana @ 2020-02-25 13:13 UTC (permalink / raw)
To: qemu-devel; +Cc: ovoshcha, philmd, wainersm, crosa
Improves EXEC migration to run whole test stage
Signed-off-by: Oksana Vohchana <ovoshcha@redhat.com>
---
tests/acceptance/migration.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index e4c39b85a1..8209dcf71d 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -75,3 +75,5 @@ class Migration(Test):
"""
free_port = self._get_free_port()
dest_uri = 'exec:nc -l localhost %u' % free_port
+ src_uri = 'exec:nc localhost %u' % free_port
+ self.do_migrate(dest_uri, src_uri)
--
2.21.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 3/4] Acceptance test: provides new functions
2020-02-25 13:12 [PATCH v2 0/4] Acceptance test: Extension of migration tests Oksana Vohchana
2020-02-25 13:12 ` [PATCH v2 1/4] Acceptance test: adds param 'address' in _get_free_port Oksana Vohchana
2020-02-25 13:13 ` [PATCH v2 2/4] Acceptance test: EXEC migration Oksana Vohchana
@ 2020-02-25 13:13 ` Oksana Vohchana
2020-02-25 13:13 ` [PATCH v2 4/4] Acceptance test: provides to use RDMA transport for migration test Oksana Vohchana
3 siblings, 0 replies; 5+ messages in thread
From: Oksana Vohchana @ 2020-02-25 13:13 UTC (permalink / raw)
To: qemu-devel; +Cc: ovoshcha, philmd, wainersm, crosa
Provides new functions related to the rdma migration test
Adds functions to check if service RDMA is enabled and gets
the ip address on the interface where it was configured
Signed-off-by: Oksana Vohchana <ovoshcha@redhat.com>
---
tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index 8209dcf71d..5632d74f14 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -11,12 +11,22 @@
import tempfile
+import re
from avocado_qemu import Test
from avocado import skipUnless
from avocado.utils import network
from avocado.utils import wait
from avocado.utils.path import find_command
+from avocado.utils import service
+from avocado.utils import process
+
+
+NET_AVAILABLE = True
+try:
+ import netifaces
+except ImportError:
+ NET_AVAILABLE = False
class Migration(Test):
@@ -58,6 +68,22 @@ class Migration(Test):
self.cancel('Failed to find a free port')
return port
+ def _if_rdma_enable(self):
+ rdma_stat = service.ServiceManager()
+ rdma = rdma_stat.status('rdma')
+ return rdma
+
+ def _get_ip_rdma(self):
+ get_ip_rdma = process.run('rdma link show').stdout.decode()
+ for line in get_ip_rdma.split('\n'):
+ if re.search(r"ACTIVE", line):
+ interface = line.split(" ")[-2]
+ try:
+ return netifaces.ifaddresses(interface)[netifaces \
+ .AF_INET][0]['addr']
+ except (IndexError, KeyError):
+ return None
+
def test_migration_with_tcp_localhost(self):
dest_uri = 'tcp:localhost:%u' % self._get_free_port()
--
2.21.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 4/4] Acceptance test: provides to use RDMA transport for migration test
2020-02-25 13:12 [PATCH v2 0/4] Acceptance test: Extension of migration tests Oksana Vohchana
` (2 preceding siblings ...)
2020-02-25 13:13 ` [PATCH v2 3/4] Acceptance test: provides new functions Oksana Vohchana
@ 2020-02-25 13:13 ` Oksana Vohchana
3 siblings, 0 replies; 5+ messages in thread
From: Oksana Vohchana @ 2020-02-25 13:13 UTC (permalink / raw)
To: qemu-devel; +Cc: ovoshcha, philmd, wainersm, crosa
Adds test for RDMA migration check
Signed-off-by: Oksana Vohchana <ovoshcha@redhat.com>
---
tests/acceptance/migration.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index 5632d74f14..9b58b5a629 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -103,3 +103,12 @@ class Migration(Test):
dest_uri = 'exec:nc -l localhost %u' % free_port
src_uri = 'exec:nc localhost %u' % free_port
self.do_migrate(dest_uri, src_uri)
+
+ @skipUnless(NET_AVAILABLE, 'Netifaces module not installed')
+ @skipUnless(_if_rdma_enable(None), "Unit rdma.service could not be found")
+ @skipUnless(_get_ip_rdma(None), 'RoCE(RDMA) service or interface not configured')
+ def test_migration_with_rdma_localhost(self):
+ ip = self._get_ip_rdma()
+ free_port = self._get_free_port(address=ip)
+ dest_uri = 'rdma:%s:%u' % (ip, free_port)
+ self.do_migrate(dest_uri)
--
2.21.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-02-25 13:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 13:12 [PATCH v2 0/4] Acceptance test: Extension of migration tests Oksana Vohchana
2020-02-25 13:12 ` [PATCH v2 1/4] Acceptance test: adds param 'address' in _get_free_port Oksana Vohchana
2020-02-25 13:13 ` [PATCH v2 2/4] Acceptance test: EXEC migration Oksana Vohchana
2020-02-25 13:13 ` [PATCH v2 3/4] Acceptance test: provides new functions Oksana Vohchana
2020-02-25 13:13 ` [PATCH v2 4/4] Acceptance test: provides to use RDMA transport for migration test Oksana Vohchana
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).