2 * Copyright © 2020 Orange Labs, Inc. and others. All rights reserved.
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 package org.opendaylight.transportpce.networkmodel.util;
10 import static org.hamcrest.CoreMatchers.containsString;
11 import static org.hamcrest.CoreMatchers.either;
12 import static org.hamcrest.CoreMatchers.hasItem;
13 import static org.hamcrest.CoreMatchers.hasItems;
14 import static org.hamcrest.CoreMatchers.not;
15 import static org.hamcrest.MatcherAssert.assertThat;
16 import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
17 import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
18 import static org.junit.jupiter.api.Assertions.assertEquals;
19 import static org.junit.jupiter.api.Assertions.assertNotNull;
20 import static org.junit.jupiter.api.Assertions.assertNull;
21 import static org.junit.jupiter.api.Assertions.assertTrue;
22 import static org.junit.jupiter.api.Assertions.fail;
24 import com.google.gson.stream.JsonReader;
25 import java.io.FileReader;
26 import java.io.IOException;
27 import java.io.Reader;
28 import java.nio.charset.StandardCharsets;
29 import java.util.ArrayList;
30 import java.util.HashMap;
31 import java.util.List;
33 import java.util.stream.Collectors;
34 import org.junit.jupiter.api.Test;
35 import org.opendaylight.transportpce.networkmodel.dto.TopologyShard;
36 import org.opendaylight.transportpce.networkmodel.util.test.JsonUtil;
37 import org.opendaylight.transportpce.networkmodel.util.test.NetworkmodelTestUtil;
38 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev220630.OtnLinkType;
39 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.Network;
40 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mapping.Mapping;
41 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mapping.MappingBuilder;
42 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mapping.MappingKey;
43 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.network.Nodes;
44 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.network.NodesBuilder;
45 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.network.nodes.NodeInfoBuilder;
46 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Node1;
47 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.TerminationPoint1;
48 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.NodeTypes;
49 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev201211.xpdr.odu.switching.pools.OduSwitchingPools;
50 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev201211.xpdr.odu.switching.pools.odu.switching.pools.NonBlockingList;
51 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.OpenroadmLinkType;
52 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.OpenroadmNodeType;
53 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.OpenroadmTpType;
54 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.xpdr.tp.supported.interfaces.SupportedInterfaceCapability;
55 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev210924.ODU2;
56 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev210924.ODU2e;
57 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev210924.ODU4;
58 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210.Link1;
59 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210.networks.network.node.SwitchingPools;
60 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.If100GE;
61 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.If100GEODU4;
62 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.If10GE;
63 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.If10GEODU2;
64 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.If10GEODU2e;
65 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.IfOCH;
66 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.IfOCHOTU4ODU4;
67 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.Node;
68 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.node.SupportingNode;
69 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.TpId;
70 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link;
71 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.LinkBuilder;
72 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.node.TerminationPoint;
73 import org.opendaylight.yangtools.yang.common.Uint16;
74 import org.opendaylight.yangtools.yang.common.Uint32;
75 import org.slf4j.Logger;
76 import org.slf4j.LoggerFactory;
78 public class OpenRoadmOtnTopologyTest {
80 private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmOtnTopologyTest.class);
81 private Nodes portMappingTpdr;
82 private Nodes portMappingSpdr;
83 private Nodes portMappingBad;
85 public OpenRoadmOtnTopologyTest() {
86 try (Reader reader = new FileReader("src/test/resources/portMapping.json", StandardCharsets.UTF_8);
87 JsonReader portMappingReader = new JsonReader(reader)) {
88 Network portMapping = (Network) JsonUtil.getInstance()
89 .getDataObjectFromJson(portMappingReader, Network.QNAME);
90 for (Nodes nodes : portMapping.nonnullNodes().values()) {
91 if (nodes.getNodeId().equals("XPDR-A1")) {
92 this.portMappingTpdr = nodes;
94 this.portMappingSpdr = nodes;
97 Map<MappingKey,Mapping> mappingList = new HashMap<>();
98 Mapping mapping = new MappingBuilder().setLogicalConnectionPoint("XPDR0-NETWORK0").build();
99 mappingList.put(mapping.key(),mapping);
100 this.portMappingBad = new NodesBuilder()
101 .setNodeId(this.portMappingTpdr.getNodeId())
102 .setNodeInfo(new NodeInfoBuilder(this.portMappingTpdr.getNodeInfo()).setNodeType(NodeTypes.Ila).build())
103 .setMapping(mappingList)
105 LOG.info("tpdr portMapping = {}", this.portMappingTpdr.toString());
106 LOG.info("spdr portMapping = {}", this.portMappingSpdr.toString());
107 LOG.info("ila portMapping = {}", this.portMappingBad.toString());
108 } catch (IOException e) {
109 LOG.error("Cannot init OpenRoadmOtnTopologyTest ", e);
110 fail("Cannot init OpenRoadmOtnTopologyTest ");
115 void createTopologyShardForTpdrTest() {
116 TopologyShard topologyShard = OpenRoadmOtnTopology.createTopologyShard(this.portMappingTpdr);
117 assertNotNull(topologyShard, "TopologyShard should never be null");
118 assertEquals(1, topologyShard.getNodes().size(), "Should contain a single node");
119 assertEquals(0, topologyShard.getLinks().size(), "Should contain no link");
120 Node node = topologyShard.getNodes().get(0);
121 assertEquals("XPDR-A1-XPDR1", node.getNodeId().getValue());
122 // tests supporting nodes
123 List<SupportingNode> supportingNodes = node.nonnullSupportingNode().values().stream()
124 .sorted((sn1, sn2) -> sn1.getNetworkRef().getValue().compareTo(sn2.getNetworkRef().getValue()))
125 .collect(Collectors.toList());
126 assertEquals(3, supportingNodes.size(),"Should contain 3 supporting nodes");
127 assertEquals(supportingNodes.get(0).getNetworkRef().getValue(), "clli-network");
128 assertEquals(supportingNodes.get(0).getNodeRef().getValue(), "NodeA");
129 assertEquals(supportingNodes.get(1).getNetworkRef().getValue(), "openroadm-network");
130 assertEquals(supportingNodes.get(1).getNodeRef().getValue(), "XPDR-A1");
131 assertEquals(supportingNodes.get(2).getNetworkRef().getValue(), "openroadm-topology");
132 assertEquals(supportingNodes.get(2).getNodeRef().getValue(), "XPDR-A1-XPDR1");
133 assertEquals(OpenroadmNodeType.TPDR, node.augmentation(Node1.class).getNodeType());
137 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210.Node1.class)
138 .getXpdrAttributes().getXpdrNumber());
140 List<TerminationPoint> tps = node.augmentation(
141 org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class)
142 .nonnullTerminationPoint().values().stream()
143 .sorted((tp1, tp2) -> tp1.getTpId().getValue().compareTo(tp2.getTpId().getValue()))
144 .collect(Collectors.toList());
145 assertEquals(4, tps.size(), "node should contain 4 TPs");
147 assertEquals("XPDR1-CLIENT1", tps.get(0).getTpId().getValue());
150 tps.get(0).augmentation(
151 TerminationPoint1.class).getAssociatedConnectionMapTp().iterator().next().getValue());
154 tps.get(0).augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
155 .TerminationPoint1.class)
156 .getTpSupportedInterfaces().getSupportedInterfaceCapability().size(),
157 "only If100GE interface capabitily expected");
160 tps.get(0).augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
161 .TerminationPoint1.class)
162 .getTpSupportedInterfaces().nonnullSupportedInterfaceCapability().values().stream().findFirst()
163 .get().getIfCapType());
164 assertEquals(OpenroadmTpType.XPONDERCLIENT,tps.get(0).augmentation(TerminationPoint1.class).getTpType(),
165 "first TP must be of type client");
167 assertEquals("XPDR1-NETWORK1", tps.get(2).getTpId().getValue());
168 assertEquals("XPDR1-CLIENT1", tps.get(2).augmentation(TerminationPoint1.class)
169 .getAssociatedConnectionMapTp().iterator().next().getValue());
172 tps.get(2).augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
173 .TerminationPoint1.class)
174 .getTpSupportedInterfaces().getSupportedInterfaceCapability().size());
177 tps.get(2).augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
178 .TerminationPoint1.class)
179 .getTpSupportedInterfaces().getSupportedInterfaceCapability().values().stream().findFirst().get()
182 tps.get(2).augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
183 .TerminationPoint1.class)
184 .getXpdrTpPortConnectionAttributes().getRate(),
185 "the rate should be null");
186 assertEquals(OpenroadmTpType.XPONDERNETWORK,tps.get(2).augmentation(TerminationPoint1.class).getTpType(),
187 "third TP must be of type network");
191 void createTopologyShardForSpdrTest() {
192 TopologyShard topologyShard = OpenRoadmOtnTopology.createTopologyShard(this.portMappingSpdr);
193 assertNotNull(topologyShard, "TopologyShard should never be null");
194 assertEquals(2, topologyShard.getNodes().size(), "Should contain two nodes");
195 assertEquals(0, topologyShard.getLinks().size(), "Should contain no link");
196 List<Node> nodes = topologyShard.getNodes().stream()
197 .sorted((n1, n2) -> n1.getNodeId().getValue().compareTo(n2.getNodeId().getValue()))
198 .collect(Collectors.toList());
199 for (Node node : nodes) {
205 void createOtnLinksForOTU4NormalTest() {
206 String nodeA = "SPDRA";
207 String tpA = "XPDR1-NETWORK1";
208 String nodeZ = "SPDRZ";
209 String tpZ = "XPDR1-NETWORK1";
210 List<Link> links = OpenRoadmOtnTopology.createOtnLinks(nodeA, tpA, nodeZ, tpZ, OtnLinkType.OTU4).getLinks();
211 assertEquals(2, links.size(), "2 OTU4 links should have been created");
212 List<Link> sortedLinks = links.stream()
213 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
214 .collect(Collectors.toList());
216 "OTU4-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1",
217 sortedLinks.get(0).getLinkId().getValue(),
218 "name of OTU4 linkid AZ");
220 "OTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
221 sortedLinks.get(1).getLinkId().getValue(),
222 "name of OTU4 linkid ZA");
223 assertEquals("SPDRA-XPDR1", sortedLinks.get(0).getSource().getSourceNode().getValue());
224 assertEquals("SPDRZ-XPDR1", sortedLinks.get(0).getDestination().getDestNode().getValue());
225 assertEquals("SPDRZ-XPDR1", sortedLinks.get(1).getSource().getSourceNode().getValue());
226 assertEquals("SPDRA-XPDR1", sortedLinks.get(1).getDestination().getDestNode().getValue());
228 Uint32.valueOf(100000),
229 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth(),
230 "available BW at OTU4 creation should be 100G (100000)");
233 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth(),
234 "used BW at OTU4 creation should be 0");
236 OpenroadmLinkType.OTNLINK,
237 sortedLinks.get(0).augmentation(
238 org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Link1.class)
241 "OTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
242 sortedLinks.get(0).augmentation(
243 org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Link1.class)
244 .getOppositeLink().getValue(),
245 "opposite link must be present");
248 sortedLinks.get(0).augmentation(
249 org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev220630.Link1.class)
251 "otn link type should be OTU4");
255 void createOtnLinksForNotManagedOtnlinktypeTest() {
256 String nodeA = "SPDRA";
257 String tpA = "XPDR1-NETWORK1";
258 String nodeZ = "SPDRZ";
259 String tpZ = "XPDR1-NETWORK1";
260 TopologyShard topoShard = OpenRoadmOtnTopology.createOtnLinks(nodeA, tpA, nodeZ, tpZ, OtnLinkType.ODU0);
261 assertNotNull(topoShard, "TopologyShard should never be null");
262 assertNull(topoShard.getNodes(), "TopologyShard should not contain any node");
263 assertNull(topoShard.getLinks(), "TopologyShard should not contain any link");
267 void createOtnLinksForODU4NormalTest() {
268 TopologyShard topoShard = OpenRoadmOtnTopology
270 NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(100000)),
271 NetworkmodelTestUtil.createTpList(false), OtnLinkType.ODTU4);
272 assertNotNull(topoShard, "TopologyShard should never be null");
273 assertNull(topoShard.getNodes(), "list of nodes should be null");
274 List<Link> sortedLinks = topoShard.getLinks().stream()
275 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
276 .collect(Collectors.toList());
277 assertEquals(4, sortedLinks.size(), "list of links should contain 4 links");
278 assertTrue(sortedLinks.get(2).getLinkId().getValue().startsWith("OTU4-"), "link 3 should be of type OTU4");
281 sortedLinks.get(2).augmentation(Link1.class).getAvailableBandwidth(),
282 "after odu4 creation, available BW of supported OTU4 should be 0");
284 Uint32.valueOf(100000),
285 sortedLinks.get(2).augmentation(Link1.class).getUsedBandwidth(),
286 "after odu4 creation, used BW of supported OTU4 should be 100 000");
288 "ODTU4-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1",
289 sortedLinks.get(0).getLinkId().getValue());
291 "ODTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
292 sortedLinks.get(1).getLinkId().getValue());
293 assertEquals("SPDRA-XPDR1", sortedLinks.get(0).getSource().getSourceNode().getValue());
294 assertEquals("SPDRZ-XPDR1", sortedLinks.get(0).getDestination().getDestNode().getValue());
295 assertEquals("SPDRZ-XPDR1", sortedLinks.get(1).getSource().getSourceNode().getValue());
296 assertEquals("SPDRA-XPDR1", sortedLinks.get(1).getDestination().getDestNode().getValue());
298 Uint32.valueOf(100000),
299 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth(),
300 "after odu4 creation, its available BW should be 100 000");
303 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth(),
304 "after odu4 creation, its used BW should be 0");
306 OpenroadmLinkType.OTNLINK,
307 sortedLinks.get(0).augmentation(
308 org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Link1.class)
311 "ODTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
312 sortedLinks.get(0).augmentation(
313 org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Link1.class)
314 .getOppositeLink().getValue(),
315 "opposite link must be present");
318 sortedLinks.get(0).augmentation(
319 org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev220630.Link1.class)
321 "otn link type should be ODTU4");
323 assertEquals(2, topoShard.getTps().size(), "list of TPs should contain 2 updated TPs");
325 topoShard.getTps().get(0).augmentation(
326 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
327 .TerminationPoint1.class)
328 .getXpdrTpPortConnectionAttributes().getTsPool(),
329 "after ODU4 creation, its termination point should contain a TsPool list");
332 topoShard.getTps().get(0).augmentation(
333 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
334 .TerminationPoint1.class)
335 .getXpdrTpPortConnectionAttributes().getTsPool().size(),
336 "Ts pool list should be full, with 80 trib slots");
338 topoShard.getTps().get(0).augmentation(
339 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
340 .TerminationPoint1.class)
341 .getXpdrTpPortConnectionAttributes().getOdtuTpnPool().values().stream().findFirst().get().getTpnPool(),
342 "after ODU4 creation, its termination point should contain a TpnPool list");
345 topoShard.getTps().get(0).augmentation(
346 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
347 .TerminationPoint1.class)
348 .getXpdrTpPortConnectionAttributes().getOdtuTpnPool().values().stream().findFirst().get().getTpnPool()
350 "Tpn pool list should be full, with 80 trib ports");
354 void createOtnLinksForODU4WhenOTU4HaveBadBWParamsTest() {
355 List<Link> otu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(100000));
356 List<Link> otu4LinksWithBadBWParam = new ArrayList<>();
357 for (Link link : otu4Links) {
358 otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
360 TopologyShard topoShard = OpenRoadmOtnTopology.createOtnLinks(
361 otu4LinksWithBadBWParam,
362 NetworkmodelTestUtil.createTpList(false),
364 assertNotNull(topoShard, "TopologyShard should never be null");
365 assertNull(topoShard.getNodes(), "list of nodes should be null");
366 assertNull(topoShard.getLinks(), "list of links should be null");
367 assertNull(topoShard.getTps(), "list of tps should be null");
369 otu4LinksWithBadBWParam.clear();
370 topoShard = OpenRoadmOtnTopology.createOtnLinks(
371 NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(99000)),
372 NetworkmodelTestUtil.createTpList(false),
374 assertNull(topoShard.getNodes(), "list of nodes should be null");
375 assertNull(topoShard.getLinks(), "list of links should be null");
376 assertNull(topoShard.getTps(), "list of tps should be null");
380 void deleteOtnLinksForODU4NormalTest() {
381 TopologyShard topoShard = OpenRoadmOtnTopology.deleteOtnLinks(
382 NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(0)),
383 NetworkmodelTestUtil.createTpList(true),
385 assertNotNull(topoShard, "TopologyShard should never be null");
386 assertEquals(2, topoShard.getLinks().size(), "list of links should contain 2 links");
388 Uint32.valueOf(100000),
389 topoShard.getLinks().get(0).augmentation(Link1.class).getAvailableBandwidth(),
390 "after ODU4 deletion, available BW of supported OTU4 should be 100 000");
393 topoShard.getLinks().get(0).augmentation(Link1.class).getUsedBandwidth(),
394 "after ODU4 deletion, used BW of supported OTU4 should be 0");
396 assertEquals(2, topoShard.getTps().size(), "list of TPs should contain 2 updated TPs");
398 topoShard.getTps().get(0).augmentation(
399 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
400 .TerminationPoint1.class)
401 .getXpdrTpPortConnectionAttributes().getTsPool(),
402 "after ODU4 deletion, its termination points should not contain any TsPool list");
404 topoShard.getTps().get(0).augmentation(
405 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
406 .TerminationPoint1.class)
407 .getXpdrTpPortConnectionAttributes().getOdtuTpnPool(),
408 "after ODU4 deletion, its termination points should not contain any TpnPool list");
412 void deleteOtnLinksForODU4WhenOTU4HaveBadBWParamsTest() {
413 List<Link> otu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(0));
414 List<Link> otu4LinksWithBadBWParam = new ArrayList<>();
415 for (Link link : otu4Links) {
416 otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
418 TopologyShard topoShard = OpenRoadmOtnTopology.deleteOtnLinks(
419 otu4LinksWithBadBWParam,
420 NetworkmodelTestUtil.createTpList(true),
422 assertNotNull(topoShard, "TopologyShard should never be null");
423 assertNull(topoShard.getNodes(), "list of nodes should be null");
424 assertNull(topoShard.getLinks(), "list of links should be null");
425 assertNull(topoShard.getTps(), "list of tps should be null");
429 void updateOtnLinksFor10GTest() {
430 // tests update for 10G creation
431 TopologyShard topoShard = OpenRoadmOtnTopology.updateOtnLinks(
432 NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000)),
433 NetworkmodelTestUtil.createTpList(true),
434 Uint32.valueOf(10), (short)1, (short)1, (short)8, false);
435 assertNotNull(topoShard, "TopologyShard should never be null");
436 assertNull(topoShard.getNodes(), "list of nodes should be null");
437 List<Link> sortedLinks = topoShard.getLinks().stream()
438 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
439 .collect(Collectors.toList());
440 assertEquals(2, sortedLinks.size(), "list of links should contain 2 links");
441 assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
443 Uint32.valueOf(90000),
444 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth(),
445 "after 10G creation, available BW of supported ODU4 should be 90000");
447 Uint32.valueOf(10000),
448 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth(),
449 "after 10G creation, used BW of supported ODU4 should be 10000");
453 topoShard.getTps().get(0).augmentation(
454 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
455 .TerminationPoint1.class)
456 .getXpdrTpPortConnectionAttributes().getTsPool().size(),
457 "after 10G creation, 8 (over 80) trib slot should be occupied");
459 "trib slot 1-8 should no longer be present in Trib slot list",
460 topoShard.getTps().get(0).augmentation(
461 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
462 .TerminationPoint1.class)
463 .getXpdrTpPortConnectionAttributes().getTsPool(),
464 not(hasItems(Uint16.valueOf(1), Uint16.valueOf(8))));
466 "trib slot 9 should always be present in trib slot list",
467 topoShard.getTps().get(0).augmentation(
468 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
469 .TerminationPoint1.class)
470 .getXpdrTpPortConnectionAttributes().getTsPool(),
471 hasItem(Uint16.valueOf(9)));
474 topoShard.getTps().get(0).augmentation(
475 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
476 .TerminationPoint1.class)
477 .getXpdrTpPortConnectionAttributes().getOdtuTpnPool().values().stream().findFirst().get().getTpnPool()
479 "after 10G creation, 1 (over 80) trib port should be occupied");
481 "trib port 1 should no longer be present",
482 topoShard.getTps().get(0).augmentation(
483 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
484 .TerminationPoint1.class)
485 .getXpdrTpPortConnectionAttributes().getOdtuTpnPool().values().stream().findFirst().get().getTpnPool(),
486 not(hasItem(Uint16.valueOf(1))));
488 // tests update for 10G deletion
490 topoShard = OpenRoadmOtnTopology.updateOtnLinks(topoShard.getLinks(), topoShard.getTps(), Uint32.valueOf(10),
491 (short)1, (short)1, (short)8, true);
492 sortedLinks = topoShard.getLinks().stream()
493 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
494 .collect(Collectors.toList());
495 assertEquals(2, sortedLinks.size(), "list of links should contain 2 links");
496 assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
498 Uint32.valueOf(100000),
499 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth(),
500 "after 10G deletion, available BW of supported ODU4 should be 100 000");
503 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth(),
504 "after 10G deletion, used BW of supported ODU4 should be 0");
508 topoShard.getTps().get(0).augmentation(
509 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
510 .TerminationPoint1.class)
511 .getXpdrTpPortConnectionAttributes().getTsPool().size(),
512 "after 10G deletion, trib slot list should be full");
514 "after 10G deletion, trib slot list should contain items 1-8",
515 topoShard.getTps().get(0).augmentation(
516 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
517 .TerminationPoint1.class)
518 .getXpdrTpPortConnectionAttributes().getTsPool(),
519 hasItems(Uint16.valueOf(1), Uint16.valueOf(8), Uint16.valueOf(9)));
522 topoShard.getTps().get(0).augmentation(
523 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
524 .TerminationPoint1.class)
525 .getXpdrTpPortConnectionAttributes().getOdtuTpnPool().values().stream().findFirst().get()
526 .getTpnPool().size(),
527 "after 10G deletion, trib port list should be full");
529 "after 10G deletion, trib port list should contain items 1",
530 topoShard.getTps().get(0).augmentation(
531 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
532 .TerminationPoint1.class)
533 .getXpdrTpPortConnectionAttributes().getOdtuTpnPool().values().stream().findFirst().get().getTpnPool(),
534 hasItem(Uint16.valueOf(1)));
538 void updateOtnLinksFor1GCreationTest() {
539 // tests update for 1G creation
540 TopologyShard topoShard = OpenRoadmOtnTopology.updateOtnLinks(
541 NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000)),
542 NetworkmodelTestUtil.createTpList(true),
543 Uint32.valueOf(1), (short)1, (short)1, (short)1, false);
544 assertNotNull(topoShard, "TopologyShard should never be null");
545 assertNull(topoShard.getNodes(), "list of nodes should be null");
546 List<Link> sortedLinks = topoShard.getLinks().stream()
547 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
548 .collect(Collectors.toList());
549 assertEquals(2, sortedLinks.size(), "list of links should contain 2 links");
550 assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
552 Uint32.valueOf(99000),
553 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth(),
554 "after 1G creation, available BW of supported ODU4 should be 99000");
556 Uint32.valueOf(1000),
557 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth(),
558 "after 1G creation, used BW of supported ODU4 should be 1000");
562 topoShard.getTps().get(0).augmentation(
563 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
564 .TerminationPoint1.class)
565 .getXpdrTpPortConnectionAttributes().getTsPool().size(),
566 "after 1G creation, 1 (over 80) trib slot should be occupied");
568 "trib slot 1 should no longer be present in Trib slot list",
569 topoShard.getTps().get(0).augmentation(
570 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
571 .TerminationPoint1.class)
572 .getXpdrTpPortConnectionAttributes().getTsPool(),
573 not(hasItem(Uint16.valueOf(1))));
575 "trib slot 2 should always be present in Trib slot list",
576 topoShard.getTps().get(0).augmentation(
577 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
578 .TerminationPoint1.class)
579 .getXpdrTpPortConnectionAttributes().getTsPool(),
580 hasItem(Uint16.valueOf(2)));
583 topoShard.getTps().get(0).augmentation(
584 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
585 .TerminationPoint1.class)
586 .getXpdrTpPortConnectionAttributes().getOdtuTpnPool().values().stream().findFirst().get().getTpnPool()
588 "after 1G creation, 1 (over 80) trib port should be occupied");
590 "trib port 1 should no longer be present in Trib port list",
591 topoShard.getTps().get(0).augmentation(
592 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
593 .TerminationPoint1.class)
594 .getXpdrTpPortConnectionAttributes().getOdtuTpnPool().values().stream().findFirst().get().getTpnPool(),
595 not(hasItem(Uint16.valueOf(1))));
597 // tests update for 1G deletion
599 topoShard = OpenRoadmOtnTopology.updateOtnLinks(
600 topoShard.getLinks(),
602 Uint32.valueOf(1), (short)1, (short)1, (short)1, true);
603 sortedLinks = topoShard.getLinks().stream()
604 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
605 .collect(Collectors.toList());
606 assertEquals(2, sortedLinks.size(), "list of links should contain 2 links");
607 assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
609 Uint32.valueOf(100000),
610 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth(),
611 "after 1G deletion, available BW of supported ODU4 should be 100 000");
614 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth(),
615 "after 1G deletion, used BW of supported ODU4 should be 0");
619 topoShard.getTps().get(0).augmentation(
620 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
621 .TerminationPoint1.class)
622 .getXpdrTpPortConnectionAttributes().getTsPool().size(),
623 "after 1G deletion, trib slot list should be full");
625 "after 1G deletion, trib slot list should contain items 1 and 2",
626 topoShard.getTps().get(0).augmentation(
627 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
628 .TerminationPoint1.class)
629 .getXpdrTpPortConnectionAttributes().getTsPool(),
630 hasItems(Uint16.valueOf(1), Uint16.valueOf(2)));
633 topoShard.getTps().get(0).augmentation(
634 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
635 .TerminationPoint1.class)
636 .getXpdrTpPortConnectionAttributes().getOdtuTpnPool().values().stream().findFirst().get().getTpnPool()
638 "after 1G deletion, trib port list should be full");
640 "after 1G deletion, trib port list should contain items 1",
641 topoShard.getTps().get(0).augmentation(
642 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
643 .TerminationPoint1.class)
644 .getXpdrTpPortConnectionAttributes().getOdtuTpnPool().values().stream().findFirst().get().getTpnPool(),
645 hasItem(Uint16.valueOf(1)));
649 void updateOtnLinksForODU4WhenBWParamsNotPresentTest() {
650 List<Link> odu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000));
651 List<Link> odu4LinksWithBadBWParam = new ArrayList<>();
652 for (Link link : odu4Links) {
653 odu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
655 TopologyShard topoShard =
656 OpenRoadmOtnTopology.updateOtnLinks(
657 odu4LinksWithBadBWParam,
658 NetworkmodelTestUtil.createTpList(true),
659 Uint32.valueOf(1), (short)1, (short)1, (short)10, false);
660 assertNotNull(topoShard, "TopologyShard should never be null");
661 assertNull(topoShard.getNodes(), "list of nodes should be null");
662 assertNull(topoShard.getLinks(), "list of links should be null");
663 assertNull(topoShard.getTps(), "list of tps should be null");
667 void updateOtnLinksForODU4WhenAvailBWNotSufficientTest() {
668 List<Link> odu4LinksWithBadBWParam = NetworkmodelTestUtil.createSuppOTNLinks(
670 Uint32.valueOf(8000));
671 TopologyShard topoShard = OpenRoadmOtnTopology.updateOtnLinks(
672 odu4LinksWithBadBWParam,
673 NetworkmodelTestUtil.createTpList(true),
674 Uint32.valueOf(10), (short)1, (short)1, (short)10, false);
675 assertNotNull(topoShard, "TopologyShard should never be null");
676 assertNull(topoShard.getNodes(), "list of nodes should be null");
677 assertNull(topoShard.getLinks(), "list of links should be null");
678 assertNull(topoShard.getTps(), "list of tps should be null");
681 private void checkSpdrNode(Node node) {
682 Uint16 xpdrNb = node.augmentation(
683 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210.Node1.class)
684 .getXpdrAttributes().getXpdrNumber();
685 assertEquals("SPDR-SA1-XPDR" + xpdrNb, node.getNodeId().getValue());
686 if (xpdrNb.equals(Uint16.valueOf(1))) {
687 assertEquals(OpenroadmNodeType.MUXPDR, node.augmentation(Node1.class).getNodeType());
688 } else if (xpdrNb.equals(Uint16.valueOf(2))) {
689 assertEquals(OpenroadmNodeType.SWITCH, node.augmentation(Node1.class).getNodeType());
691 // tests supporting nodes
692 List<SupportingNode> supportingNodes = node.nonnullSupportingNode().values().stream()
693 .sorted((sn1, sn2) -> sn1.getNetworkRef().getValue().compareTo(sn2.getNetworkRef().getValue()))
694 .collect(Collectors.toList());
695 assertEquals(3, supportingNodes.size(), "Should contain 3 supporting nodes");
696 assertEquals("clli-network", supportingNodes.get(0).getNetworkRef().getValue());
697 assertEquals("NodeSA", supportingNodes.get(0).getNodeRef().getValue());
698 assertEquals("openroadm-network", supportingNodes.get(1).getNetworkRef().getValue());
699 assertEquals("SPDR-SA1", supportingNodes.get(1).getNodeRef().getValue());
700 assertEquals("openroadm-topology", supportingNodes.get(2).getNetworkRef().getValue());
701 assertEquals("SPDR-SA1-XPDR" + xpdrNb, supportingNodes.get(2).getNodeRef().getValue());
702 checkSpdrSwitchingPools(
705 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210.Node1.class)
706 .getSwitchingPools());
707 List<TerminationPoint> tpList = node.augmentation(
708 org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class)
709 .nonnullTerminationPoint().values().stream()
710 .sorted((tp1, tp2) -> tp1.getTpId().getValue().compareTo(tp2.getTpId().getValue()))
711 .collect(Collectors.toList());
712 checkSpdrTpList(xpdrNb, tpList);
715 private void checkSpdrSwitchingPools(Uint16 xpdrNb, SwitchingPools sp) {
716 List<OduSwitchingPools> oduSwitchingPools = new ArrayList<>(sp.nonnullOduSwitchingPools().values());
719 oduSwitchingPools.size(),
720 "switching-pools augmentation should contain a single odu-switching-pools");
723 oduSwitchingPools.get(0).getSwitchingPoolNumber(),
724 "switching-pool-number should be 1");
727 oduSwitchingPools.get(0).getSwitchingPoolType().getName(),
728 "switching-pool-type should be non-blocking");
730 List<NonBlockingList> nonBlockingList =
731 new ArrayList<>(oduSwitchingPools.get(0).nonnullNonBlockingList().values());
732 if (xpdrNb.equals(Uint16.valueOf(1))) {
733 assertEquals(4, nonBlockingList.size(), "Mux should contain 4 non blocking list");
734 assertEquals(Uint16.valueOf(1), nonBlockingList.get(0).getNblNumber());
735 List<NonBlockingList> nblList = oduSwitchingPools.get(0).nonnullNonBlockingList().values().stream()
736 .sorted((nbl1, nbl2) -> nbl1.getNblNumber().compareTo(nbl2.getNblNumber()))
737 .collect(Collectors.toList());
738 for (NonBlockingList nbl : nblList) {
741 nbl.getAvailableInterconnectBandwidth(),
742 "for a 10G mux, interconnect BW should be 10G");
743 assertEquals(Uint32.valueOf(1000000000), nbl.getInterconnectBandwidthUnit());
745 "for a 10G mux, non blocking list should contain 2 entries (client + network ports)",
748 String nb = nbl.getNblNumber().toString();
751 containsInAnyOrder(new TpId("XPDR1-NETWORK1"), new TpId("XPDR1-CLIENT" + nb)));
753 } else if (xpdrNb.equals(Uint16.valueOf(2))) {
754 assertEquals(1, nonBlockingList.size(), "Switch should contain a single non blocking list");
755 assertEquals(Uint16.valueOf(1), nonBlockingList.get(0).getNblNumber());
757 "for a 100G Switch, non blocking list should contain 8 entries (4 clients + 4 network ports)",
758 nonBlockingList.get(0).getTpList(),
761 nonBlockingList.get(0).getTpList(),
763 new TpId("XPDR2-CLIENT1"), new TpId("XPDR2-NETWORK1"), new TpId("XPDR2-CLIENT2"),
764 new TpId("XPDR2-NETWORK2"), new TpId("XPDR2-CLIENT3"), new TpId("XPDR2-NETWORK3"),
765 new TpId("XPDR2-CLIENT4"), new TpId("XPDR2-NETWORK4")));
769 private void checkSpdrTpList(Uint16 xpdrNb, List<TerminationPoint> tpList) {
770 LOG.info("tpList = {}", tpList);
773 tpList.get(4).augmentation(
774 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
775 .TerminationPoint1.class)
776 .getTpSupportedInterfaces().getSupportedInterfaceCapability().values().stream().findFirst().get()
778 "only IfOCHOTU4ODU4 interface capabitily expected");
781 tpList.get(4).augmentation(
782 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
783 .TerminationPoint1.class)
784 .getXpdrTpPortConnectionAttributes().getRate(),
785 "the rate should be ODU4");
787 "openroadm-topology",
788 tpList.get(4).getSupportingTerminationPoint().values().stream().findFirst().get().getNetworkRef()
791 "SPDR-SA1-XPDR" + xpdrNb,
792 tpList.get(4).getSupportingTerminationPoint().values().stream().findFirst().get().getNodeRef().getValue());
794 "XPDR" + xpdrNb + "-NETWORK1",
795 tpList.get(4).getSupportingTerminationPoint().values().stream().findFirst().get().getTpRef().getValue());
796 if (xpdrNb.equals(Uint16.valueOf(1))) {
797 assertEquals(5, tpList.size(), "should contain 5 TPs");
798 assertEquals("XPDR1-CLIENT1", tpList.get(0).getTpId().getValue());
799 assertEquals("XPDR1-CLIENT2", tpList.get(1).getTpId().getValue());
800 assertEquals("XPDR1-NETWORK1", tpList.get(4).getTpId().getValue());
803 tpList.get(1).augmentation(
804 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
805 .TerminationPoint1.class)
806 .getTpSupportedInterfaces().getSupportedInterfaceCapability().values().size(),
807 "supported interface capability of tp-id XPDR1-CLIENT2 should contain 2 if-cap-type");
810 tpList.get(2).augmentation(
811 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
812 .TerminationPoint1.class)
813 .getTpSupportedInterfaces().getSupportedInterfaceCapability().values().size(),
814 "supported interface capability of tp-id XPDR1-CLIENT3 should contain 3 if-cap-type");
815 List<SupportedInterfaceCapability> sicListClient1 = tpList.get(0).augmentation(
816 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
817 .TerminationPoint1.class)
818 .getTpSupportedInterfaces().getSupportedInterfaceCapability().values().stream()
819 .collect(Collectors.toList());
820 for (SupportedInterfaceCapability supportedInterfaceCapability : sicListClient1) {
821 assertThat("tp should have 2 if-cap-type: if-10GE-ODU2e, if-10GE-ODU2",
822 String.valueOf(supportedInterfaceCapability.getIfCapType()),
823 either(containsString(String.valueOf(If10GEODU2e.VALUE)))
824 .or(containsString(String.valueOf(If10GEODU2.VALUE))));
826 List<SupportedInterfaceCapability> sicListClient3 = tpList.get(3).augmentation(
827 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
828 .TerminationPoint1.class)
829 .getTpSupportedInterfaces().getSupportedInterfaceCapability().values().stream()
830 .collect(Collectors.toList());
831 for (SupportedInterfaceCapability supportedInterfaceCapability : sicListClient3) {
832 assertThat("tp should have 3 if-cap-type: if-10GE-ODU2e, if-10GE-ODU2, if-10GE",
833 String.valueOf(supportedInterfaceCapability.getIfCapType()),
834 either(containsString(String.valueOf(If10GEODU2e.VALUE)))
835 .or(containsString(String.valueOf(If10GEODU2.VALUE)))
836 .or(containsString(String.valueOf(If10GE.VALUE))));
838 assertThat("the rate should be ODU2 or ODU2e",
839 String.valueOf(tpList.get(2).augmentation(
840 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
841 .TerminationPoint1.class)
842 .getXpdrTpPortConnectionAttributes().getRate()),
843 either(containsString(String.valueOf(ODU2e.VALUE)))
844 .or(containsString(String.valueOf(ODU2.VALUE))));
846 OpenroadmTpType.XPONDERCLIENT,
847 tpList.get(2).augmentation(TerminationPoint1.class).getTpType(),
848 "TP should be of type client");
850 OpenroadmTpType.XPONDERNETWORK,
851 tpList.get(4).augmentation(TerminationPoint1.class).getTpType(),
852 "TP should be of type network");
853 } else if (xpdrNb.equals(Uint16.valueOf(2))) {
854 assertEquals(8, tpList.size(), "should contain 8 TPs");
855 assertEquals("XPDR2-CLIENT1", tpList.get(0).getTpId().getValue());
856 assertEquals("XPDR2-CLIENT2", tpList.get(1).getTpId().getValue());
857 assertEquals("XPDR2-NETWORK1", tpList.get(4).getTpId().getValue());
858 assertEquals("XPDR2-NETWORK2", tpList.get(5).getTpId().getValue());
861 tpList.get(5).augmentation(
862 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
863 .TerminationPoint1.class)
864 .getTpSupportedInterfaces().getSupportedInterfaceCapability().values().stream().findFirst().get()
866 "only IfOCHOTU4ODU4 interface capabitily expected");
869 tpList.get(2).augmentation(
870 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
871 .TerminationPoint1.class)
872 .getTpSupportedInterfaces().getSupportedInterfaceCapability().values().size(),
873 "supported interface capability of tp should contain 2 IfCapType");
874 List<SupportedInterfaceCapability> sicListClient3 = tpList.get(2).augmentation(
875 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
876 .TerminationPoint1.class)
877 .getTpSupportedInterfaces().getSupportedInterfaceCapability().values().stream()
878 .collect(Collectors.toList());
879 for (SupportedInterfaceCapability supportedInterfaceCapability : sicListClient3) {
881 "tp should have 2 if-cap-type: if-100GE-ODU4, if-100GE",
882 String.valueOf(supportedInterfaceCapability.getIfCapType()),
883 either(containsString(String.valueOf(If100GEODU4.VALUE)))
884 .or(containsString(String.valueOf(If100GE.VALUE))));
887 OpenroadmTpType.XPONDERCLIENT,
888 tpList.get(2).augmentation(TerminationPoint1.class).getTpType(),
889 "TP should be of type client");
891 OpenroadmTpType.XPONDERNETWORK,
892 tpList.get(6).augmentation(TerminationPoint1.class).getTpType(),
893 "TP should be of type network");