Fix IT failure when not running DockerOvs docker 29/41929/1
authorJosh <jhershbe@redhat.com>
Sun, 17 Jul 2016 14:55:46 +0000 (16:55 +0200)
committerJosh <jhershbe@redhat.com>
Sun, 17 Jul 2016 14:55:46 +0000 (16:55 +0200)
Depends on: https://git.opendaylight.org/gerrit/#/c/41927/

Change-Id: If6f2078b7799490376cb50adf7c8c4f813f01110
Signed-off-by: Josh <jhershbe@redhat.com>
openstack/utils/netvirt-it-utils/src/main/java/org/opendaylight/netvirt/utils/netvirt/it/utils/PingableNeutronNetItUtil.java

index b8a63879ff1d4423693461f3d61c3c272a0f4b3a..6a81aa47153f1111c37c0bb97766351a76a34e89 100644 (file)
@@ -49,6 +49,10 @@ public class PingableNeutronNetItUtil extends NeutronNetItUtil {
      */
     public void createPort(Node bridge, String portName, String owner, NeutronSecurityGroup... secGroups)
             throws InterruptedException, IOException {
+        if (dockerOvs.usingExternalDocker()) {
+            super.createPort(bridge, portName, owner, secGroups);
+            return;
+        }
 
         PortInfo portInfo = buildPortInfo(portName);
 
@@ -65,6 +69,10 @@ public class PingableNeutronNetItUtil extends NeutronNetItUtil {
      * @throws InterruptedException because we sleep
      */
     public void preparePortForPing(String portName) throws IOException, InterruptedException {
+        if (dockerOvs.usingExternalDocker()) {
+            return;
+        }
+
         String nsName = "ns-" + portName;
 
         PortInfo portInfo = portInfoByName.get(portName);
@@ -87,6 +95,10 @@ public class PingableNeutronNetItUtil extends NeutronNetItUtil {
      * @throws InterruptedException because we sleep
      */
     public void ping(String fromPort, String toPort) throws IOException, InterruptedException {
+        if (dockerOvs.usingExternalDocker()) {
+            return;
+        }
+
         PortInfo portInfo = portInfoByName.get(toPort);
         Assert.assertNotNull(portInfo);
         pingIp(fromPort, portInfo.ip);
@@ -100,6 +112,10 @@ public class PingableNeutronNetItUtil extends NeutronNetItUtil {
      * @throws InterruptedException because we sleep
      */
     public void pingIp(String fromPort, String ip) throws IOException, InterruptedException {
+        if (dockerOvs.usingExternalDocker()) {
+            return;
+        }
+
         String fromNs = "ns-" + fromPort;
         dockerOvs.runInContainer(DEFAULT_WAIT, 0, "ip", "netns", "exec", fromNs, "ping", "-c", "4", ip);
     }