Remove netvirt from SouthboundIT since netvirt has it now. 36/20436/1
authorSam Hague <shague@redhat.com>
Thu, 14 May 2015 20:56:50 +0000 (16:56 -0400)
committerSam Hague <shague@redhat.com>
Thu, 14 May 2015 20:56:50 +0000 (16:56 -0400)
Change-Id: Ia9e31ca00cbbb350c4d163d8b4be585e742e98d4
Signed-off-by: Sam Hague <shague@redhat.com>
southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/AbstractConfigTestBase.java
southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/AbstractMdsalTestBase.java
southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java
southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundITConstants.java

index ebaea27d94296fa1d8617c0b3b8bcfd13e85b7d5..8ae084a4c23ecfafaaf30b600c1049987c95d32e 100644 (file)
@@ -44,19 +44,16 @@ public abstract class AbstractConfigTestBase {
      */
     private static final int MODULE_TIMEOUT = 10000;
     private static int configTimes = 0;
-    private static boolean extras = false;
 
     public abstract String getModuleName();
 
     public abstract String getInstanceName();
 
-    public abstract boolean setExtras();
-
     public abstract MavenUrlReference getFeatureRepo();
 
     public abstract String getFeatureName();
 
-    public Option[] getLoggingOptions(boolean extras) {
+    public Option[] getLoggingOptions() {
         Option[] options = new Option[] {
                 editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
                         logConfiguration(AbstractConfigTestBase.class),
@@ -69,11 +66,11 @@ public abstract class AbstractConfigTestBase {
         return "log4j.logger." + klazz.getPackage().getName();
     }
 
-    public Option[] getFeaturesOptions(boolean extras) {
+    public Option[] getFeaturesOptions() {
         return new Option[]{};
     }
 
-    public Option[] getPropertiesOptions(boolean extras) {
+    public Option[] getPropertiesOptions() {
         return new Option[]{};
     }
 
@@ -95,7 +92,6 @@ public abstract class AbstractConfigTestBase {
     public Option[] config() {
         LOG.info("Calling config, configTimes: {}", configTimes);
         configTimes++;
-        extras = setExtras();
         Option[] options = new Option[] {
                 // KarafDistributionOption.debugConfiguration("5005", true),
                 karafDistributionConfiguration()
@@ -105,9 +101,9 @@ public abstract class AbstractConfigTestBase {
                 keepRuntimeFolder(),
                 //features(getFeatureRepo() , getFeatureName())
         };
-        options = ObjectArrays.concat(options, getFeaturesOptions(extras), Option.class);
-        options = ObjectArrays.concat(options, getLoggingOptions(extras), Option.class);
-        options = ObjectArrays.concat(options, getPropertiesOptions(extras), Option.class);
+        options = ObjectArrays.concat(options, getFeaturesOptions(), Option.class);
+        options = ObjectArrays.concat(options, getLoggingOptions(), Option.class);
+        options = ObjectArrays.concat(options, getPropertiesOptions(), Option.class);
         return options;
     }
 
index 05bab59f27164bde531c99b4f39a729bf36d8fcf..72f0c24ade65ea454911f127ea149ec7ac47708b 100644 (file)
@@ -61,13 +61,13 @@ public abstract class AbstractMdsalTestBase extends AbstractConfigTestBase imple
     }
 
     @Override
-    public Option[] getLoggingOptions(boolean extras) {
+    public Option[] getLoggingOptions() {
         Option[] options = new Option[] {
                 editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
                         logConfiguration(AbstractMdsalTestBase.class),
                         LogLevel.INFO.name()),
         };
-        options = ObjectArrays.concat(options, super.getLoggingOptions(extras), Option.class);
+        options = ObjectArrays.concat(options, super.getLoggingOptions(), Option.class);
         return options;
     }
 
index 7e46743f8dd555c1f8e28780523e8b0b55ff7b23..56c9f4d6a358134412c0dbe849c57dc870b4f4da 100644 (file)
@@ -11,7 +11,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 import static org.ops4j.pax.exam.CoreOptions.maven;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
 
 import com.google.common.collect.ImmutableBiMap;
 import com.google.common.collect.Lists;
@@ -96,7 +95,6 @@ import org.ops4j.pax.exam.karaf.options.LogLevelOption;
 import org.ops4j.pax.exam.options.MavenUrlReference;
 import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerClass;
-import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -118,10 +116,8 @@ public class SouthboundIT extends AbstractMdsalTestBase {
     private static String addressStr;
     private static String portStr;
     private static String connectionType;
-    private static String extrasStr;
     private static Boolean setup = false;
     private static MdsalUtils mdsalUtils = null;
-    //private static String extras = "false";
     private static final String NETVIRT = "org.opendaylight.ovsdb.openstack.net-virt";
     private static final String NETVIRTPROVIDERS = "org.opendaylight.ovsdb.openstack.net-virt-providers";
 
@@ -155,7 +151,6 @@ public class SouthboundIT extends AbstractMdsalTestBase {
 
     @Override
     public String getFeatureName() {
-        //setExtras();
         return "odl-ovsdb-southbound-impl-ui";
     }
 
@@ -166,46 +161,24 @@ public class SouthboundIT extends AbstractMdsalTestBase {
     }
 
     @Override
-    public Option[] getFeaturesOptions(final boolean extras) {
-        if (extras == true) {
-            Option[] options = new Option[] {
-                    features("mvn:org.opendaylight.ovsdb/features-ovsdb/1.1.0-SNAPSHOT/xml/features",
-                            "odl-ovsdb-openstack-sb")};
-            return options;
-        } else {
-            return new Option[]{};
-        }
+    public Option[] getFeaturesOptions() {
+        return new Option[]{};
     }
 
     @Override
-    public Option[] getLoggingOptions(final boolean extras) {
+    public Option[] getLoggingOptions() {
         Option[] options = new Option[] {
-                /*editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
-                        "log4j.logger.org.opendaylight.ovsdb",
-                        LogLevelOption.LogLevel.DEBUG.name()),*/
                 editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
                         "log4j.logger.org.opendaylight.ovsdb.southbound-impl",
                         LogLevelOption.LogLevel.DEBUG.name())
         };
 
-        if (extras == true) {
-            Option[] extraOptions = new Option[] {
-                editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
-                        "log4j.logger.org.opendaylight.ovsdb",
-                        LogLevelOption.LogLevel.DEBUG.name()),
-                editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
-                        "log4j.logger.org.opendaylight.ovsdb.openstack.net-virt",
-                        LogLevelOption.LogLevel.DEBUG.name())
-            };
-            options = ObjectArrays.concat(options, extraOptions, Option.class);
-        }
-
-        options = ObjectArrays.concat(options, super.getLoggingOptions(extras), Option.class);
+        options = ObjectArrays.concat(options, super.getLoggingOptions(), Option.class);
         return options;
     }
 
     @Override
-    public Option[] getPropertiesOptions(final boolean extras) {
+    public Option[] getPropertiesOptions() {
         Properties props = new Properties(System.getProperties());
         String addressStr = props.getProperty(SouthboundITConstants.SERVER_IPADDRESS,
                 SouthboundITConstants.DEFAULT_SERVER_IPADDRESS);
@@ -213,11 +186,9 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                 SouthboundITConstants.DEFAULT_SERVER_PORT);
         String connectionType = props.getProperty(SouthboundITConstants.CONNECTION_TYPE,
                 SouthboundITConstants.CONNECTION_TYPE_ACTIVE);
-        String extrasStr = props.getProperty(SouthboundITConstants.SERVER_EXTRAS,
-                SouthboundITConstants.DEFAULT_SERVER_EXTRAS);
 
-        LOG.info("getPropertiesOptions: Using the following properties: mode= {}, ip:port= {}:{}, extras= {}",
-                connectionType, addressStr, portStr, extrasStr);
+        LOG.info("getPropertiesOptions: Using the following properties: mode= {}, ip:port= {}:{}",
+                connectionType, addressStr, portStr);
 
         Option[] options = new Option[] {
                 editConfigurationFilePut(SouthboundITConstants.CUSTOM_PROPERTIES,
@@ -226,21 +197,10 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                         SouthboundITConstants.SERVER_PORT, portStr),
                 editConfigurationFilePut(SouthboundITConstants.CUSTOM_PROPERTIES,
                         SouthboundITConstants.CONNECTION_TYPE, connectionType),
-                editConfigurationFilePut(SouthboundITConstants.CUSTOM_PROPERTIES,
-                        SouthboundITConstants.SERVER_EXTRAS, extrasStr)
         };
         return options;
     }
 
-
-    public boolean setExtras() {
-        Properties props = new Properties(System.getProperties());
-        boolean extras = props.getProperty(SouthboundITConstants.SERVER_EXTRAS,
-                SouthboundITConstants.DEFAULT_SERVER_EXTRAS).equals("true");
-        LOG.info("setExtras: {}", extras);
-        return extras;
-    }
-
     @Before
     public void setUp() throws InterruptedException {
         if (setup == true) {
@@ -261,10 +221,9 @@ public class SouthboundIT extends AbstractMdsalTestBase {
         addressStr = bundleContext.getProperty(SouthboundITConstants.SERVER_IPADDRESS);
         portStr = bundleContext.getProperty(SouthboundITConstants.SERVER_PORT);
         connectionType = bundleContext.getProperty(SouthboundITConstants.CONNECTION_TYPE);
-        extrasStr = bundleContext.getProperty(SouthboundITConstants.SERVER_EXTRAS);
 
-        LOG.info("setUp: Using the following properties: mode= {}, ip:port= {}:{}, extras= {}",
-                connectionType, addressStr, portStr, extrasStr);
+        LOG.info("setUp: Using the following properties: mode= {}, ip:port= {}:{}",
+                connectionType, addressStr, portStr);
         if (connectionType.equalsIgnoreCase(SouthboundITConstants.CONNECTION_TYPE_ACTIVE)) {
             if (addressStr == null) {
                 fail(usage());
@@ -273,11 +232,6 @@ public class SouthboundIT extends AbstractMdsalTestBase {
 
         mdsalUtils = new MdsalUtils(dataBroker);
         setup = true;
-
-        if (extrasStr.equals("true")) {
-            isBundleReady(bundleContext, NETVIRT);
-            isBundleReady(bundleContext, NETVIRTPROVIDERS);
-        }
     }
 
     /**
@@ -2199,29 +2153,4 @@ public class SouthboundIT extends AbstractMdsalTestBase {
         }
         Assert.assertTrue(disconnectOvsdbNode(connectionInfo));
     }
-
-    /**
-     * isBundleReady is used to check if the requested bundle is Active
-     */
-    public void isBundleReady(BundleContext bundleContext, String bundleName) throws InterruptedException {
-        boolean ready = false;
-
-        while (!ready) {
-            int state = Bundle.UNINSTALLED;
-            Bundle[] bundles = bundleContext.getBundles();
-            for (Bundle element : bundles) {
-                if (element.getSymbolicName().equals(bundleName)) {
-                    state = element.getState();
-                    LOG.info(">>>>> bundle is ready {}", bundleName);
-                    break;
-                }
-            }
-            if (state != Bundle.ACTIVE) {
-                LOG.info(">>>>> bundle not ready {}", bundleName);
-                Thread.sleep(5000);
-            } else {
-                ready = true;
-            }
-        }
-    }
 }
index 27a8b6fad32c74fb3f686e73dc718c5cdd6fe492..c2fef907d4ac28fe83ee770060da424ca195e130 100644 (file)
@@ -19,13 +19,11 @@ public final class SouthboundITConstants {
     public static final String CUSTOM_PROPERTIES = "etc/custom.properties";
     public static final String SERVER_IPADDRESS = "ovsdbserver.ipaddress";
     public static final String SERVER_PORT = "ovsdbserver.port";
-    public static final String SERVER_EXTRAS = "ovsdbserver.extras";
     public static final String CONNECTION_TYPE = "ovsdbserver.connection";
     public static final String CONNECTION_TYPE_ACTIVE = "active";
     public static final String CONNECTION_TYPE_PASSIVE = "passive";
     public static final int CONNECTION_INIT_TIMEOUT = 10000;
     public static final String DEFAULT_SERVER_IPADDRESS = "127.0.0.1";
     public static final String DEFAULT_SERVER_PORT = "6640";
-    public static final String DEFAULT_SERVER_EXTRAS = "false";
     public static final String BRIDGE_NAME = "brtest";
 }