From: Oksana Voshchana <ovoshcha@redhat.com>
To: Wainer dos Santos Moschetta <wainersm@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
qemu-devel@nongnu.org, "Cleber Rosa" <crosa@redhat.com>
Subject: Re: [PATCH v1 3/4] Acceptance test: provides new functions
Date: Mon, 24 Feb 2020 18:23:15 +0200 [thread overview]
Message-ID: <CAMXCgj4STmWcco4vqr1Mvwrc+YE-B6r+bAh00S0PmPZya001yA@mail.gmail.com> (raw)
In-Reply-To: <875891d8-23f7-2603-2c51-9a734cf148b6@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3011 bytes --]
Hi Wainer,
Thanks for review
On Fri, Feb 21, 2020 at 8:31 PM Wainer dos Santos Moschetta <
wainersm@redhat.com> wrote:
> Hi Oksana,
>
> On 2/14/20 12:52 PM, Oksana Vohchana wrote:
> > Adds functions to check if service RDMA is enabled and gets the interface
> > where it was configured
> >
> > Signed-off-by: Oksana Vohchana <ovoshcha@redhat.com>
> > ---
> > tests/acceptance/migration.py | 17 +++++++++++++++++
> > 1 file changed, 17 insertions(+)
> >
> > diff --git a/tests/acceptance/migration.py
> b/tests/acceptance/migration.py
> > index 8209dcf71d..bbd88f8dda 100644
> > --- a/tests/acceptance/migration.py
> > +++ b/tests/acceptance/migration.py
> > @@ -11,12 +11,16 @@
> >
> >
> > import tempfile
> > +import re
> > +import netifaces
>
> Since netifaces isn't a standard Python library that import might fail.
>
> The tests dependencies are listed in tests/requirements.txt, and
> installed in the environment created by `make check-acceptance`. If you
> want to ensure the test behaves well even when executed manually (i.e.
> not via `make check-acceptance`), you can add runtime checks as can be
> seen in tests/acceptance/machine_m68k_nextcube.py
>
Thanks, a "runtime checks" is a good approach
I'll improve it
>
> > 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
> >
> >
> > class Migration(Test):
> > @@ -58,6 +62,19 @@ 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
>
>
> Above function is used on patch04, but actually I don't think it needs
> to check this service for RoCE. It would be needed if it was using the
> rxe_cfg to configure the rdma link. Or am I missing something?
>
> The function _if_rdma_enable() checks if RDMA service enabled in the
system it does not depend on wich utils we will use to check if some
network configuration present (rdma or rxe_cfg)
> > +
> > + 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]
> > + ip =
> netifaces.ifaddresses(interface)[netifaces.AF_INET][0]['addr']
> > + return ip
> > +
>
> I suggest that it explicitly returns None if none is found.
>
Ok, I agree
I'll improve it
> Thanks!
>
> - Wainer
>
> >
> > def test_migration_with_tcp_localhost(self):
> > dest_uri = 'tcp:localhost:%u' % self._get_free_port()
>
>
Thanks!
[-- Attachment #2: Type: text/html, Size: 4473 bytes --]
next prev parent reply other threads:[~2020-02-24 16:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-14 14:52 [PATCH v1 0/4] Extension of migration tests Oksana Vohchana
2020-02-14 14:52 ` [PATCH v1 1/4] Acceptance test: add address as param Oksana Vohchana
2020-02-20 18:54 ` Wainer dos Santos Moschetta
2020-02-14 14:52 ` [PATCH v1 2/4] Acceptance test: EXEC migration Oksana Vohchana
2020-02-14 18:27 ` Philippe Mathieu-Daudé
2020-02-20 17:23 ` Wainer dos Santos Moschetta
2020-02-14 14:52 ` [PATCH v1 3/4] Acceptance test: provides new functions Oksana Vohchana
2020-02-21 18:31 ` Wainer dos Santos Moschetta
2020-02-24 16:23 ` Oksana Voshchana [this message]
2020-02-14 14:52 ` [PATCH v1 4/4] Acceptance test: provides to use RDMA transport for migration Oksana Vohchana
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMXCgj4STmWcco4vqr1Mvwrc+YE-B6r+bAh00S0PmPZya001yA@mail.gmail.com \
--to=ovoshcha@redhat.com \
--cc=crosa@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wainersm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).