Fix bug when creating SRG termination points 82/100982/1
authorJonas Mårtensson <jonas.martensson@ri.se>
Mon, 9 May 2022 18:57:08 +0000 (20:57 +0200)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Wed, 11 May 2022 07:03:00 +0000 (07:03 +0000)
commit9700db9bead54006440f970489171181c3902427
tree7527f2ccbdf37451c6166d6e4507780dddbf7d07
parent3b6ff6c4317f8768e5b7dc9386c7d5bf93c477b8
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
(cherry picked from commit 142c5ad74a464cb02a64efeeedaaf9d35eeb21ff)
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