2 * Copyright (c) 2019 AT&T Intellectual Property.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * This source code is part of the near-RT RIC (RAN Intelligent Controller)
19 * platform project (RICP).
27 "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
34 Test permutations of x2 setup response to protobuf enb
37 func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
38 logger, _ := logger.InitLogger(logger.InfoLevel)
40 var testCases = []struct {
41 key *entities.GlobalNbId
47 key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
48 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD] []",
56 ProtocolIE_Container_elm
60 pLMN_Identity_t = 02 f8 29
62 macro_eNB_ID_t = 00 7a 80 (20 bits)
63 ProtocolIE_Container_elm
71 pLMN_Identity_t = 02 f8 29
72 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
75 BroadcastPLMNs_Item_elm = 02 f8 29
80 uL_Transmission_Bandwidth_t = 0x3
81 dL_Transmission_Bandwidth_t = 0x3`
83 packedPdu: "2006002a000002001500080002f82900007a8000140017000000630002f8290007ab50102002f829000001000133"},
85 key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
86 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD pci:100 cell_id:\"02f929:0007ac50\" tac:\"0203\" broadcast_plmns:\"02f829\" broadcast_plmns:\"02f929\" choice_eutra_mode:{fdd:{ulear_fcn:2 dlear_fcn:3 ul_transmission_bandwidth:BW75 dl_transmission_bandwidth:BW75}} eutra_mode:FDD] []",
94 ProtocolIE_Container_elm
98 pLMN_Identity_t = 02 f8 29
100 macro_eNB_ID_t = 00 7a 80 (20 bits)
101 ProtocolIE_Container_elm
109 pLMN_Identity_t = 02 f8 29
110 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
113 BroadcastPLMNs_Item_elm = 02 f8 29
118 uL_Transmission_Bandwidth_t = 0x3
119 dL_Transmission_Bandwidth_t = 0x3
124 pLMN_Identity_t = 02 f9 29
125 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
128 BroadcastPLMNs_Item_elm = 02 f8 29
129 BroadcastPLMNs_Item_elm = 02 f9 29
134 uL_Transmission_Bandwidth_t = 0x4
135 dL_Transmission_Bandwidth_t = 0x4
137 packedPdu: "20060043000002001500080002f82900007a8000140030010000630002f8290007ab50102002f8290000010001330000640002f9290007ac50203202f82902f929000002000344"},
139 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
140 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:2 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD] []",
144 procedureCode_t = 0x6
148 ProtocolIE_Container_elm
152 pLMN_Identity_t = 02 f8 29
154 macro_eNB_ID_t = 00 7a 80 (20 bits)
155 ProtocolIE_Container_elm
163 pLMN_Identity_t = 02 f8 29
164 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
167 BroadcastPLMNs_Item_elm = 02 f8 29
172 uL_Transmission_Bandwidth_t = 0x3
173 dL_Transmission_Bandwidth_t = 0x3
175 ProtocolExtensionContainer_elm
176 id_t = 0x5f //ul_EARFCN
178 EARFCNExtension = 0x2
180 packedPdu: "20060033000002001500080002f82900007a8000140020000000630002f8290007ab50102002f8291000010001330000005f0003800102"},
181 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
182 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD] [02f729:0203 02f929:0304]",
186 procedureCode_t = 0x6
190 ProtocolIE_Container_elm
194 pLMN_Identity_t = 02 f8 29
196 macro_eNB_ID_t = 00 7a 80 (20 bits)
197 ProtocolIE_Container_elm
205 pLMN_Identity_t = 02 f8 29
206 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
209 BroadcastPLMNs_Item_elm = 02 f8 29
214 uL_Transmission_Bandwidth_t = 0x3
215 dL_Transmission_Bandwidth_t = 0x3
216 ProtocolIE_Container_elm
221 pLMN_Identity_t = 02 f7 29
222 mME_Group_ID_t = 02 03
224 pLMN_Identity_t = 02 f9 29
225 mME_Group_ID_t = 03 04
227 packedPdu: "2006003a000003001500080002f82900007a8000140017000000630002f8290007ab50102002f8290000010001330018000c1002f72902030002f9290304"},
229 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
230 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{tdd:{ear_fcn:1 transmission_bandwidth:BW50 subframe_assignment:SA2 special_subframe_info:{special_subframe_patterns:SSP4 cyclic_prefix_dl:NORMAL cyclic_prefix_ul:EXTENDED}}} eutra_mode:TDD] []",
234 procedureCode_t = 0x6
238 ProtocolIE_Container_elm
242 pLMN_Identity_t = 02 f8 29
244 macro_eNB_ID_t = 00 7a 80 (20 bits)
245 ProtocolIE_Container_elm
253 pLMN_Identity_t = 02 f8 29
254 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
257 BroadcastPLMNs_Item_elm = 02 f8 29
261 transmission_Bandwidth_t = 0x3
262 subframeAssignment_t = 0x2
263 specialSubframe_Info_t
264 specialSubframePatterns_t = 0x4
266 cyclicPrefixUL_t = 0x1
268 packedPdu: "2006002a000002001500080002f82900007a8000140017000000630002f8290007ab50102002f829400001320820"},
269 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
270 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{tdd:{ear_fcn:1 transmission_bandwidth:BW50 subframe_assignment:SA2 special_subframe_info:{special_subframe_patterns:SSP4 cyclic_prefix_dl:EXTENDED cyclic_prefix_ul:NORMAL} additional_special_subframe_info:{additional_special_subframe_patterns:SSP9 cyclic_prefix_dl:NORMAL cyclic_prefix_ul:EXTENDED}}} eutra_mode:TDD] []",
274 procedureCode_t = 0x6
278 ProtocolIE_Container_elm
282 pLMN_Identity_t = 02 f8 29
284 macro_eNB_ID_t = 00 7a 80 (20 bits)
285 ProtocolIE_Container_elm
293 pLMN_Identity_t = 02 f8 29
294 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
297 BroadcastPLMNs_Item_elm = 02 f8 29
301 transmission_Bandwidth_t = 0x3
302 subframeAssignment_t = 0x2
303 specialSubframe_Info_t
304 specialSubframePatterns_t = 0x4
305 cyclicPrefixDL_t = 0x1
308 ProtocolExtensionContainer_elm
311 AdditionalSpecialSubframe-Info
312 additionalspecialSubframePatterns_t = 0x9
314 cyclicPrefixUL_t = 0x1
316 packedPdu: "20060032000002001500080002f82900007a800014001f000000630002f8290007ab50102002f8295000013208800000006140021220"},
318 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
319 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{tdd:{ear_fcn:2 transmission_bandwidth:BW50 subframe_assignment:SA2 special_subframe_info:{special_subframe_patterns:SSP4 cyclic_prefix_dl:EXTENDED cyclic_prefix_ul:NORMAL}}} eutra_mode:TDD] []",
323 procedureCode_t = 0x6
327 ProtocolIE_Container_elm
331 pLMN_Identity_t = 02 f8 29
333 macro_eNB_ID_t = 00 7a 80 (20 bits)
334 ProtocolIE_Container_elm
342 pLMN_Identity_t = 02 f8 29
343 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
346 BroadcastPLMNs_Item_elm = 02 f8 29
350 transmission_Bandwidth_t = 0x3
351 subframeAssignment_t = 0x2
352 specialSubframe_Info_t
353 specialSubframePatterns_t = 0x4
354 cyclicPrefixDL_t = 0x1
357 ProtocolExtensionContainer_elm
360 EARFCNExtension = 0x2
362 packedPdu: "20060033000002001500080002f82900007a8000140020000000630002f8290007ab50102002f8295000013208800000005e0003800102"},
364 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
365 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{tdd:{ear_fcn:1 transmission_bandwidth:BW50 subframe_assignment:SA2 special_subframe_info:{special_subframe_patterns:SSP4 cyclic_prefix_dl:EXTENDED cyclic_prefix_ul:NORMAL} additional_special_subframe_extension_info:{additional_special_subframe_patterns_extension:SSP10 cyclic_prefix_dl:NORMAL cyclic_prefix_ul:NORMAL}}} eutra_mode:TDD] []",
369 procedureCode_t = 0x6
373 ProtocolIE_Container_elm
377 pLMN_Identity_t = 02 f8 29
379 macro_eNB_ID_t = 00 7a 80 (20 bits)
380 ProtocolIE_Container_elm
388 pLMN_Identity_t = 02 f8 29
389 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
392 BroadcastPLMNs_Item_elm = 02 f8 29
396 transmission_Bandwidth_t = 0x3
397 subframeAssignment_t = 0x2
398 specialSubframe_Info_t
399 specialSubframePatterns_t = 0x4
400 cyclicPrefixDL_t = 0x1
403 ProtocolExtensionContainer_elm
406 AdditionalSpecialSubframeExtension-Info
407 additionalspecialSubframePatternsExtension_t = 0
411 packedPdu: "20060031000002001500080002f82900007a800014001e000000630002f8290007ab50102002f829500001320880000000b3400100"},
413 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
414 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{tdd:{ear_fcn:2 transmission_bandwidth:BW50 subframe_assignment:SA2 special_subframe_info:{special_subframe_patterns:SSP4 cyclic_prefix_dl:EXTENDED cyclic_prefix_ul:NORMAL} additional_special_subframe_info:{additional_special_subframe_patterns:SSP9 cyclic_prefix_dl:NORMAL cyclic_prefix_ul:EXTENDED} additional_special_subframe_extension_info:{additional_special_subframe_patterns_extension:SSP10 cyclic_prefix_dl:NORMAL cyclic_prefix_ul:NORMAL}}} eutra_mode:TDD] []",
418 procedureCode_t = 0x6
422 ProtocolIE_Container_elm
426 pLMN_Identity_t = 02 f8 29
428 macro_eNB_ID_t = 00 7a 80 (20 bits)
429 ProtocolIE_Container_elm
437 pLMN_Identity_t = 02 f8 29
438 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
441 BroadcastPLMNs_Item_elm = 02 f8 29
445 transmission_Bandwidth_t = 0x3
446 subframeAssignment_t = 0x2
447 specialSubframe_Info_t
448 specialSubframePatterns_t = 0x4
449 cyclicPrefixDL_t = 0x1
452 ProtocolExtensionContainer_elm
455 AdditionalSpecialSubframeExtension-Info
456 additionalspecialSubframePatternsExtension_t = 0
459 ProtocolExtensionContainer_elm
462 AdditionalSpecialSubframe-Info
463 additionalspecialSubframePatterns_t = 0x9
465 cyclicPrefixUL_t = 0x1
466 ProtocolExtensionContainer_elm
469 EARFCNExtension = 0x2
472 packedPdu: "2006003e000002001500080002f82900007a800014002b000000630002f8290007ab50102002f829500001320880000200b3400100006140021220005e0003800102"},
474 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80b0"},
475 enb: "CONNECTED HOME_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD number_of_antenna_ports:AN1 pci:100 cell_id:\"02f929:0007ac50\" tac:\"0203\" broadcast_plmns:\"02f829\" broadcast_plmns:\"02f929\" choice_eutra_mode:{fdd:{ulear_fcn:2 dlear_fcn:3 ul_transmission_bandwidth:BW75 dl_transmission_bandwidth:BW75}} eutra_mode:FDD] []",
479 procedureCode_t = 0x6
483 ProtocolIE_Container_elm
487 pLMN_Identity_t = 02 f8 29
489 home_eNB_ID_t = 00 7a 80 b0 (28 bits)
490 ProtocolIE_Container_elm
498 pLMN_Identity_t = 02 f8 29
499 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
502 BroadcastPLMNs_Item_elm = 02 f8 29
507 uL_Transmission_Bandwidth_t = 0x3
508 dL_Transmission_Bandwidth_t = 0x3
510 ProtocolExtensionContainer_elm
513 Number-of-Antennaports = 0
518 pLMN_Identity_t = 02 f9 29
519 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
522 BroadcastPLMNs_Item_elm = 02 f8 29
523 BroadcastPLMNs_Item_elm = 02 f9 29
524 eUTRA_Mode_Info_t:nb_id
528 uL_Transmission_Bandwidth_t = 0x4
529 dL_Transmission_Bandwidth_t = 0x4
532 packedPdu: "2006004b000002001500090002f82940007a80b000140037010800630002f8290007ab50102002f829000001000133000000294001000000640002f9290007ac50203202f82902f929000002000344"},
534 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a40"},
535 enb: "CONNECTED SHORT_MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD number_of_antenna_ports:AN1 pci:100 cell_id:\"02f929:0007ac50\" tac:\"0203\" broadcast_plmns:\"02f829\" broadcast_plmns:\"02f929\" choice_eutra_mode:{fdd:{ulear_fcn:2 dlear_fcn:3 ul_transmission_bandwidth:BW75 dl_transmission_bandwidth:BW75}} eutra_mode:FDD prach_configuration:{root_sequence_index:15 zero_correlation_zone_configuration:7 high_speed_flag:true prach_frequency_offset:30}] []",
539 procedureCode_t = 0x6
543 ProtocolIE_Container_elm
547 pLMN_Identity_t = 02 f8 29
549 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
550 ProtocolIE_Container_elm
558 pLMN_Identity_t = 02 f8 29
559 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
562 BroadcastPLMNs_Item_elm = 02 f8 29
567 uL_Transmission_Bandwidth_t = 0x3
568 dL_Transmission_Bandwidth_t = 0x3
570 ProtocolExtensionContainer_elm
573 Number-of-Antennaports = 0
578 pLMN_Identity_t = 02 f9 29
579 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
582 BroadcastPLMNs_Item_elm = 02 f8 29
583 BroadcastPLMNs_Item_elm = 02 f9 29
588 uL_Transmission_Bandwidth_t = 0x4
589 dL_Transmission_Bandwidth_t = 0x4
591 ProtocolExtensionContainer_elm
595 rootSequenceIndex_t = 0xf
596 zeroCorrelationIndex_t = 0x7
597 highSpeedFlag_t = true
598 prach_FreqOffset_t = 0x1e
601 packedPdu: "20060056000002001500090002f8298003007a4000140042010800630002f8290007ab50102002f829000001000133000000294001000800640002f9290007ac50203202f82902f92900000200034400000037400500000f79e0"},
603 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a40"},
604 enb: "CONNECTED SHORT_MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD number_of_antenna_ports:AN1 pci:100 cell_id:\"02f929:0007ac50\" tac:\"0203\" broadcast_plmns:\"02f829\" broadcast_plmns:\"02f929\" choice_eutra_mode:{fdd:{ulear_fcn:2 dlear_fcn:3 ul_transmission_bandwidth:BW75 dl_transmission_bandwidth:BW75}} eutra_mode:FDD mbsfn_subframe_infos:{radioframe_allocation_period:N8 radioframe_allocation_offset:3 subframe_allocation:\"28\" subframe_allocation_type:ONE_FRAME}] []",
608 procedureCode_t = 0x6
612 ProtocolIE_Container_elm
616 pLMN_Identity_t = 02 f8 29
618 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
619 ProtocolIE_Container_elm
627 pLMN_Identity_t = 02 f8 29
628 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
631 BroadcastPLMNs_Item_elm = 02 f8 29
636 uL_Transmission_Bandwidth_t = 0x3
637 dL_Transmission_Bandwidth_t = 0x3
639 ProtocolExtensionContainer_elm
642 Number-of-Antennaports = 0
647 pLMN_Identity_t = 02 f9 29
648 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
651 BroadcastPLMNs_Item_elm = 02 f8 29
652 BroadcastPLMNs_Item_elm = 02 f9 29
657 uL_Transmission_Bandwidth_t = 0x4
658 dL_Transmission_Bandwidth_t = 0x4
660 ProtocolExtensionContainer_elm
663 MBSFN-Subframe-Infolist:
664 MBSFN_Subframe_Infolist_elm
665 radioframeAllocationPeriod_t = 0x3
666 radioframeAllocationOffset_t = 0x3
667 subframeAllocation_t:
668 oneframe_t = 28 (6 bits)
670 packedPdu: "20060054000002001500090002f8298003007a4000140040010800630002f8290007ab50102002f829000001000133000000294001000800640002f9290007ac50203202f82902f929000002000344000000384003019850"},
671 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a40"},
672 enb: "CONNECTED SHORT_MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD number_of_antenna_ports:AN1 mbsfn_subframe_infos:{radioframe_allocation_period:N8 radioframe_allocation_offset:3 subframe_allocation:\"28\" subframe_allocation_type:ONE_FRAME} pci:100 cell_id:\"02f929:0007ac50\" tac:\"0203\" broadcast_plmns:\"02f829\" broadcast_plmns:\"02f929\" choice_eutra_mode:{fdd:{ulear_fcn:2 dlear_fcn:3 ul_transmission_bandwidth:BW75 dl_transmission_bandwidth:BW75}} eutra_mode:FDD] []",
676 procedureCode_t = 0x6
680 ProtocolIE_Container_elm
684 pLMN_Identity_t = 02 f8 29
686 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
687 ProtocolIE_Container_elm
695 pLMN_Identity_t = 02 f8 29
696 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
699 BroadcastPLMNs_Item_elm = 02 f8 29
704 uL_Transmission_Bandwidth_t = 0x3
705 dL_Transmission_Bandwidth_t = 0x3
707 ProtocolExtensionContainer_elm
710 Number-of-Antennaports = 0
711 ProtocolExtensionContainer_elm
714 MBSFN-Subframe-Infolist:
715 MBSFN_Subframe_Infolist_elm
716 radioframeAllocationPeriod_t = 0x3
717 radioframeAllocationOffset_t = 0x3
718 subframeAllocation_t:
719 oneframe_t = 28 (6 bits)
724 pLMN_Identity_t = 02 f9 29
725 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
728 BroadcastPLMNs_Item_elm = 02 f8 29
729 BroadcastPLMNs_Item_elm = 02 f9 29
734 uL_Transmission_Bandwidth_t = 0x4
735 dL_Transmission_Bandwidth_t = 0x4
737 packedPdu: "20060052000002001500090002f8298003007a400014003e010800630002f8290007ab50102002f82900000100013300010029400100003840030198500000640002f9290007ac50203202f82902f929000002000344"},
738 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a40"},
739 enb: "CONNECTED SHORT_MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD number_of_antenna_ports:AN1 prach_configuration:{root_sequence_index:15 zero_correlation_zone_configuration:7 high_speed_flag:true prach_frequency_offset:30} pci:100 cell_id:\"02f929:0007ac50\" tac:\"0203\" broadcast_plmns:\"02f829\" broadcast_plmns:\"02f929\" choice_eutra_mode:{fdd:{ulear_fcn:2 dlear_fcn:3 ul_transmission_bandwidth:BW75 dl_transmission_bandwidth:BW75}} eutra_mode:FDD] []",
743 procedureCode_t = 0x6
747 ProtocolIE_Container_elm
751 pLMN_Identity_t = 02 f8 29
753 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
754 ProtocolIE_Container_elm
762 pLMN_Identity_t = 02 f8 29
763 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
766 BroadcastPLMNs_Item_elm = 02 f8 29
771 uL_Transmission_Bandwidth_t = 0x3
772 dL_Transmission_Bandwidth_t = 0x3
774 ProtocolExtensionContainer_elm
777 Number-of-Antennaports = 0
778 ProtocolExtensionContainer_elm
782 rootSequenceIndex_t = 0xf
783 zeroCorrelationIndex_t = 0x7
784 highSpeedFlag_t = true
785 prach_FreqOffset_t = 0x1e
790 pLMN_Identity_t = 02 f9 29
791 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
794 BroadcastPLMNs_Item_elm = 02 f8 29
795 BroadcastPLMNs_Item_elm = 02 f9 29
800 uL_Transmission_Bandwidth_t = 0x4
801 dL_Transmission_Bandwidth_t = 0x4
803 packedPdu: "20060054000002001500090002f8298003007a4000140040010800630002f8290007ab50102002f829000001000133000100294001000037400500000f79e00000640002f9290007ac50203202f82902f929000002000344"},
804 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a08"},
805 enb: "CONNECTED LONG_MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD prach_configuration:{root_sequence_index:15 zero_correlation_zone_configuration:7 high_speed_flag:true prach_frequency_offset:30 prach_configuration_index:60} pci:100 cell_id:\"02f929:0007ac50\" tac:\"0203\" broadcast_plmns:\"02f829\" broadcast_plmns:\"02f929\" choice_eutra_mode:{fdd:{ulear_fcn:2 dlear_fcn:3 ul_transmission_bandwidth:BW75 dl_transmission_bandwidth:BW75}} eutra_mode:FDD] []",
809 procedureCode_t = 0x6
813 ProtocolIE_Container_elm
817 pLMN_Identity_t = 02 f8 29
819 long_Macro_eNB_ID_t = 00 7a 08 (21 bits)
820 ProtocolIE_Container_elm
828 pLMN_Identity_t = 02 f8 29
829 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
832 BroadcastPLMNs_Item_elm = 02 f8 29
837 uL_Transmission_Bandwidth_t = 0x3
838 dL_Transmission_Bandwidth_t = 0x3
840 ProtocolExtensionContainer_elm
844 rootSequenceIndex_t = 0xf
845 zeroCorrelationIndex_t = 0x7
846 highSpeedFlag_t = true
847 prach_FreqOffset_t = 0x1e
848 prach_ConfigIndex_t = 0x3c
853 pLMN_Identity_t = 02 f9 29
854 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
857 BroadcastPLMNs_Item_elm = 02 f8 29
858 BroadcastPLMNs_Item_elm = 02 f9 29
863 uL_Transmission_Bandwidth_t = 0x4
864 dL_Transmission_Bandwidth_t = 0x4
866 //packedPdu: "20060050000002001500090002f8298103007a080014003c010800630002f8290007ab50102002f82900000100013300000037400640000f79ef000000640002f9290007ac50203202f82902f929000002000344"},
867 packedPdu: "20060050000002001500090002f829c003007a080014003c010800630002f8290007ab50102002f82900000100013300000037400640000f79ef000000640002f9290007ac50203202f82902f929000002000344"},
869 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
870 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD csg_id:\"0007aba0\" freq_band_indicator_priority:BROADCASTED bandwidth_reduced_si:SCHEDULED] []",
874 procedureCode_t = 0x6
878 ProtocolIE_Container_elm
882 pLMN_Identity_t = 02 f8 29
884 macro_eNB_ID_t = 00 7a 80 (20 bits)
885 ProtocolIE_Container_elm
893 pLMN_Identity_t = 02 f8 29
894 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
897 BroadcastPLMNs_Item_elm = 02 f8 29
902 uL_Transmission_Bandwidth_t = 0x3
903 dL_Transmission_Bandwidth_t = 0x3
905 ProtocolExtensionContainer_elm
908 CSG-Id = 00 07 ab a0 (27 bits)
909 ProtocolExtensionContainer_elm
912 FreqBandIndicatorPriority = 0x1
913 ProtocolExtensionContainer_elm
916 BandwidthReducedSI = 0
918 packedPdu: "2006003e000002001500080002f82900007a800014002b000800630002f8290007ab50102002f8290000010001330002004640040007aba000a040014000b4400100"},
920 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
921 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD mbms_service_area_identities:\"02f8\" mbms_service_area_identities:\"03f9\" multiband_infos:1 multiband_infos:2 multiband_infos:3 freq_band_indicator_priority:NOT_BROADCASTED] []",
925 procedureCode_t = 0x6
929 ProtocolIE_Container_elm
933 pLMN_Identity_t = 02 f8 29
935 macro_eNB_ID_t = 00 7a 80 (20 bits)
936 ProtocolIE_Container_elm
944 pLMN_Identity_t = 02 f8 29
945 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
948 BroadcastPLMNs_Item_elm = 02 f8 29
953 uL_Transmission_Bandwidth_t = 0x3
954 dL_Transmission_Bandwidth_t = 0x3
956 ProtocolExtensionContainer_elm
959 MBMS-Service-Area-Identity-List:
960 MBMS_Service_Area_Identity_List_elm = 02 f8
961 MBMS_Service_Area_Identity_List_elm = 03 f9
962 ProtocolExtensionContainer_elm
965 FreqBandIndicatorPriority = 0
966 ProtocolExtensionContainer_elm
970 MultibandInfoList_elm
971 freqBandIndicator_t = 0x1
972 MultibandInfoList_elm
973 freqBandIndicator_t = 0x2
974 MultibandInfoList_elm
975 freqBandIndicator_t = 0x3
977 packedPdu: "20060044000002001500080002f82900007a8000140031000800630002f8290007ab50102002f8290000010001330002004f40050102f803f900a040010000544006200000010002"},
978 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
979 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD neighbour_infos:{ecgi:\"02f829:0007ab50\" pci:99 ear_fcn:1} neighbour_infos:{ecgi:\"03f930:0008bc50\" pci:100 ear_fcn:2}] []",
983 procedureCode_t = 0x6
987 ProtocolIE_Container_elm
991 pLMN_Identity_t = 02 f8 29
993 macro_eNB_ID_t = 00 7a 80 (20 bits)
994 ProtocolIE_Container_elm
1002 pLMN_Identity_t = 02 f8 29
1003 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1006 BroadcastPLMNs_Item_elm = 02 f8 29
1011 uL_Transmission_Bandwidth_t = 0x3
1012 dL_Transmission_Bandwidth_t = 0x3
1014 Neighbour_Information_elm
1016 pLMN_Identity_t = 02 f8 29
1017 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1020 Neighbour_Information_elm
1022 pLMN_Identity_t = 03 f9 30
1023 eUTRANcellIdentifier_t = 00 08 bc 50 (28 bits)
1027 packedPdu: "20060044000002001500080002f82900007a8000140031004000630002f8290007ab50102002f82900000100013300020002f8290007ab50006300010003f9300008bc5000640002"},
1029 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
1030 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD neighbour_infos:{ecgi:\"02f829:0007ab50\" pci:99 ear_fcn:1 tac:\"0102\"} neighbour_infos:{ecgi:\"03f930:0008bc50\" pci:100 ear_fcn:3}] []",
1034 procedureCode_t = 0x6
1038 ProtocolIE_Container_elm
1042 pLMN_Identity_t = 02 f8 29
1044 macro_eNB_ID_t = 00 7a 80 (20 bits)
1045 ProtocolIE_Container_elm
1053 pLMN_Identity_t = 02 f8 29
1054 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1057 BroadcastPLMNs_Item_elm = 02 f8 29
1062 uL_Transmission_Bandwidth_t = 0x3
1063 dL_Transmission_Bandwidth_t = 0x3
1065 Neighbour_Information_elm
1067 pLMN_Identity_t = 02 f8 29
1068 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1072 ProtocolExtensionContainer_elm
1076 Neighbour_Information_elm
1078 pLMN_Identity_t = 03 f9 30
1079 eUTRANcellIdentifier_t = 00 08 bc 50 (28 bits)
1083 ProtocolExtensionContainer_elm
1086 EARFCNExtension = 0x3
1088 packedPdu: "20060055000002001500080002f82900007a8000140042004000630002f8290007ab50102002f82900000100013300024002f8290007ab50006300010000004c400201024003f9300008bc50006400020000005e0003800103"},
1090 {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
1091 enb: "CONNECTED MACRO_ENB [pci:99 cell_id:\"02f829:0007ab50\" tac:\"0102\" broadcast_plmns:\"02f829\" choice_eutra_mode:{fdd:{ulear_fcn:1 dlear_fcn:1 ul_transmission_bandwidth:BW50 dl_transmission_bandwidth:BW50}} eutra_mode:FDD neighbour_infos:{ecgi:\"02f829:0007ab50\" pci:99 ear_fcn:1 tac:\"0102\"} neighbour_infos:{ecgi:\"03f930:0008bc50\" pci:100 ear_fcn:3}] []",
1095 procedureCode_t = 0x6
1099 ProtocolIE_Container_elm
1103 pLMN_Identity_t = 02 f8 29
1105 macro_eNB_ID_t = 00 7a 80 (20 bits)
1106 ProtocolIE_Container_elm
1114 pLMN_Identity_t = 02 f8 29
1115 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1118 BroadcastPLMNs_Item_elm = 02 f8 29
1123 uL_Transmission_Bandwidth_t = 0x3
1124 dL_Transmission_Bandwidth_t = 0x3
1126 Neighbour_Information_elm
1128 pLMN_Identity_t = 02 f8 29
1129 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1133 ProtocolExtensionContainer_elm
1137 Neighbour_Information_elm
1139 pLMN_Identity_t = 03 f9 30
1140 eUTRANcellIdentifier_t = 00 08 bc 50 (28 bits)
1144 ProtocolExtensionContainer_elm
1147 EARFCNExtension = 0x3
1149 packedPdu: "20060055000002001500080002f82900007a8000140042004000630002f8290007ab50102002f82900000100013300024002f8290007ab50006300010000004c400201024003f9300008bc50006400020000005e0003800103",
1150 /*failure: fmt.Errorf("getAtom for path [successfulOutcome_t X2SetupResponse protocolIEs_t ProtocolIE_Container_elm GlobalENB-ID pLMN_Identity_t] failed, rc = 2" /NO_SPACE_LEFT),*/},
1153 converter := NewX2SetupResponseConverter(logger)
1155 for _, tc := range testCases {
1156 t.Run(tc.packedPdu, func(t *testing.T) {
1159 _, err := fmt.Sscanf(tc.packedPdu, "%x", &payload)
1161 t.Errorf("convert inputPayloadAsStr to payloadAsByte. Error: %v\n", err)
1164 key, enb, err := converter.UnpackX2SetupResponseAndExtract(payload)
1167 if tc.failure == nil {
1168 t.Errorf("want: success, got: error: %v\n", err)
1170 if strings.Compare(err.Error(), tc.failure.Error()) != 0 {
1171 t.Errorf("want: %s, got: %s", tc.failure, err)
1177 if tc.failure == nil {
1178 t.Errorf("want: key=%v, got: empty key", tc.key)
1181 if strings.Compare(key.PlmnId, tc.key.PlmnId) != 0 || strings.Compare(key.NbId, tc.key.NbId) != 0 {
1182 t.Errorf("want: key=%s, got: %s", tc.key, key)
1187 if tc.failure == nil {
1188 t.Errorf("want: enb=%s, got: empty enb", tc.enb)
1191 nb := &entities.NodebInfo{}
1192 nb.ConnectionStatus = entities.ConnectionStatus_CONNECTED
1193 nb.Configuration = &entities.NodebInfo_Enb{Enb: enb}
1194 embStr := fmt.Sprintf("%s %s %s %s", nb.ConnectionStatus, enb.EnbType, enb.ServedCells, enb.GuGroupIds)
1196 space := regexp.MustCompile(`\s+`)
1197 s1 := space.ReplaceAllString(embStr, " ")
1198 s2 := space.ReplaceAllString(tc.enb," ")
1202 if !strings.EqualFold(s1, s2) {
1203 t.Errorf("want: enb=%s, got: %s", tc.enb, embStr)