<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
- <!-- ToDo: Fix IT Failures
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- </plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- encoders are assigned the type
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.opendaylight.ovsdb" level="INFO" additivity="false">
+ <appender-ref ref="STDOUT" />
+ </logger>
+
+ <!--<logger name="com.lordofthejars.foo" level="INFO" additivity="false">-->
+ <!--<appender-ref ref="STDOUT" />-->
+ <!--</logger>-->
+
+ <root level="INFO">
+ <appender-ref ref="STDOUT" />
+ </root>
+
+</configuration>
\ No newline at end of file
--- /dev/null
+/*
+ * [[ Authors will Fill in the Copyright header ]]
+ *
+ * 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
+ *
+ * Authors : Brent Salisbury, Hugo Trippaers
+ */
+package org.opendaylight.ovsdb.plugin;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.networkconfig.bridgedomain.ConfigConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class BridgeDomainConfigBridgeTestCases extends PluginTestBase {
+ private static final Logger logger = LoggerFactory
+ .getLogger(BridgeDomainConfigBridgeTestCases.class);
+
+ @Test
+ public void addBridge() throws Throwable{
+
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
+
+ /**
+ * Create a Bridge Domain
+ *
+ * @param node Node serving this configuration service
+ * @param bridgeDomainIdentifier String representation of a Bridge Domain
+ */
+ ConfigurationService configurationService = testObjects.configurationService;
+ configurationService.createBridgeDomain(node, BRIDGE_NAME, null);
+ }
+
+ @Test
+ public void getBridgeDomains() throws Throwable{
+
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ InventoryService inventoryService = testObjects.inventoryService;
+ Node node = testObjects.node;
+
+ /**
+ * List a Bridge Domain
+ *
+ * @param node Node serving this configuration service
+ *
+ */
+ ConfigurationService configurationService = testObjects.configurationService;
+ List<String> ls = configurationService.getBridgeDomains(node);
+ }
+
+ @Test
+ public void setController() throws Throwable{
+ TestObjects testObjects = getTestConnection();
+ Node node = testObjects.node;
+
+ ConfigurationService configurationService = testObjects.configurationService;
+ configurationService.setBridgeOFController(node, BRIDGE_NAME);
+
+ }
+
+ @Test
+ public void setBridgeConfig() throws Throwable{
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
+
+ Map<ConfigConstants, Object> configs = new HashMap<ConfigConstants, Object>();
+
+ Map<String, String> exterIDPairs = new HashMap<String, String>();
+ exterIDPairs.put("br-foo", "br-bar");
+ //Will accept multiple array pairs. Pairs must be arrays not maps.
+ configs.put(ConfigConstants.CUSTOM, exterIDPairs);
+
+ ConfigurationService configurationService = testObjects.configurationService;
+ configurationService.addBridgeDomainConfig(node, BRIDGE_NAME, configs);
+ }
+
+}
-/*\r
- * [[ Authors will Fill in the Copyright header ]]\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Authors : Brent Salisbury, Hugo Trippaers\r
- */\r
-package org.opendaylight.ovsdb.plugin;\r
-\r
-import org.junit.Test;\r
-import org.opendaylight.controller.sal.core.Node;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public class OvsdbTestSetManagerIT extends OvsdbTestBase {\r
- private static final Logger logger = LoggerFactory\r
- .getLogger(OvsdbTestSetManagerIT.class);\r
-\r
- @Test\r
- public void setManager() throws Throwable{\r
- TestObjects testObjects = getTestConnection();\r
- Node node = testObjects.node;\r
-\r
-\r
- String port = "6634";\r
- String host = FAKE_IP;\r
- String connectionType = "ptcp";\r
-\r
- String manager = connectionType + ":" + host + ":" + port;\r
-\r
- /**\r
- * Implements the OVS Connection for Managers\r
- *\r
- * @param node Node serving this configuration service\r
- * @param String with IP and connection type ex. type:ip:port\r
- *\r
- */\r
- ConfigurationService configurationService = testObjects.configurationService;\r
- configurationService.setManager(node, manager);\r
- }\r
-\r
-}\r
+/*
+ * [[ Authors will Fill in the Copyright header ]]
+ *
+ * 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
+ *
+ * Authors : Brent Salisbury, Hugo Trippaers
+ */
+package org.opendaylight.ovsdb.plugin;
+
+import org.junit.Test;
+import org.opendaylight.controller.sal.core.Node;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class BridgeDomainConfigManagerTestCases extends PluginTestBase {
+ private static final Logger logger = LoggerFactory
+ .getLogger(BridgeDomainConfigManagerTestCases.class);
+
+ @Test
+ public void setManager() throws Throwable{
+ TestObjects testObjects = getTestConnection();
+ Node node = testObjects.node;
+
+
+ String port = "6634";
+ String host = FAKE_IP;
+ String connectionType = "ptcp";
+
+ String manager = connectionType + ":" + host + ":" + port;
+
+ /**
+ * Implements the OVS Connection for Managers
+ *
+ * @param node Node serving this configuration service
+ * @param String with IP and connection type ex. type:ip:port
+ *
+ */
+ ConfigurationService configurationService = testObjects.configurationService;
+ configurationService.setManager(node, manager);
+ }
+
+}
--- /dev/null
+/*
+ * [[ Authors will Fill in the Copyright header ]]
+ *
+ * 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
+ *
+ * Authors : Brent Salisbury, Hugo Trippaers
+ */
+package org.opendaylight.ovsdb.plugin;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.networkconfig.bridgedomain.ConfigConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class BridgeDomainConfigPortTestCases extends PluginTestBase {
+ private static final Logger logger = LoggerFactory
+ .getLogger(BridgeDomainConfigPortTestCases.class);
+ private Properties props;
+
+ @Before
+ public void loadProps() throws IOException {
+ props = loadProperties();
+ }
+
+
+ /**
+ * Create a Port and attach it to a Bridge
+ * Ex. ovs-vsctl add-port br0 vif0
+ */
+
+ @Test
+ public void addPort() throws Throwable{
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
+ ConfigurationService configurationService = testObjects.configurationService;
+ configurationService.addPort(node, BRIDGE_NAME, PORT_NAME, null);
+ }
+
+ /**
+ * Create a Port with a user defined VLAN, and attach it to the specified bridge.
+ *
+ * Ex. ovs-vsctl add-port JUNIT_BRIDGE_TEST Jvlanvif0 tag=100
+ */
+ @Test
+ public void addPortVlan() throws Throwable{
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
+
+ int vlanid = 100;
+
+ ConfigurationService configurationService = testObjects.configurationService;
+ Map<ConfigConstants, Object> configs = new HashMap<ConfigConstants, Object>();
+ configs.put(ConfigConstants.TYPE, "VLAN");
+ configs.put(ConfigConstants.VLAN, vlanid+"");
+ configurationService.addPort(node, BRIDGE_NAME, TAGGED_PORT_NAME, configs);
+ }
+
+ /**
+ * Create an Encapsulated Tunnel Interface and destination Tunnel Endpoint
+ * tunnelendpoint IP address of the destination Tunnel Endpoint.
+ * tunencap is the tunnel encapsulation options being (CAPWAP, GRE, VXLAN).
+ *
+ * Ex. ovs-vsctl add-port br0 vxlan1 (cont)
+ * -- set interface vxlan1 type=vxlan options:remote_ip=192.168.1.11
+ */
+
+ @Test
+ public void addTunnel() throws Throwable{
+ TestObjects testObjects = getTestConnection();
+ Node node = testObjects.node;
+
+ Encapsulation encap = Encapsulation.VXLAN;
+ String tunencap = encap.toString();
+ String tunnelendpoint = FAKE_IP;
+
+ ConfigurationService configurationService = testObjects.configurationService;
+ Map<ConfigConstants, Object> configs = new HashMap<ConfigConstants, Object>();
+ configs.put(ConfigConstants.TYPE, "TUNNEL");
+ configs.put(ConfigConstants.TUNNEL_TYPE, tunencap);
+ configs.put(ConfigConstants.DEST_IP, tunnelendpoint);
+
+ configurationService.addPort(node, BRIDGE_NAME, TUNNEL_PORT_NAME, configs);
+ }
+
+ /**
+ * Deletes an existing port from an existing bridge
+ * Ex. ovs-vsctl del-port ovsbr0 tap0
+ */
+ @Test
+ public void deletePort() throws Throwable{
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
+
+ ConfigurationService configurationService = testObjects.configurationService;
+ configurationService.deletePort(node, BRIDGE_NAME, PORT_NAME);
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * 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
+ *
+ * Authors : Madhu Venugopal, Dave Tucker
+ */
+package org.opendaylight.ovsdb.plugin;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.opendaylight.ovsdb.plugin.PluginTestBase.TestObjects;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ BridgeDomainConfigBridgeTestCases.class,
+ BridgeDomainConfigPortTestCases.class,
+ BridgeDomainConfigManagerTestCases.class,
+ TearDown.class})
+
+public class OvsdbPluginTestSuiteIT {
+ static TestObjects testObjects;
+
+ public static TestObjects getTestObjects() {
+ return testObjects;
+ }
+
+ public static void setTestObjects(TestObjects testObjects) {
+ OvsdbPluginTestSuiteIT.testObjects = testObjects;
+ }
+
+}
+++ /dev/null
-/*
- * [[ Authors will Fill in the Copyright header ]]
- *
- * 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
- *
- * Authors : Brent Salisbury, Hugo Trippaers
- */
-package org.opendaylight.ovsdb.plugin;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.controller.sal.core.Node;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OvsdbTestAddPortIT extends OvsdbTestBase {
- private static final Logger logger = LoggerFactory
- .getLogger(OvsdbTestAddPortIT.class);
- private Properties props;
-
- @Before
- public void loadProps() throws IOException {
- props = loadProperties();
- }
-
- @Test
- public void addPort() throws Throwable{
- TestObjects testObjects = getTestConnection();
- ConnectionService connectionService = testObjects.connectionService;
- Node node = testObjects.node;
-
- /**
- * Create a Port and attach it to a Bridge
- * Ex. ovs-vsctl add-port br0 vif0
- * @param node Node serving this configuration service
- * @param bridgeDomainIdentifier String representation of a Bridge Domain
- * @param portIdentifier String representation of a user defined Port Name
- */
- ConfigurationService configurationService = testObjects.configurationService;
- configurationService.addPort(node, BRIDGE_NAME, PORT_NAME, null);
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * [[ Authors will Fill in the Copyright header ]]
- *
- * 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
- *
- * Authors : Brent Salisbury, Hugo Trippaers
- */
-package org.opendaylight.ovsdb.plugin;
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.networkconfig.bridgedomain.ConfigConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OvsdbTestAddTunnelIT extends OvsdbTestBase {
- private static final Logger logger = LoggerFactory
- .getLogger(OvsdbTestAddTunnelIT.class);
-
- @Test
- public void addTunnel() throws Throwable{
- TestObjects testObjects = getTestConnection();
- Node node = testObjects.node;
-
- /**
- * tunnelendpoint IP address of the
- * destination Tunnel Endpoint.
- * tunencap is the tunnel encapsulation
- * options being (CAPWAP, GRE, VXLAN).
- * Use the following lines to test GRE and CAPWAP
- * Encapsulation encap = Encapsulation.GRE;
- * Encapsulation encap = Encapsulation.CAPWAP;
- */
-
- Encapsulation encap = Encapsulation.VXLAN;
- String tunencap = encap.toString();
- String tunnelendpoint = FAKE_IP;
-
- /**
- * Create an Encapsulated Tunnel Interface and destination Tunnel Endpoint
- *
- * Ex. ovs-vsctl add-port br0 vxlan1 (cont)
- * -- set interface vxlan1 type=vxlan options:remote_ip=192.168.1.11
- * @param node Node serving this configuration service
- * @param bridgeDomainIdentifier String representation of a Bridge Domain
- * @param portIdentifier String representation of a user defined Port Name
- * @param tunnelendpoint IP address of the destination Tunnel Endpoint
- * @param tunencap is the tunnel encapsulation options being CAPWAP, GRE or VXLAN
- * The Bridge must already be defined before calling addTunnel.
- */
- ConfigurationService configurationService = testObjects.configurationService;
- Map<ConfigConstants, Object> configs = new HashMap<ConfigConstants, Object>();
- configs.put(ConfigConstants.TYPE, "TUNNEL");
- configs.put(ConfigConstants.TUNNEL_TYPE, tunencap);
- configs.put(ConfigConstants.DEST_IP, tunnelendpoint);
-
- configurationService.addPort(node, BRIDGE_NAME, TUNNEL_PORT_NAME, configs);
-
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * [[ Authors will Fill in the Copyright header ]]
- *
- * 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
- *
- * Authors : Brent Salisbury, Hugo Trippaers
- */
-package org.opendaylight.ovsdb.plugin;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.networkconfig.bridgedomain.ConfigConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OvsdbTestAddVlanIT extends OvsdbTestBase {
- private static final Logger logger = LoggerFactory
- .getLogger(OvsdbTestAddVlanIT.class);
-
- @Test
- public void addPortVlan() throws Throwable{
- TestObjects testObjects = getTestConnection();
- ConnectionService connectionService = testObjects.connectionService;
- Node node = testObjects.node;
-
- int vlanid = 100;
-
- /**
- * Create a Port with a user defined VLAN, and attach it to the specified bridge.
- *
- * Ex. ovs-vsctl add-port JUNIT_BRIDGE_TEST Jvlanvif0 tag=100
- * @param node Node serving this configuration service
- * @param bridgeDomainIdentifier String representation of a Bridge Domain
- * @param portIdentifier String representation of a user defined Port Name
- * @param vlanid Integer note: only one VID is accepted with tag=x method
- */
- ConfigurationService configurationService = testObjects.configurationService;
- Map<ConfigConstants, Object> configs = new HashMap<ConfigConstants, Object>();
- configs.put(ConfigConstants.TYPE, "VLAN");
- configs.put(ConfigConstants.VLAN, vlanid+"");
- configurationService.addPort(node, BRIDGE_NAME, TAGGED_PORT_NAME, configs);
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * [[ Authors will Fill in the Copyright header ]]
- *
- * 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
- *
- * Authors : Brent Salisbury, Hugo Trippaers
- */
-package org.opendaylight.ovsdb.plugin;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.networkconfig.bridgedomain.ConfigConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OvsdbTestBridgeConfigIT extends OvsdbTestBase {
- private static final Logger logger = LoggerFactory
- .getLogger(OvsdbTestSetManagerIT.class);
-
- @Test
- public void setBridgeConfig() throws Throwable{
- TestObjects testObjects = getTestConnection();
- ConnectionService connectionService = testObjects.connectionService;
- Node node = testObjects.node;
-
- Map<ConfigConstants, Object> configs = new HashMap<ConfigConstants, Object>();
-
- Map<String, String> exterIDPairs = new HashMap<String, String>();
- exterIDPairs.put("br-foo", "br-bar");
- //Will accept multiple array pairs. Pairs must be arrays not maps.
- configs.put(ConfigConstants.CUSTOM, exterIDPairs);
-
- ConfigurationService configurationService = testObjects.configurationService;
- configurationService.addBridgeDomainConfig(node, BRIDGE_NAME, configs);
- }
-
-}
\ No newline at end of file
+++ /dev/null
-/*
- * [[ Authors will Fill in the Copyright header ]]
- *
- * 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
- *
- * Authors : Brent Salisbury, Hugo Trippaers
- */
-package org.opendaylight.ovsdb.plugin;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.core.Node;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OvsdbTestDeletePortIT extends OvsdbTestBase {
- private static final Logger logger = LoggerFactory
- .getLogger(OvsdbTestAddPortIT.class);
-
- @Test
- public void deletePort() throws Throwable{
- TestObjects testObjects = getTestConnection();
- ConnectionService connectionService = testObjects.connectionService;
- Node node = testObjects.node;
-
- /**
- * Deletes an existing port from an existing bridge
- * Ex. ovs-vsctl del-port ovsbr0 tap0
- * @param node Node serving this configuration service
- * @param bridgeDomainIdentifier String representation of a Bridge Domain
- * @param portIdentifier String representation of a user defined Port Name
- */
- ConfigurationService configurationService = testObjects.configurationService;
- configurationService.deletePort(node, BRIDGE_NAME, PORT_NAME);
- }
-}
+++ /dev/null
-/*
- * [[ Authors will Fill in the Copyright header ]]
- *
- * 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
- *
- * Authors : Brent Salisbury, Hugo Trippaers
- */
-package org.opendaylight.ovsdb.plugin;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Properties;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.controller.sal.core.Node;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OvsdbTestGetBridgeDomainsIT extends OvsdbTestBase {
- private static final Logger logger = LoggerFactory
- .getLogger(OvsdbTestGetBridgeDomainsIT.class);
-
- private Properties props;
-
- @Before
- public void loadProps() throws IOException {
- props = loadProperties();
- }
-
- @Test
- public void getBridgeDomains() throws Throwable{
-
- TestObjects testObjects = getTestConnection();
- ConnectionService connectionService = testObjects.connectionService;
- InventoryService inventoryService = testObjects.inventoryService;
- Node node = testObjects.node;
-
- /**
- * List a Bridge Domain
- *
- * @param node Node serving this configuration service
- *
- */
- ConfigurationService configurationService = testObjects.configurationService;
- List<String> ls = configurationService.getBridgeDomains(node);
- }
-}
+++ /dev/null
-/*
- * [[ Authors will Fill in the Copyright header ]]
- *
- * 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
- *
- * Authors : Brent Salisbury, Hugo Trippaers
- */
-package org.opendaylight.ovsdb.plugin;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.networkconfig.bridgedomain.ConfigConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OvsdbTestSetOFControllerIT extends OvsdbTestBase {
- private static final Logger logger = LoggerFactory
- .getLogger(OvsdbTestSetOFControllerIT.class);
-
- @Test
- public void setController() throws Throwable{
- TestObjects testObjects = getTestConnection();
- Node node = testObjects.node;
-
- Map<ConfigConstants, Object> configs = new HashMap<ConfigConstants, Object>();
- configs.put(ConfigConstants.DEST_IP, "192.168.254.1");
- configs.put(ConfigConstants.CUSTOM, "6633");
- ConfigurationService configurationService = testObjects.configurationService;
- configurationService.setBridgeOFController(node, BRIDGE_NAME);
-
- }
-}
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService;
-public abstract class OvsdbTestBase {
+public abstract class PluginTestBase {
private final static String identifier = "TEST";
protected final static String BRIDGE_NAME = "JUNIT_TEST_BRIDGE";
- protected final static String PORT_NAME = "eth0";
- protected final static String TAGGED_PORT_NAME = "eth1";
+ protected final static String PORT_NAME = "test0";
+ protected final static String TAGGED_PORT_NAME = "test1";
protected final static String TUNNEL_PORT_NAME = "vxlan0";
protected final static String FAKE_IP = "192.168.254.254";
private final static String SERVER_IPADDRESS = "ovsdbserver.ipaddress";
}
public TestObjects getTestConnection() throws IOException {
+ if (OvsdbPluginTestSuiteIT.getTestObjects() != null) {
+ return OvsdbPluginTestSuiteIT.getTestObjects();
+ }
Properties props = loadProperties();
String address = props.getProperty(SERVER_IPADDRESS);
String port = props.getProperty(SERVER_PORT, DEFAULT_SERVER_PORT);
if (node == null) {
throw new IOException("Failed to connect to the ovsdb server");
}
+
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- } // TODO : Remove this once Select is operational
- return new TestObjects(connectionService, node, inventory, configurationService);
+ }
+ TestObjects testObject = new TestObjects(connectionService, node, inventory, configurationService);
+ OvsdbPluginTestSuiteIT.setTestObjects(testObject);
+ return testObject;
}
}
-/*\r
- * [[ Authors will Fill in the Copyright header ]]\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Authors : Brent Salisbury, Hugo Trippaers\r
- */\r
-package org.opendaylight.ovsdb.plugin;\r
-\r
-import org.junit.Test;\r
-import org.opendaylight.controller.sal.core.Node;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public class OvsdbTestAddBridgeIT extends OvsdbTestBase {\r
- private static final Logger logger = LoggerFactory\r
- .getLogger(OvsdbTestAddBridgeIT.class);\r
-\r
- @Test\r
- public void addBridge() throws Throwable{\r
-\r
- TestObjects testObjects = getTestConnection();\r
- ConnectionService connectionService = testObjects.connectionService;\r
- Node node = testObjects.node;\r
-\r
- /**\r
- * Create a Bridge Domain\r
- *\r
- * @param node Node serving this configuration service\r
- * @param bridgeDomainIdentifier String representation of a Bridge Domain\r
- */\r
- ConfigurationService configurationService = testObjects.configurationService;\r
- configurationService.createBridgeDomain(node, BRIDGE_NAME, null);\r
- }\r
-\r
-}\r
+/*
+ * [[ Authors will Fill in the Copyright header ]]
+ *
+ * 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
+ *
+ * Authors : Brent Salisbury, Hugo Trippaers
+ */
+package org.opendaylight.ovsdb.plugin;
+
+import org.junit.Test;
+import org.opendaylight.controller.sal.core.Node;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TearDown extends PluginTestBase {
+ private static final Logger logger = LoggerFactory
+ .getLogger(TearDown.class);
+
+ /**
+ * Final Cleanup. Delete the test Bridge.
+ */
+
+ @Test
+ public void deleteBridge() throws Throwable{
+
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
+ ConfigurationService configurationService = testObjects.configurationService;
+ configurationService.deleteBridgeDomain(node, BRIDGE_NAME);
+ }
+
+}