Fix bug when creating SRG termination points 17/101017/2
authorJonas Mårtensson <jonas.martensson@ri.se>
Mon, 9 May 2022 18:57:08 +0000 (20:57 +0200)
committerGilles Thouenon <gilles.thouenon@orange.com>
Tue, 10 May 2022 13:49:43 +0000 (15:49 +0200)
commit142c5ad74a464cb02a64efeeedaaf9d35eeb21ff
tree53f842d54f4653a8573f7957ae3b2a09cc1b9122
parent9b5790923533d39efc5d2a3a16751954ee1fa987
Fix bug when creating SRG termination points

When a ROADM node includes multiple SRGs such as SRG1, SRG10, SRG11,
etc., the termination points (tp-id) created under SRG1 in the
openroadm topology included erroneous entries such as SRG10-PPn-TXRX
under SRG1. This was caused by the createTopologyShard method filtering
and selecting all logical connection points in the port mapping list
containing SRG1 as a substring which is also true for SRG10, SRG11,
etc. With this patch, the whole string before the first "-" is used for
comparison instead.
Also, add a specific UT to check this use case.

JIRA: TRNSPRTPCE-664
Signed-off-by: Jonas Mårtensson <jonas.martensson@ri.se>
Change-Id: Iab2802e1bac4e48aafeb4518d876c32b990742c3
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/util/OpenRoadmTopology.java
networkmodel/src/test/java/org/opendaylight/transportpce/networkmodel/util/OpenRoadmTopologyTest.java
networkmodel/src/test/java/org/opendaylight/transportpce/networkmodel/util/test/NetworkmodelTestUtil.java