[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lnst-developers
Subject:    [PATCH-next v2 15/18] lnst.Recipes.ENRT.SimplePerfRecipe: implement wait_tentative_ips
From:       olichtne () redhat ! com
Date:       2019-06-13 11:50:28
Message-ID: 20190613115031.27335-16-olichtne () redhat ! com
[Download RAW message or body]

From: Ondrej Lichtner <olichtne@redhat.com>

After configuring IPv6 addresses and setting a device state to UP, it's
required to wait for the ip address to leave the tentative state during
which the ip address isn't bindable by network applications.

The tentative state is used to indicate that the ip address is
undergoing duplicate address detection on the network.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
---
 lnst/Recipes/ENRT/SimplePerfRecipe.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lnst/Recipes/ENRT/SimplePerfRecipe.py b/lnst/Recipes/ENRT/SimplePerfRecipe.py
index 29c7c2c..ca1e9b9 100644
--- a/lnst/Recipes/ENRT/SimplePerfRecipe.py
+++ b/lnst/Recipes/ENRT/SimplePerfRecipe.py
@@ -45,6 +45,7 @@ def test_wide_configuration(self):
         host2.eth0.up()
         configuration.test_wide_devices.append(host2.eth0)
 
+        self.wait_tentative_ips([host1.eth0, host2.eth0])
 
         return configuration
 
@@ -69,6 +70,14 @@ def generate_ping_endpoints(self, config):
     def generate_perf_endpoints(self, config):
         return [(self.matched.host1.eth0, self.matched.host2.eth0)]
 
+    def wait_tentative_ips(self, devices):
+        def condition():
+            return all(
+                [not ip.is_tentative for dev in devices for ip in dev.ips]
+            )
+
+        self.ctl.wait_for_condition(condition, timeout=5)
+
     @property
     def offload_nics(self):
         return [self.matched.host1.eth0, self.matched.host2.eth0]
-- 
2.22.0
_______________________________________________
LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org
To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahosted.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic