import com.google.common.util.concurrent.CheckedFuture;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Utility class to wrap mdsal transactions.
+ * Utility class for mdsal transactions.
*
* @author Sam Hague (shague@redhat.com)
*/
public class MdsalUtils {
private static final Logger LOG = LoggerFactory.getLogger(SouthboundIT.class);
- private static DataBroker databroker = null;
+ private DataBroker databroker = null;
/**
* Class constructor setting the data broker.
}
/**
- * Executes read transaction as a test2.
+ * Executes delete as a blocking transaction.
*
- * @param logicalDatastoreType {@link LogicalDatastoreType} from which read should occur
+ * @param store {@link LogicalDatastoreType} which should be modified
+ * @param path {@link InstanceIdentifier} to read from
+ * @param <D> the data object type
+ * @return the result of the request
+ */
+ public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean delete(
+ final LogicalDatastoreType store, final InstanceIdentifier<D> path) {
+ boolean result = false;
+ final WriteTransaction transaction = databroker.newWriteOnlyTransaction();
+ transaction.delete(store, path);
+ CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
+ try {
+ future.checkedGet();
+ result = true;
+ } catch (TransactionCommitFailedException e) {
+ LOG.warn("Failed to delete {} ", path, e);
+ }
+ return result;
+ }
+
+ /**
+ * Executes merge as a blocking transaction.
+ *
+ * @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified
* @param path {@link InstanceIdentifier} for path to read
* @param <D> the data object type
- * @return the data object requested
+ * @return the result of the request
*/
- public static <D extends org.opendaylight.yangtools.yang.binding.DataObject> D readTransaction(
- final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path) {
- D ret = null;
- final ReadOnlyTransaction readTx = databroker.newReadOnlyTransaction();
- Optional<D> optionalDataObject = Optional.absent();
- CheckedFuture<Optional<D>, ReadFailedException> submitFuture = readTx.read(logicalDatastoreType, path);
+ public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean merge(
+ final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path, D data) {
+ boolean result = false;
+ final WriteTransaction transaction = databroker.newWriteOnlyTransaction();
+ transaction.merge(logicalDatastoreType, path, data, true);
+ CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
try {
- optionalDataObject = submitFuture.checkedGet();
+ future.checkedGet();
+ result = true;
+ } catch (TransactionCommitFailedException e) {
+ LOG.warn("Failed to merge {} ", path, e);
+ }
+ return result;
+ }
+
+ /**
+ * Executes put as a blocking transaction.
+ *
+ * @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified
+ * @param path {@link InstanceIdentifier} for path to read
+ * @param <D> the data object type
+ * @return the result of the request
+ */
+ public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean put(
+ final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path, D data) {
+ boolean result = false;
+ final WriteTransaction transaction = databroker.newWriteOnlyTransaction();
+ transaction.put(logicalDatastoreType, path, data, true);
+ CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
+ try {
+ future.checkedGet();
+ result = true;
+ } catch (TransactionCommitFailedException e) {
+ LOG.warn("Failed to put {} ", path, e);
+ }
+ return result;
+ }
+
+ /**
+ * Executes read as a blocking transaction.
+ *
+ * @param store {@link LogicalDatastoreType} to read
+ * @param path {@link InstanceIdentifier} for path to read
+ * @param <D> the data object type
+ * @return the result as the data object requested
+ */
+ public <D extends org.opendaylight.yangtools.yang.binding.DataObject> D read(
+ final LogicalDatastoreType store, final InstanceIdentifier<D> path) {
+ D result = null;
+ final ReadOnlyTransaction transaction = databroker.newReadOnlyTransaction();
+ Optional<D> optionalDataObject;
+ CheckedFuture<Optional<D>, ReadFailedException> future = transaction.read(store, path);
+ try {
+ optionalDataObject = future.checkedGet();
if (optionalDataObject.isPresent()) {
- ret = optionalDataObject.get();
+ result = optionalDataObject.get();
} else {
LOG.debug("{}: Failed to read {}",
Thread.currentThread().getStackTrace()[1], path);
} catch (ReadFailedException e) {
LOG.warn("Failed to read {} ", path, e);
}
- readTx.close();
- return ret;
+ transaction.close();
+ return result;
}
-
}
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
-import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableBiMap;
import com.google.common.collect.ObjectArrays;
-import com.google.common.util.concurrent.CheckedFuture;
import java.net.InetAddress;
import java.net.UnknownHostException;
+import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
-import java.util.concurrent.ExecutionException;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.ovsdb.southbound.SouthboundConstants;
import org.opendaylight.ovsdb.southbound.SouthboundMapper;
import org.opendaylight.ovsdb.southbound.SouthboundProvider;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentationBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeProtocolBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntryBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.OpenvswitchOtherConfigs;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
@ExamReactorStrategy(PerClass.class)
public class SouthboundIT extends AbstractMdsalTestBase {
private static final Logger LOG = LoggerFactory.getLogger(SouthboundIT.class);
+ private static final int OVSDB_UPDATE_TIMEOUT = 1000;
private static DataBroker dataBroker = null;
private static String addressStr;
private static String portStr;
@Override
public Option[] getLoggingOptions() {
Option[] options = new Option[] {
- /*editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
+ editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
"log4j.logger.org.opendaylight.ovsdb",
- LogLevelOption.LogLevel.DEBUG.name()),*/
+ LogLevelOption.LogLevel.DEBUG.name()),
editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
"log4j.logger.org.opendaylight.ovsdb.southbound-impl",
LogLevelOption.LogLevel.DEBUG.name())
}
}
+ /**
+ * Test passive connection mode. The southbound starts in a listening mode waiting for connections on port
+ * 6640. This test will wait for incoming connections for {@link SouthboundITConstants.CONNECTION_INIT_TIMEOUT} ms.
+ *
+ * @throws InterruptedException
+ */
@Test
public void testPassiveNode() throws InterruptedException {
if (connectionType.equalsIgnoreCase(SouthboundITConstants.CONNECTION_TYPE_PASSIVE)) {
}
}
- @Test
- public void testAddRemoveOvsdbNode() throws InterruptedException {
- addNode(addressStr, portStr);
- Thread.sleep(1000);
- Node node = readNode(addressStr, portStr, LogicalDatastoreType.OPERATIONAL);
- assertNotNull(node);
- LOG.info("Connected node: {}", node);
- deleteNode(addressStr, portStr);
- Thread.sleep(1000);
- node = readNode(addressStr, portStr, LogicalDatastoreType.OPERATIONAL);
- Assume.assumeNotNull(node);//assertNull(node);
- }
-
private ConnectionInfo getConnectionInfo(String addressStr, String portStr) {
InetAddress inetAddress = null;
try {
IpAddress address = SouthboundMapper.createIpAddress(inetAddress);
PortNumber port = new PortNumber(Integer.parseInt(portStr));
+ LOG.info("connectionInfo: {}", new ConnectionInfoBuilder()
+ .setRemoteIp(address)
+ .setRemotePort(port)
+ .build());
return new ConnectionInfoBuilder()
.setRemoteIp(address)
.setRemotePort(port)
.build();
}
- private void addNode(String addressStr, String portStr) {
- ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portStr);
-
- final ReadWriteTransaction rwTx = dataBroker.newReadWriteTransaction();
- rwTx.put(LogicalDatastoreType.CONFIGURATION, SouthboundMapper.createInstanceIdentifier(connectionInfo),
- SouthboundMapper.createNode(connectionInfo));
- CheckedFuture<Void, TransactionCommitFailedException> commitFuture = rwTx.submit();
- try {
- commitFuture.checkedGet();
- } catch (TransactionCommitFailedException e) {
- fail("Failed transaction: " + rwTx + e);
- }
- }
-
- private Node readNode(String addressStr, String portStr, LogicalDatastoreType type) {
- ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portStr);
-
- final ReadWriteTransaction rwTx = dataBroker.newReadWriteTransaction();
- Optional<Node> node = Optional.absent();
- CheckedFuture<Optional<Node>, ReadFailedException> read;
- read = rwTx.read(type, SouthboundMapper.createInstanceIdentifier(connectionInfo));
- try {
- node = read.checkedGet();
- if (node.isPresent()) {
- return node.get();
- }
- } catch (ReadFailedException e) {
- fail("Failed transaction: " + rwTx + e);
- }
-
- return null;
- }
-
- private void deleteNode(String addressStr, String portStr) {
- ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portStr);
-
- final ReadWriteTransaction rwTx = dataBroker.newReadWriteTransaction();
- rwTx.delete(LogicalDatastoreType.CONFIGURATION, SouthboundMapper.createInstanceIdentifier(connectionInfo));
- CheckedFuture<Void, TransactionCommitFailedException> commitFuture = rwTx.submit();
- try {
- commitFuture.get();
- } catch (ExecutionException | InterruptedException e) {
- fail("Failed transaction: " + rwTx + e);
- }
- }
-
- private NetworkTopology readNetworkTopology(LogicalDatastoreType type) {
- ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portStr);
-
- final ReadWriteTransaction rwTx = dataBroker.newReadWriteTransaction();
- Optional<NetworkTopology> optional = Optional.absent();
- CheckedFuture<Optional<NetworkTopology>, ReadFailedException> read;
- read = rwTx.read(type, InstanceIdentifier.create(NetworkTopology.class));
- try {
- optional = read.checkedGet();
- if (optional.isPresent()) {
- return optional.get();
- }
- } catch (ReadFailedException e) {
- fail("Failed transaction: " + rwTx + e);
- }
-
- return null;
+ private String connectionInfoToString(ConnectionInfo connectionInfo) {
+ return new String(connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
}
@Test
public void testNetworkTopology() throws InterruptedException {
- NetworkTopology networkTopology = MdsalUtils.readTransaction(LogicalDatastoreType.CONFIGURATION,
+ NetworkTopology networkTopology = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION,
InstanceIdentifier.create(NetworkTopology.class));
Assert.assertNotNull("NetworkTopology could not be found in " + LogicalDatastoreType.CONFIGURATION,
networkTopology);
- networkTopology = MdsalUtils.readTransaction(LogicalDatastoreType.OPERATIONAL,
+ networkTopology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL,
InstanceIdentifier.create(NetworkTopology.class));
Assert.assertNotNull("NetworkTopology could not be found in " + LogicalDatastoreType.OPERATIONAL,
networkTopology);
.create(NetworkTopology.class)
.child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID));
- Topology topology = MdsalUtils.readTransaction(LogicalDatastoreType.CONFIGURATION, path);
+ Topology topology = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path);
Assert.assertNotNull("Topology could not be found in " + LogicalDatastoreType.CONFIGURATION,
topology);
- topology = MdsalUtils.readTransaction(LogicalDatastoreType.OPERATIONAL, path);
+ topology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, path);
Assert.assertNotNull("Topology could not be found in " + LogicalDatastoreType.OPERATIONAL,
topology);
}
- public Node connectNode(String addressStr, String portStr) throws InterruptedException {
- addNode(addressStr, portStr);
- Thread.sleep(5000);
- Node node = readNode(addressStr, portStr, LogicalDatastoreType.OPERATIONAL);
- assertNotNull(node);
- LOG.info("Connected node: {}", node);
+ private boolean addOvsdbNode(ConnectionInfo connectionInfo) throws InterruptedException {
+ boolean result = mdsalUtils.put(LogicalDatastoreType.CONFIGURATION,
+ SouthboundMapper.createInstanceIdentifier(connectionInfo),
+ SouthboundMapper.createNode(connectionInfo));
+ Thread.sleep(OVSDB_UPDATE_TIMEOUT);
+ return result;
+ }
+
+ private Node getOvsdbNode(ConnectionInfo connectionInfo) {
+ Node node = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL,
+ SouthboundMapper.createInstanceIdentifier(connectionInfo));
+ return node;
+ }
+
+ private boolean deleteOvsdbNode(ConnectionInfo connectionInfo) throws InterruptedException {
+ boolean result = mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION,
+ SouthboundMapper.createInstanceIdentifier(connectionInfo));
+ Thread.sleep(OVSDB_UPDATE_TIMEOUT);
+ return result;
+ }
+
+ private Node connectOvsdbNode(ConnectionInfo connectionInfo) throws InterruptedException {
+ Assert.assertTrue(addOvsdbNode(connectionInfo));
+ Node node = getOvsdbNode(connectionInfo);
+ Assert.assertNotNull(node);
+ LOG.info("Connected to {}", connectionInfoToString(connectionInfo));
return node;
}
- public void disconnectNode(String addressStr, String portStr) throws InterruptedException {
- deleteNode(addressStr, portStr);
- Thread.sleep(5000);
- Node node = readNode(addressStr, portStr, LogicalDatastoreType.OPERATIONAL);
- Assume.assumeNotNull(node);//Assert.assertNull("node was found in operational", node);
+ private boolean disconnectOvsdbNode(ConnectionInfo connectionInfo) throws InterruptedException {
+ Assert.assertTrue(deleteOvsdbNode(connectionInfo));
+ Node node = getOvsdbNode(connectionInfo);
+ //Assert.assertNull(node);
+ Assume.assumeNotNull(node);
+ LOG.info("Disonnected from {}", connectionInfoToString(connectionInfo));
+ return true;
+ }
+
+ @Test
+ public void testAddDeleteOvsdbNode() throws InterruptedException {
+ ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portStr);
+ Node ovsdbNode = connectOvsdbNode(connectionInfo);
+ //Assert.assertFalse(disconnectOvsdbNode(connectionInfo));
+ Assume.assumeTrue(disconnectOvsdbNode(connectionInfo));
}
@Test
public void testOpenVSwitchOtherConfig() throws InterruptedException {
- Node node = connectNode(addressStr, portStr);
- Thread.sleep(5000);
- OvsdbNodeAugmentation ovsdbNodeAugmentation = node.getAugmentation(OvsdbNodeAugmentation.class);
+ ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portStr);
+ Node ovsdbNode = connectOvsdbNode(connectionInfo);
+ OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
assertNotNull(ovsdbNodeAugmentation);
List<OpenvswitchOtherConfigs> otherConfigsList = ovsdbNodeAugmentation.getOpenvswitchOtherConfigs();
if (otherConfigsList != null) {
if (otherConfig.getOtherConfigKey().equals("local_ip")) {
LOG.info("local_ip: {}", otherConfig.getOtherConfigValue());
break;
+ } else {
+ LOG.info("other_config {}:{}", otherConfig.getOtherConfigKey(), otherConfig.getOtherConfigValue());
}
}
+ } else {
+ LOG.info("other_config is not present");
}
- Thread.sleep(5000);
- disconnectNode(addressStr, portStr);
+ //Assert.assertFalse(disconnectOvsdbNode(connectionInfo));
+ Assume.assumeTrue(disconnectOvsdbNode(connectionInfo));
+ }
+
+ private void setManagedBy(OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder,
+ ConnectionInfo connectionInfo) {
+ InstanceIdentifier<Node> connectionNodePath = SouthboundMapper.createInstanceIdentifier(connectionInfo);
+ ovsdbBridgeAugmentationBuilder.setManagedBy(new OvsdbNodeRef(connectionNodePath));
+ }
+
+ private List<ProtocolEntry> createMdsalProtocols() {
+ List<ProtocolEntry> protocolList = new ArrayList<ProtocolEntry>();
+ ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
+ SouthboundConstants.OVSDB_PROTOCOL_MAP.inverse();
+ protocolList.add(new ProtocolEntryBuilder().
+ setProtocol((Class<? extends OvsdbBridgeProtocolBase>) mapper.get("OpenFlow13")).build());
+ return protocolList;
+ }
+
+ private boolean addBridge(ConnectionInfo connectionInfo, String bridgeName) throws InterruptedException {
+ //Node node = SouthboundMapper.createNode(connectionInfo);
+ NodeBuilder bridgeNodeBuilder = new NodeBuilder();
+ InstanceIdentifier<Node> bridgeIid =
+ SouthboundMapper.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName));
+ NodeId bridgeNodeId = SouthboundMapper.createManagedNodeId(bridgeIid);
+ bridgeNodeBuilder.setNodeId(bridgeNodeId);
+ OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder = new OvsdbBridgeAugmentationBuilder();
+ ovsdbBridgeAugmentationBuilder.setBridgeName(new OvsdbBridgeName(bridgeName));
+ ovsdbBridgeAugmentationBuilder.setProtocolEntry(createMdsalProtocols());
+ ovsdbBridgeAugmentationBuilder.setFailMode(
+ SouthboundConstants.OVSDB_FAIL_MODE_MAP.inverse().get("secure"));
+ setManagedBy(ovsdbBridgeAugmentationBuilder, connectionInfo);
+ bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
+
+ LOG.debug("Built with the intent to store bridge data {}",
+ ovsdbBridgeAugmentationBuilder.toString());
+
+ boolean result = mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
+ bridgeIid, bridgeNodeBuilder.build());
+ Thread.sleep(OVSDB_UPDATE_TIMEOUT);
+ return result;
+ }
+
+ private OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo) {
+ InstanceIdentifier<Node> bridgeIid =
+ SouthboundMapper.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName("brtest"));
+ Node bridgeNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, bridgeIid);
+ Assert.assertNotNull(bridgeNode);
+ OvsdbBridgeAugmentation ovsdbBridgeAugmentation = bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class);
+ Assert.assertNotNull(ovsdbBridgeAugmentation);
+ return ovsdbBridgeAugmentation;
+ }
+
+ private boolean deleteBridge(ConnectionInfo connectionInfo) throws InterruptedException {
+ boolean result = mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION,
+ SouthboundMapper.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName("brtest")));
+ Thread.sleep(OVSDB_UPDATE_TIMEOUT);
+ return result;
+ }
+
+ @Test
+ public void testAddDeleteBridge() throws InterruptedException {
+ ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portStr);
+ Node ovsdbNode = connectOvsdbNode(connectionInfo);
+
+ Assert.assertTrue(addBridge(connectionInfo, "brtest"));
+ OvsdbBridgeAugmentation bridge = getBridge(connectionInfo);
+ Assert.assertNotNull(bridge);
+ LOG.info("bridge: {}", bridge);
+
+ Assert.assertTrue(deleteBridge(connectionInfo));
+
+ //Assert.assertFalse(disconnectOvsdbNode(connectionInfo));
+ Assume.assumeTrue(disconnectOvsdbNode(connectionInfo));
}
/**