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);
@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");
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
- 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
*/
ConfigurationService configurationService = new ConfigurationService();
configurationService.setConnectionServiceInternal(connectionService);
- configurationService.deletePort(node, "ovsbr0", "tap2");
+ configurationService.deletePort(node, BRIDGE_NAME, PORT_NAME);
}
}