*/
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.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.connection.ConnectionConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.HashMap;
-import java.util.Map;
-
-public class OvsdbTestDeletePortIT {
+public class OvsdbTestDeletePortIT 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 deletePort() throws Throwable{
- Node.NodeIDType.registerIDType("OVS", String.class);
- NodeConnector.NodeConnectorIDType.registerIDType("OVS", String.class, "OVS");
-
- ConnectionService connectionService = new ConnectionService();
- connectionService.init();
- String identifier = "TEST";
- Map<ConnectionConstants, String> params = new HashMap<ConnectionConstants, String>();
- params.put(ConnectionConstants.ADDRESS, "10.12.0.78");
- params.put(ConnectionConstants.PORT, "6634");
-
- Node node = connectionService.connect(identifier, params);
- if(node == null){
- logger.error("Could not connect to ovsdb server");
- return;
- }
- /**
- * 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
- */
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
+
+
ConfigurationService configurationService = new ConfigurationService();
configurationService.setConnectionServiceInternal(connectionService);
configurationService.deletePort(node, "ovsbr0", "tap2");