<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
-
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
<parent>
<groupId>org.opendaylight.odlparent</groupId>
- <artifactId>features-parent</artifactId>
+ <artifactId>odlparent</artifactId>
<version>1.6.0-SNAPSHOT</version>
<relativePath/>
</parent>
+
<groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>openstack.net-virt-sfc-features</artifactId>
+ <artifactId>openstack.net-virt-sfc-features-aggregator</artifactId>
<version>1.2.1-SNAPSHOT</version>
- <name>${project.artifactId}</name>
+ <packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<prerequisites>
<maven>3.1.1</maven>
</prerequisites>
- <properties>
- <mdsal.model.version>0.8.0-SNAPSHOT</mdsal.model.version>
- <mdsal.version>1.3.0-SNAPSHOT</mdsal.version>
- <restconf.version>1.3.0-SNAPSHOT</restconf.version>
- <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
- <dlux.version>0.3.0-SNAPSHOT</dlux.version>
- <configfile.directory>etc/opendaylight/karaf</configfile.directory>
- </properties>
- <dependencyManagement>
- <dependencies>
- <!-- project specific dependencies -->
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>mdsal-artifacts</artifactId>
- <version>${mdsal.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.netconf</groupId>
- <artifactId>restconf-artifacts</artifactId>
- <version>${restconf.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>features-yangtools</artifactId>
- <classifier>features</classifier>
- <version>${yangtools.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>features-mdsal-model</artifactId>
- <version>${mdsal.model.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>features-mdsal</artifactId>
- <classifier>features</classifier>
- <version>${mdsal.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.netconf</groupId>
- <artifactId>features-restconf</artifactId>
- <classifier>features</classifier>
- <version>${restconf.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.dlux</groupId>
- <artifactId>features-dlux</artifactId>
- <classifier>features</classifier>
- <version>${dlux.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-impl</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-impl</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>utils.mdsal-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
+ <modules>
+ <module>production</module>
+ <module>test</module>
+ </modules>
+ <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <scm>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <tag>HEAD</tag>
+ <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
+ </scm>
</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>features-parent</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>openstack.net-virt-sfc-features</artifactId>
+ <version>1.2.1-SNAPSHOT</version>
+ <name>${project.artifactId}</name>
+ <modelVersion>4.0.0</modelVersion>
+ <prerequisites>
+ <maven>3.1.1</maven>
+ </prerequisites>
+ <properties>
+ <mdsal.model.version>0.8.0-SNAPSHOT</mdsal.model.version>
+ <mdsal.version>1.3.0-SNAPSHOT</mdsal.version>
+ <restconf.version>1.3.0-SNAPSHOT</restconf.version>
+ <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
+ <dlux.version>0.3.0-SNAPSHOT</dlux.version>
+ <configfile.directory>etc/opendaylight/karaf</configfile.directory>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <!-- project specific dependencies -->
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>${mdsal.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.netconf</groupId>
+ <artifactId>restconf-artifacts</artifactId>
+ <version>${restconf.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>features-yangtools</artifactId>
+ <classifier>features</classifier>
+ <version>${yangtools.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>features-mdsal-model</artifactId>
+ <version>${mdsal.model.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>features-mdsal</artifactId>
+ <classifier>features</classifier>
+ <version>${mdsal.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.netconf</groupId>
+ <artifactId>features-restconf</artifactId>
+ <classifier>features</classifier>
+ <version>${restconf.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>features-dlux</artifactId>
+ <classifier>features</classifier>
+ <version>${dlux.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openstack.net-virt-sfc-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openstack.net-virt-sfc-impl</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>config</classifier>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openstack.net-virt-sfc-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>southbound-features</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.mdsal-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
<repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/${mdsal.model.version}/xml/features</repository>
<repository>mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features</repository>
<repository>mvn:org.opendaylight.dlux/features-dlux/${dlux.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.ovsdb/southbound-features/1.2.1-SNAPSHOT/xml/features</repository>
<feature name='odl-ovsdb-sfc-api' version='${project.version}' description='OpenDaylight :: ovsdb-sfc :: api'>
<feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
<bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-api/${project.version}</bundle>
<feature name='odl-ovsdb-sfc' version='${project.version}' description='OpenDaylight :: ovsdb-sfc'>
<feature version='${mdsal.version}'>odl-mdsal-broker</feature>
<feature version='${project.version}'>odl-ovsdb-sfc-api</feature>
+ <feature version='${project.version}'>odl-ovsdb-southbound-impl</feature>
<bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-impl/${project.version}</bundle>
<bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/${project.version}</bundle>
<configfile finalname="${configfile.directory}/openstack.net-virt-sfc.xml">mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-impl/${project.version}/xml/config</configfile>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>features-parent</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>openstack.net-virt-sfc-features-test</artifactId>
+ <version>1.2.1-SNAPSHOT</version>
+ <name>${project.artifactId}</name>
+ <modelVersion>4.0.0</modelVersion>
+ <prerequisites>
+ <maven>3.1.1</maven>
+ </prerequisites>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openstack.net-virt-sfc-features</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.mdsal-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.southbound-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<features name="odl-ovsdb-sfc-test${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+ <repository>mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-features/1.2.1-SNAPSHOT/xml/features</repository>
+ <feature name='odl-ovsdb-sfc-test' version='${project.version}' description='OpenDaylight :: ovsdb-sfc-test'>
+ <bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/${project.version}</bundle>
+ <bundle>mvn:org.opendaylight.ovsdb/utils.southbound-utils/${project.version}</bundle>
+ <feature version='${project.version}'>odl-ovsdb-southbound-impl-ui</feature>
+ </feature>
+</features>
<properties>
<karaf.distro.groupId>org.opendaylight.ovsdb</karaf.distro.groupId>
<karaf.distro.artifactId>openstack.net-virt-sfc-karaf</karaf.distro.artifactId>
- <karaf.distro.version>1.0.0-SNAPSHOT</karaf.distro.version>
+ <karaf.distro.version>${project.version}</karaf.distro.version>
<karaf.distro.type>zip</karaf.distro.type>
</properties>
<artifactId>utils.mdsal-utils</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.southbound-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>concepts</artifactId>
+ </dependency>
<dependency>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>sonar-jacoco-listeners</artifactId>
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import static org.ops4j.pax.exam.CoreOptions.composite;
import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.CoreOptions.propagateSystemProperties;
import static org.ops4j.pax.exam.CoreOptions.vmOption;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
+import java.util.Properties;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.ovsdb.openstack.netvirt.sfc.utils.AclUtils;
-//import org.opendaylight.ovsdb.openstack.netvirt.sfc.utils.SfcUtils;
import org.opendaylight.ovsdb.openstack.netvirt.sfc.utils.ClassifierUtils;
import org.opendaylight.ovsdb.openstack.netvirt.sfc.utils.SfcUtils;
import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.AccessLists;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.AccessListsBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.AccessListBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers.classifier.sffs.SffBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev150105.Sfc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev150105.SfcBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
import org.opendaylight.yangtools.concepts.Builder;
+import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.ops4j.pax.exam.Configuration;
private static SfcUtils sfcUtils = new SfcUtils();
private static MdsalUtils mdsalUtils;
private static AtomicBoolean setup = new AtomicBoolean(false);
+ private static SouthboundUtils southboundUtils;
+ private static String addressStr;
+ private static String portStr;
+ private static String connectionType;
+ public static final String SERVER_IPADDRESS = "ovsdbserver.ipaddress";
+ public static final String SERVER_PORT = "ovsdbserver.port";
+ 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 String DEFAULT_SERVER_PORT = "6640";
@Override
public String getModuleName() {
@Configuration
@Override
public Option[] config() {
- Option[] parentOptions = super.config();
- Option[] otherOptions = getOtherOptions();
- Option[] options = new Option[parentOptions.length + otherOptions.length];
- System.arraycopy(parentOptions, 0, options, 0, parentOptions.length);
- System.arraycopy(otherOptions, 0, options, parentOptions.length, otherOptions.length);
- return options;
- }
+ Option[] parentOptions = super.config();
+ Option[] propertiesOptions = getPropertiesOptions();
+ Option[] otherOptions = getOtherOptions();
+ Option[] options = new Option[parentOptions.length + propertiesOptions.length + otherOptions.length];
+ System.arraycopy(parentOptions, 0, options, 0, parentOptions.length);
+ System.arraycopy(propertiesOptions, 0, options, parentOptions.length, propertiesOptions.length);
+ System.arraycopy(otherOptions, 0, options, parentOptions.length + propertiesOptions.length,
+ otherOptions.length);
+ return options;
+ }
private Option[] getOtherOptions() {
return new Option[] {
};
}
+ public Option[] getPropertiesOptions() {
+ return new Option[] {
+ propagateSystemProperties(SERVER_IPADDRESS, SERVER_PORT, CONNECTION_TYPE),
+ };
+ }
+
@Override
public Option getLoggingOption() {
Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
return option;
}
+ protected String usage() {
+ return "Integration Test needs a valid connection configuration as follows :\n"
+ + "active connection : mvn -Dovsdbserver.ipaddress=x.x.x.x -Dovsdbserver.port=yyyy verify\n"
+ + "passive connection : mvn -Dovsdbserver.connection=passive verify\n";
+ }
+
+ private void getProperties() {
+ Properties props = System.getProperties();
+ addressStr = props.getProperty(SERVER_IPADDRESS);
+ portStr = props.getProperty(SERVER_PORT, DEFAULT_SERVER_PORT);
+ connectionType = props.getProperty(CONNECTION_TYPE, "active");
+ LOG.info("setUp: Using the following properties: mode= {}, ip:port= {}:{}",
+ connectionType, addressStr, portStr);
+ if (connectionType.equalsIgnoreCase(CONNECTION_TYPE_ACTIVE)) {
+ if (addressStr == null) {
+ fail(usage());
+ }
+ }
+ }
+
@Before
@Override
public void setup() {
DataBroker dataBroker = getDatabroker(getProviderContext());
mdsalUtils = new MdsalUtils(dataBroker);
assertNotNull("mdsalUtils should not be null", mdsalUtils);
+ southboundUtils = new SouthboundUtils(mdsalUtils);
+ getProperties();
setup.set(true);
}
}
@Test
- public void testAcl() {
- AccessListsBuilder accessListsBuilder = setAccessLists();
- InstanceIdentifier<AccessLists> path = InstanceIdentifier.create(AccessLists.class);
- assertTrue(mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, path, accessListsBuilder.build()));
- AccessLists accessLists = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path);
- assertNotNull("AccessLists should not be null", accessLists);
- assertTrue("Failed to remove AccessLists", mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, path));
- accessLists = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path);
- assertNull("AccessLists should be null", accessLists);
+ public void testAccessLists() {
+ testModel(setAccessLists(), AccessLists.class);
}
private ClassifiersBuilder setClassifiers() {
}
@Test
- public void testClassifier() {
- ClassifiersBuilder classifiersBuilder = setClassifiers();
- InstanceIdentifier<Classifiers> path = InstanceIdentifier.create(Classifiers.class);
- assertTrue(mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, path, classifiersBuilder.build()));
- Classifiers classifiers = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path);
- assertNotNull("Classifiers should not be null", classifiers);
- assertTrue("Failed to remove Classifiers", mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, path));
- classifiers = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path);
- assertNull("Classifiers should be null", classifiers);
+ public void testClassifiers() {
+ testModel(setClassifiers(), Classifiers.class);
+ }
+
+ private SfcBuilder setSfc() {
+ SfcBuilder sfcBuilder = sfcUtils.createSfc(new SfcBuilder(), "sfc");
+ return sfcBuilder;
}
@Test
public void testSfc() {
- SfcBuilder sfcBuilder = sfcUtils.createSfc(new SfcBuilder(), "sfc");
- InstanceIdentifier<Sfc> path = InstanceIdentifier.create(Sfc.class);
- assertTrue(mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, path, sfcBuilder.build()));
- Sfc sfc = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path);
- assertNotNull("SfcUtils should not be null", sfc);
- assertTrue("Failed to remove Sfc", mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, path));
- sfc = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path);
- assertNull("Sfc should be null", sfc);
+ testModel(setSfc(), Sfc.class);
+ }
+
+ private <T extends DataObject> void testModel(Builder<T> builder, Class<T> clazz) {
+ InstanceIdentifier<T> path = InstanceIdentifier.create(clazz);
+ assertTrue(mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, path, builder.build()));
+ T result = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path);
+ assertNotNull(clazz.getSimpleName() + " should not be null", result);
+ assertTrue("Failed to remove " + clazz.getSimpleName(),
+ mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, path));
+ result = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path);
+ assertNull(clazz.getSimpleName() + " should be null", result);
+ }
+
+ @Test
+ public void testDoIt() throws InterruptedException {
+ ConnectionInfo connectionInfo = southboundUtils.getConnectionInfo(addressStr, portStr);
+ southboundUtils.connectOvsdbNode(connectionInfo);
+ Thread.sleep(1000);
+ southboundUtils.disconnectOvsdbNode(connectionInfo);
}
}
<maven>3.1.1</maven>
</prerequisites>
<properties>
- <karaf.localFeature>odl-ovsdb-sfc-ui</karaf.localFeature>
+ <karaf.localFeature>odl-ovsdb-sfc-test</karaf.localFeature>
</properties>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-artifacts</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
<dependencies>
<dependency>
<!-- scope is compile so all features (there is only one) are installed
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-features</artifactId>
+ <artifactId>openstack.net-virt-sfc-features-test</artifactId>
+ <version>${project.version}</version>
<classifier>features</classifier>
<type>xml</type>
<scope>runtime</scope>
<module>mdsal-openflow</module>
<module>servicehelper</module>
<module>mdsal-utils</module>
+ <module>southbound-utils</module>
</modules>
</project>