- LOG.warn("testNetWithTwoVms: starting test");
- ConnectionInfo connectionInfo = SouthboundUtils.getConnectionInfo(addressStr, portStr);
- NodeInfo nodeInfo = itUtils.createNodeInfo(connectionInfo, null);
- nodeInfo.connect();
- LOG.warn("testNetWithTwoVms: should be connected: {}", nodeInfo.ovsdbNode.getNodeId());
-
- // Create the objects
- NeutronNetItUtil net = new NeutronNetItUtil(southboundUtils, UUID.randomUUID().toString());
- net.create();
- net.createPort(nodeInfo.bridgeNode, "dhcp", "network:dhcp");
- net.createPort(nodeInfo.bridgeNode, "vm1");
- net.createPort(nodeInfo.bridgeNode, "vm2");
-
-
- // Check flows created for all ports
- for (int i = 1; i <= net.neutronPorts.size(); i++) {
- nvItUtils.verifyFlow(nodeInfo.datapathId, "DropFilter_" + i,
- pipelineOrchestrator.getTable(Service.CLASSIFIER));
- nvItUtils.verifyFlow(nodeInfo.datapathId, "LocalMac_" + net.segId + "_" + i + "_" + net.macFor(i),
- pipelineOrchestrator.getTable(Service.CLASSIFIER));
- nvItUtils.verifyFlow(nodeInfo.datapathId, "ArpResponder_" + net.segId + "_" + net.ipFor(i),
- pipelineOrchestrator.getTable(Service.ARP_RESPONDER));
- nvItUtils.verifyFlow(nodeInfo.datapathId, "UcastOut_" + net.segId + "_" + i + "_" + net.macFor(i),
- pipelineOrchestrator.getTable(Service.L2_FORWARDING));
- }
+ LOG.warn("testNeutronNet: starting test");
+ try(DockerOvs ovs = new DockerOvs()) {
+ ConnectionInfo connectionInfo = SouthboundUtils.getConnectionInfo(ovs.getOvsdbAddress(0), ovs.getOvsdbPort(0));
+ NodeInfo nodeInfo = itUtils.createNodeInfo(connectionInfo, null);
+ nodeInfo.connect();
+ LOG.warn("testNeutronNet: should be connected: {}", nodeInfo.ovsdbNode.getNodeId());
+
+ // Create the objects
+ NeutronNetItUtil net = new NeutronNetItUtil(southboundUtils, UUID.randomUUID().toString());
+ net.create();
+ net.createPort(nodeInfo.bridgeNode, "dhcp", "network:dhcp");
+ net.createPort(nodeInfo.bridgeNode, "vm1");
+ net.createPort(nodeInfo.bridgeNode, "vm2");
+
+
+ // Check flows created for all ports
+ for (int i = 1; i <= net.neutronPorts.size(); i++) {
+ nvItUtils.verifyFlow(nodeInfo.datapathId, "DropFilter_" + i,
+ pipelineOrchestrator.getTable(Service.CLASSIFIER));
+ nvItUtils.verifyFlow(nodeInfo.datapathId, "LocalMac_" + net.segId + "_" + i + "_" + net.macFor(i),
+ pipelineOrchestrator.getTable(Service.CLASSIFIER));
+ nvItUtils.verifyFlow(nodeInfo.datapathId, "ArpResponder_" + net.segId + "_" + net.ipFor(i),
+ pipelineOrchestrator.getTable(Service.ARP_RESPONDER));
+ nvItUtils.verifyFlow(nodeInfo.datapathId, "UcastOut_" + net.segId + "_" + i + "_" + net.macFor(i),
+ pipelineOrchestrator.getTable(Service.L2_FORWARDING));
+ }