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.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey;
}
}
+ @Test
+ public void testGetOvsdbNodes() throws InterruptedException {
+ ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portStr);
+ connectOvsdbNode(connectionInfo);
+ InstanceIdentifier<Topology> topologyPath = InstanceIdentifier
+ .create(NetworkTopology.class)
+ .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID));
+
+ Topology topology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, topologyPath);
+ Assert.assertEquals("There should only be one node in the topology", 1, topology.getNode().size());
+ InstanceIdentifier<Node> expectedNodeIid = SouthboundMapper.createInstanceIdentifier(connectionInfo);
+ Node node = topology.getNode().iterator().next();
+ NodeId expectedNodeId = expectedNodeIid.firstKeyOf(Node.class, NodeKey.class).getNodeId();
+ Assert.assertEquals(expectedNodeId, node.getNodeId());
+ Assert.assertTrue(disconnectOvsdbNode(connectionInfo));
+ }
+
/**
* isBundleReady is used to check if the requested bundle is Active
*/