If the OVS kernel module is loaded at first time, it might take
a few seconds.
This patch add a sleep before sending OVSDB requests.

Signed-off-by: IWASE Yusuke <[email protected]>
---
 .travis.yml                          | 1 -
 ryu/tests/unit/lib/ovs/test_vsctl.py | 6 ++++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 826f3ac..b98a6e2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,7 +16,6 @@ sudo: required  # Required to enable Docker service
 
 install:
   - docker build -t ut_mininet ryu/tests/docker/mininet/
-  - CID=`docker run --privileged -t -d ut_mininet`; docker rm -f $CID  # Test 
container
   - pip install tox coveralls
 
 script:
diff --git a/ryu/tests/unit/lib/ovs/test_vsctl.py 
b/ryu/tests/unit/lib/ovs/test_vsctl.py
index d87a990..c7fe835 100644
--- a/ryu/tests/unit/lib/ovs/test_vsctl.py
+++ b/ryu/tests/unit/lib/ovs/test_vsctl.py
@@ -21,6 +21,7 @@ import unittest
 from nose.tools import eq_
 from nose.tools import ok_
 
+from ryu.lib.hub import sleep
 from ryu.lib.ovs import vsctl
 
 
@@ -89,6 +90,11 @@ class TestVSCtl(unittest.TestCase):
         cls.container_mn = cls._docker_run(DOCKER_IMAGE_MININET)
         cls.container_mn_ip = cls._docker_inspect_ip_addr(cls.container_mn)
 
+        # Note: Wait for loading the OVS kernel module.
+        # If the OVS kernel module is loaded at first time, it might take
+        # a few seconds.
+        sleep(5)
+
         cls._docker_exec_mn(
             'ovs-vsctl set-manager %s' % OVSDB_MANAGER_ADDR)
 
-- 
2.7.4


------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to