2 * [[ Authors will Fill in the Copyright header ]]
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 * Authors : Brent Salisbury, Hugo Trippaers
10 package org.opendaylight.ovsdb.plugin;
12 import org.junit.Test;
13 import org.opendaylight.controller.sal.core.Node;
14 import org.opendaylight.controller.sal.core.NodeConnector;
15 import org.opendaylight.controller.sal.connection.ConnectionConstants;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
19 import java.util.HashMap;
22 public class OvsdbTestDeletePortIT {
23 private static final Logger logger = LoggerFactory
24 .getLogger(OvsdbTestAddPortIT.class);
27 public void deletePort() throws Throwable{
28 Node.NodeIDType.registerIDType("OVS", String.class);
29 NodeConnector.NodeConnectorIDType.registerIDType("OVS", String.class, "OVS");
31 ConnectionService connectionService = new ConnectionService();
32 connectionService.init();
33 String identifier = "TEST";
34 Map<ConnectionConstants, String> params = new HashMap<ConnectionConstants, String>();
35 params.put(ConnectionConstants.ADDRESS, "10.12.0.78");
36 params.put(ConnectionConstants.PORT, "6634");
38 Node node = connectionService.connect(identifier, params);
40 logger.error("Could not connect to ovsdb server");
44 * Deletes an existing port from an existing bridge
45 * Ex. ovs-vsctl del-port ovsbr0 tap0
46 * @param node Node serving this configuration service
47 * @param bridgeDomainIdentifier String representation of a Bridge Domain
48 * @param portIdentifier String representation of a user defined Port Name
50 ConfigurationService configurationService = new ConfigurationService();
51 configurationService.setConnectionServiceInternal(connectionService);
52 configurationService.deletePort(node, "ovsbr0", "tap2");