1 /*******************************************************************************
3 * Copyright (c) 2019 AT&T Intellectual Property.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 *******************************************************************************/
21 "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
30 Test permutations of x2 setup response to protobuf enb
33 func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
34 logger, _ := logger.InitLogger(logger.InfoLevel)
36 var testCases = []struct {
38 key *entities.GlobalNbId
44 saveToRNib: false, //TODO: use MOCK?
45 key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
46 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 ] []",
54 ProtocolIE_Container_elm
58 pLMN_Identity_t = 02 f8 29
60 macro_eNB_ID_t = 00 7a 80 (20 bits)
61 ProtocolIE_Container_elm
69 pLMN_Identity_t = 02 f8 29
70 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
73 BroadcastPLMNs_Item_elm = 02 f8 29
78 uL_Transmission_Bandwidth_t = 0x3
79 dL_Transmission_Bandwidth_t = 0x3`
81 packedPdu: "2006002a000002001500080002f82900007a8000140017000000630002f8290007ab50102002f829000001000133"},
83 key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
84 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 ] []",
92 ProtocolIE_Container_elm
96 pLMN_Identity_t = 02 f8 29
98 macro_eNB_ID_t = 00 7a 80 (20 bits)
99 ProtocolIE_Container_elm
107 pLMN_Identity_t = 02 f8 29
108 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
111 BroadcastPLMNs_Item_elm = 02 f8 29
116 uL_Transmission_Bandwidth_t = 0x3
117 dL_Transmission_Bandwidth_t = 0x3
122 pLMN_Identity_t = 02 f9 29
123 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
126 BroadcastPLMNs_Item_elm = 02 f8 29
127 BroadcastPLMNs_Item_elm = 02 f9 29
132 uL_Transmission_Bandwidth_t = 0x4
133 dL_Transmission_Bandwidth_t = 0x4
135 packedPdu: "20060043000002001500080002f82900007a8000140030010000630002f8290007ab50102002f8290000010001330000640002f9290007ac50203202f82902f929000002000344"},
137 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
138 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 ] []",
142 procedureCode_t = 0x6
146 ProtocolIE_Container_elm
150 pLMN_Identity_t = 02 f8 29
152 macro_eNB_ID_t = 00 7a 80 (20 bits)
153 ProtocolIE_Container_elm
161 pLMN_Identity_t = 02 f8 29
162 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
165 BroadcastPLMNs_Item_elm = 02 f8 29
170 uL_Transmission_Bandwidth_t = 0x3
171 dL_Transmission_Bandwidth_t = 0x3
173 ProtocolExtensionContainer_elm
174 id_t = 0x5f //ul_EARFCN
176 EARFCNExtension = 0x2
178 packedPdu: "20060033000002001500080002f82900007a8000140020000000630002f8290007ab50102002f8291000010001330000005f0003800102"},
179 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
180 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]",
184 procedureCode_t = 0x6
188 ProtocolIE_Container_elm
192 pLMN_Identity_t = 02 f8 29
194 macro_eNB_ID_t = 00 7a 80 (20 bits)
195 ProtocolIE_Container_elm
203 pLMN_Identity_t = 02 f8 29
204 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
207 BroadcastPLMNs_Item_elm = 02 f8 29
212 uL_Transmission_Bandwidth_t = 0x3
213 dL_Transmission_Bandwidth_t = 0x3
214 ProtocolIE_Container_elm
219 pLMN_Identity_t = 02 f7 29
220 mME_Group_ID_t = 02 03
222 pLMN_Identity_t = 02 f9 29
223 mME_Group_ID_t = 03 04
225 packedPdu: "2006003a000003001500080002f82900007a8000140017000000630002f8290007ab50102002f8290000010001330018000c1002f72902030002f9290304"},
227 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
228 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 ] []",
232 procedureCode_t = 0x6
236 ProtocolIE_Container_elm
240 pLMN_Identity_t = 02 f8 29
242 macro_eNB_ID_t = 00 7a 80 (20 bits)
243 ProtocolIE_Container_elm
251 pLMN_Identity_t = 02 f8 29
252 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
255 BroadcastPLMNs_Item_elm = 02 f8 29
259 transmission_Bandwidth_t = 0x3
260 subframeAssignment_t = 0x2
261 specialSubframe_Info_t
262 specialSubframePatterns_t = 0x4
264 cyclicPrefixUL_t = 0x1
266 packedPdu: "2006002a000002001500080002f82900007a8000140017000000630002f8290007ab50102002f829400001320820"},
267 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
268 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 ] []",
272 procedureCode_t = 0x6
276 ProtocolIE_Container_elm
280 pLMN_Identity_t = 02 f8 29
282 macro_eNB_ID_t = 00 7a 80 (20 bits)
283 ProtocolIE_Container_elm
291 pLMN_Identity_t = 02 f8 29
292 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
295 BroadcastPLMNs_Item_elm = 02 f8 29
299 transmission_Bandwidth_t = 0x3
300 subframeAssignment_t = 0x2
301 specialSubframe_Info_t
302 specialSubframePatterns_t = 0x4
303 cyclicPrefixDL_t = 0x1
306 ProtocolExtensionContainer_elm
309 AdditionalSpecialSubframe-Info
310 additionalspecialSubframePatterns_t = 0x9
312 cyclicPrefixUL_t = 0x1
314 packedPdu: "20060032000002001500080002f82900007a800014001f000000630002f8290007ab50102002f8295000013208800000006140021220"},
316 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
317 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 ] []",
321 procedureCode_t = 0x6
325 ProtocolIE_Container_elm
329 pLMN_Identity_t = 02 f8 29
331 macro_eNB_ID_t = 00 7a 80 (20 bits)
332 ProtocolIE_Container_elm
340 pLMN_Identity_t = 02 f8 29
341 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
344 BroadcastPLMNs_Item_elm = 02 f8 29
348 transmission_Bandwidth_t = 0x3
349 subframeAssignment_t = 0x2
350 specialSubframe_Info_t
351 specialSubframePatterns_t = 0x4
352 cyclicPrefixDL_t = 0x1
355 ProtocolExtensionContainer_elm
358 EARFCNExtension = 0x2
360 packedPdu: "20060033000002001500080002f82900007a8000140020000000630002f8290007ab50102002f8295000013208800000005e0003800102"},
362 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
363 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 ] []",
367 procedureCode_t = 0x6
371 ProtocolIE_Container_elm
375 pLMN_Identity_t = 02 f8 29
377 macro_eNB_ID_t = 00 7a 80 (20 bits)
378 ProtocolIE_Container_elm
386 pLMN_Identity_t = 02 f8 29
387 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
390 BroadcastPLMNs_Item_elm = 02 f8 29
394 transmission_Bandwidth_t = 0x3
395 subframeAssignment_t = 0x2
396 specialSubframe_Info_t
397 specialSubframePatterns_t = 0x4
398 cyclicPrefixDL_t = 0x1
401 ProtocolExtensionContainer_elm
404 AdditionalSpecialSubframeExtension-Info
405 additionalspecialSubframePatternsExtension_t = 0
409 packedPdu: "20060031000002001500080002f82900007a800014001e000000630002f8290007ab50102002f829500001320880000000b3400100"},
411 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
412 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 ] []",
416 procedureCode_t = 0x6
420 ProtocolIE_Container_elm
424 pLMN_Identity_t = 02 f8 29
426 macro_eNB_ID_t = 00 7a 80 (20 bits)
427 ProtocolIE_Container_elm
435 pLMN_Identity_t = 02 f8 29
436 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
439 BroadcastPLMNs_Item_elm = 02 f8 29
443 transmission_Bandwidth_t = 0x3
444 subframeAssignment_t = 0x2
445 specialSubframe_Info_t
446 specialSubframePatterns_t = 0x4
447 cyclicPrefixDL_t = 0x1
450 ProtocolExtensionContainer_elm
453 AdditionalSpecialSubframeExtension-Info
454 additionalspecialSubframePatternsExtension_t = 0
457 ProtocolExtensionContainer_elm
460 AdditionalSpecialSubframe-Info
461 additionalspecialSubframePatterns_t = 0x9
463 cyclicPrefixUL_t = 0x1
464 ProtocolExtensionContainer_elm
467 EARFCNExtension = 0x2
470 packedPdu: "2006003e000002001500080002f82900007a800014002b000000630002f8290007ab50102002f829500001320880000200b3400100006140021220005e0003800102"},
472 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80b0"},
473 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 ] []",
477 procedureCode_t = 0x6
481 ProtocolIE_Container_elm
485 pLMN_Identity_t = 02 f8 29
487 home_eNB_ID_t = 00 7a 80 b0 (28 bits)
488 ProtocolIE_Container_elm
496 pLMN_Identity_t = 02 f8 29
497 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
500 BroadcastPLMNs_Item_elm = 02 f8 29
505 uL_Transmission_Bandwidth_t = 0x3
506 dL_Transmission_Bandwidth_t = 0x3
508 ProtocolExtensionContainer_elm
511 Number-of-Antennaports = 0
516 pLMN_Identity_t = 02 f9 29
517 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
520 BroadcastPLMNs_Item_elm = 02 f8 29
521 BroadcastPLMNs_Item_elm = 02 f9 29
522 eUTRA_Mode_Info_t:nb_id
526 uL_Transmission_Bandwidth_t = 0x4
527 dL_Transmission_Bandwidth_t = 0x4
530 packedPdu: "2006004b000002001500090002f82940007a80b000140037010800630002f8290007ab50102002f829000001000133000000294001000000640002f9290007ac50203202f82902f929000002000344"},
532 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a40"},
533 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 > ] []",
537 procedureCode_t = 0x6
541 ProtocolIE_Container_elm
545 pLMN_Identity_t = 02 f8 29
547 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
548 ProtocolIE_Container_elm
556 pLMN_Identity_t = 02 f8 29
557 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
560 BroadcastPLMNs_Item_elm = 02 f8 29
565 uL_Transmission_Bandwidth_t = 0x3
566 dL_Transmission_Bandwidth_t = 0x3
568 ProtocolExtensionContainer_elm
571 Number-of-Antennaports = 0
576 pLMN_Identity_t = 02 f9 29
577 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
580 BroadcastPLMNs_Item_elm = 02 f8 29
581 BroadcastPLMNs_Item_elm = 02 f9 29
586 uL_Transmission_Bandwidth_t = 0x4
587 dL_Transmission_Bandwidth_t = 0x4
589 ProtocolExtensionContainer_elm
593 rootSequenceIndex_t = 0xf
594 zeroCorrelationIndex_t = 0x7
595 highSpeedFlag_t = true
596 prach_FreqOffset_t = 0x1e
599 packedPdu: "20060056000002001500090002f8298003007a4000140042010800630002f8290007ab50102002f829000001000133000000294001000800640002f9290007ac50203202f82902f92900000200034400000037400500000f79e0"},
601 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a40"},
602 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 > ] []",
606 procedureCode_t = 0x6
610 ProtocolIE_Container_elm
614 pLMN_Identity_t = 02 f8 29
616 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
617 ProtocolIE_Container_elm
625 pLMN_Identity_t = 02 f8 29
626 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
629 BroadcastPLMNs_Item_elm = 02 f8 29
634 uL_Transmission_Bandwidth_t = 0x3
635 dL_Transmission_Bandwidth_t = 0x3
637 ProtocolExtensionContainer_elm
640 Number-of-Antennaports = 0
645 pLMN_Identity_t = 02 f9 29
646 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
649 BroadcastPLMNs_Item_elm = 02 f8 29
650 BroadcastPLMNs_Item_elm = 02 f9 29
655 uL_Transmission_Bandwidth_t = 0x4
656 dL_Transmission_Bandwidth_t = 0x4
658 ProtocolExtensionContainer_elm
661 MBSFN-Subframe-Infolist:
662 MBSFN_Subframe_Infolist_elm
663 radioframeAllocationPeriod_t = 0x3
664 radioframeAllocationOffset_t = 0x3
665 subframeAllocation_t:
666 oneframe_t = 28 (6 bits)
668 packedPdu: "20060054000002001500090002f8298003007a4000140040010800630002f8290007ab50102002f829000001000133000000294001000800640002f9290007ac50203202f82902f929000002000344000000384003019850"},
669 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a40"},
670 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 ] []",
674 procedureCode_t = 0x6
678 ProtocolIE_Container_elm
682 pLMN_Identity_t = 02 f8 29
684 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
685 ProtocolIE_Container_elm
693 pLMN_Identity_t = 02 f8 29
694 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
697 BroadcastPLMNs_Item_elm = 02 f8 29
702 uL_Transmission_Bandwidth_t = 0x3
703 dL_Transmission_Bandwidth_t = 0x3
705 ProtocolExtensionContainer_elm
708 Number-of-Antennaports = 0
709 ProtocolExtensionContainer_elm
712 MBSFN-Subframe-Infolist:
713 MBSFN_Subframe_Infolist_elm
714 radioframeAllocationPeriod_t = 0x3
715 radioframeAllocationOffset_t = 0x3
716 subframeAllocation_t:
717 oneframe_t = 28 (6 bits)
722 pLMN_Identity_t = 02 f9 29
723 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
726 BroadcastPLMNs_Item_elm = 02 f8 29
727 BroadcastPLMNs_Item_elm = 02 f9 29
732 uL_Transmission_Bandwidth_t = 0x4
733 dL_Transmission_Bandwidth_t = 0x4
735 packedPdu: "20060052000002001500090002f8298003007a400014003e010800630002f8290007ab50102002f82900000100013300010029400100003840030198500000640002f9290007ac50203202f82902f929000002000344"},
736 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a40"},
737 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 ] []",
741 procedureCode_t = 0x6
745 ProtocolIE_Container_elm
749 pLMN_Identity_t = 02 f8 29
751 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
752 ProtocolIE_Container_elm
760 pLMN_Identity_t = 02 f8 29
761 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
764 BroadcastPLMNs_Item_elm = 02 f8 29
769 uL_Transmission_Bandwidth_t = 0x3
770 dL_Transmission_Bandwidth_t = 0x3
772 ProtocolExtensionContainer_elm
775 Number-of-Antennaports = 0
776 ProtocolExtensionContainer_elm
780 rootSequenceIndex_t = 0xf
781 zeroCorrelationIndex_t = 0x7
782 highSpeedFlag_t = true
783 prach_FreqOffset_t = 0x1e
788 pLMN_Identity_t = 02 f9 29
789 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
792 BroadcastPLMNs_Item_elm = 02 f8 29
793 BroadcastPLMNs_Item_elm = 02 f9 29
798 uL_Transmission_Bandwidth_t = 0x4
799 dL_Transmission_Bandwidth_t = 0x4
801 packedPdu: "20060054000002001500090002f8298003007a4000140040010800630002f8290007ab50102002f829000001000133000100294001000037400500000f79e00000640002f9290007ac50203202f82902f929000002000344"},
802 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a08"},
803 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 ] []",
807 procedureCode_t = 0x6
811 ProtocolIE_Container_elm
815 pLMN_Identity_t = 02 f8 29
817 long_Macro_eNB_ID_t = 00 7a 08 (21 bits)
818 ProtocolIE_Container_elm
826 pLMN_Identity_t = 02 f8 29
827 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
830 BroadcastPLMNs_Item_elm = 02 f8 29
835 uL_Transmission_Bandwidth_t = 0x3
836 dL_Transmission_Bandwidth_t = 0x3
838 ProtocolExtensionContainer_elm
842 rootSequenceIndex_t = 0xf
843 zeroCorrelationIndex_t = 0x7
844 highSpeedFlag_t = true
845 prach_FreqOffset_t = 0x1e
846 prach_ConfigIndex_t = 0x3c
851 pLMN_Identity_t = 02 f9 29
852 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
855 BroadcastPLMNs_Item_elm = 02 f8 29
856 BroadcastPLMNs_Item_elm = 02 f9 29
861 uL_Transmission_Bandwidth_t = 0x4
862 dL_Transmission_Bandwidth_t = 0x4
864 //packedPdu: "20060050000002001500090002f8298103007a080014003c010800630002f8290007ab50102002f82900000100013300000037400640000f79ef000000640002f9290007ac50203202f82902f929000002000344"},
865 packedPdu: "20060050000002001500090002f829c003007a080014003c010800630002f8290007ab50102002f82900000100013300000037400640000f79ef000000640002f9290007ac50203202f82902f929000002000344"},
867 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
868 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 ] []",
872 procedureCode_t = 0x6
876 ProtocolIE_Container_elm
880 pLMN_Identity_t = 02 f8 29
882 macro_eNB_ID_t = 00 7a 80 (20 bits)
883 ProtocolIE_Container_elm
891 pLMN_Identity_t = 02 f8 29
892 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
895 BroadcastPLMNs_Item_elm = 02 f8 29
900 uL_Transmission_Bandwidth_t = 0x3
901 dL_Transmission_Bandwidth_t = 0x3
903 ProtocolExtensionContainer_elm
906 CSG-Id = 00 07 ab a0 (27 bits)
907 ProtocolExtensionContainer_elm
910 FreqBandIndicatorPriority = 0x1
911 ProtocolExtensionContainer_elm
914 BandwidthReducedSI = 0
916 packedPdu: "2006003e000002001500080002f82900007a800014002b000800630002f8290007ab50102002f8290000010001330002004640040007aba000a040014000b4400100"},
918 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
919 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 ] []",
923 procedureCode_t = 0x6
927 ProtocolIE_Container_elm
931 pLMN_Identity_t = 02 f8 29
933 macro_eNB_ID_t = 00 7a 80 (20 bits)
934 ProtocolIE_Container_elm
942 pLMN_Identity_t = 02 f8 29
943 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
946 BroadcastPLMNs_Item_elm = 02 f8 29
951 uL_Transmission_Bandwidth_t = 0x3
952 dL_Transmission_Bandwidth_t = 0x3
954 ProtocolExtensionContainer_elm
957 MBMS-Service-Area-Identity-List:
958 MBMS_Service_Area_Identity_List_elm = 02 f8
959 MBMS_Service_Area_Identity_List_elm = 03 f9
960 ProtocolExtensionContainer_elm
963 FreqBandIndicatorPriority = 0
964 ProtocolExtensionContainer_elm
968 MultibandInfoList_elm
969 freqBandIndicator_t = 0x1
970 MultibandInfoList_elm
971 freqBandIndicator_t = 0x2
972 MultibandInfoList_elm
973 freqBandIndicator_t = 0x3
975 packedPdu: "20060044000002001500080002f82900007a8000140031000800630002f8290007ab50102002f8290000010001330002004f40050102f803f900a040010000544006200000010002"},
976 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
977 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 > ] []",
981 procedureCode_t = 0x6
985 ProtocolIE_Container_elm
989 pLMN_Identity_t = 02 f8 29
991 macro_eNB_ID_t = 00 7a 80 (20 bits)
992 ProtocolIE_Container_elm
1000 pLMN_Identity_t = 02 f8 29
1001 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1004 BroadcastPLMNs_Item_elm = 02 f8 29
1009 uL_Transmission_Bandwidth_t = 0x3
1010 dL_Transmission_Bandwidth_t = 0x3
1012 Neighbour_Information_elm
1014 pLMN_Identity_t = 02 f8 29
1015 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1018 Neighbour_Information_elm
1020 pLMN_Identity_t = 03 f9 30
1021 eUTRANcellIdentifier_t = 00 08 bc 50 (28 bits)
1025 packedPdu: "20060044000002001500080002f82900007a8000140031004000630002f8290007ab50102002f82900000100013300020002f8290007ab50006300010003f9300008bc5000640002"},
1027 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
1028 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 > ] []",
1032 procedureCode_t = 0x6
1036 ProtocolIE_Container_elm
1040 pLMN_Identity_t = 02 f8 29
1042 macro_eNB_ID_t = 00 7a 80 (20 bits)
1043 ProtocolIE_Container_elm
1051 pLMN_Identity_t = 02 f8 29
1052 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1055 BroadcastPLMNs_Item_elm = 02 f8 29
1060 uL_Transmission_Bandwidth_t = 0x3
1061 dL_Transmission_Bandwidth_t = 0x3
1063 Neighbour_Information_elm
1065 pLMN_Identity_t = 02 f8 29
1066 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1070 ProtocolExtensionContainer_elm
1074 Neighbour_Information_elm
1076 pLMN_Identity_t = 03 f9 30
1077 eUTRANcellIdentifier_t = 00 08 bc 50 (28 bits)
1081 ProtocolExtensionContainer_elm
1084 EARFCNExtension = 0x3
1086 packedPdu: "20060055000002001500080002f82900007a8000140042004000630002f8290007ab50102002f82900000100013300024002f8290007ab50006300010000004c400201024003f9300008bc50006400020000005e0003800103"},
1088 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
1089 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 > ] []",
1093 procedureCode_t = 0x6
1097 ProtocolIE_Container_elm
1101 pLMN_Identity_t = 02 f8 29
1103 macro_eNB_ID_t = 00 7a 80 (20 bits)
1104 ProtocolIE_Container_elm
1112 pLMN_Identity_t = 02 f8 29
1113 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1116 BroadcastPLMNs_Item_elm = 02 f8 29
1121 uL_Transmission_Bandwidth_t = 0x3
1122 dL_Transmission_Bandwidth_t = 0x3
1124 Neighbour_Information_elm
1126 pLMN_Identity_t = 02 f8 29
1127 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1131 ProtocolExtensionContainer_elm
1135 Neighbour_Information_elm
1137 pLMN_Identity_t = 03 f9 30
1138 eUTRANcellIdentifier_t = 00 08 bc 50 (28 bits)
1142 ProtocolExtensionContainer_elm
1145 EARFCNExtension = 0x3
1147 packedPdu: "20060055000002001500080002f82900007a8000140042004000630002f8290007ab50102002f82900000100013300024002f8290007ab50006300010000004c400201024003f9300008bc50006400020000005e0003800103",
1148 /*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),*/},
1152 for _, tc := range testCases {
1153 t.Run(tc.packedPdu, func(t *testing.T) {
1156 _, err := fmt.Sscanf(tc.packedPdu, "%x", &payload)
1158 t.Errorf("convert inputPayloadAsStr to payloadAsByte. Error: %v\n", err)
1161 key, enb, err := unpackX2SetupResponseAndExtract(logger, MaxAsn1CodecAllocationBufferSize /*allocation buffer*/, len(payload), payload, MaxAsn1CodecMessageBufferSize /*message buffer*/)
1164 if tc.failure == nil {
1165 t.Errorf("want: success, got: error: %v\n", err)
1167 if strings.Compare(err.Error(), tc.failure.Error()) != 0 {
1168 t.Errorf("want: %s, got: %s", tc.failure, err)
1174 if tc.failure == nil {
1175 t.Errorf("want: key=%v, got: empty key", tc.key)
1178 if strings.Compare(key.PlmnId, tc.key.PlmnId) != 0 || strings.Compare(key.NbId, tc.key.NbId) != 0 {
1179 t.Errorf("want: key=%s, got: %s", tc.key, key)
1184 if tc.failure == nil {
1185 t.Errorf("want: enb=%s, got: empty enb", tc.enb)
1188 nb := &entities.NodebInfo{}
1189 nb.ConnectionStatus = entities.ConnectionStatus_CONNECTED
1190 nb.Configuration = &entities.NodebInfo_Enb{Enb:enb}
1191 embStr := fmt.Sprintf("%s %s %s %s", nb.ConnectionStatus, enb.EnbType, enb.ServedCells, enb.GuGroupIds)
1192 if !strings.EqualFold(embStr, tc.enb) {
1193 t.Errorf("want: enb=%s, got: %s", tc.enb, embStr)
1199 rNibWriter.Init("e2Manager", 1)
1202 nbIdentity := &entities.NbIdentity{InventoryName:"RanName", GlobalNbId:key}
1203 if rNibErr := rNibWriter.GetRNibWriter().SaveNodeb(nbIdentity, nb); rNibErr != nil {
1204 if tc.failure == nil {
1205 t.Errorf("rNibWriter failed to save ENB. Error: %s\n", rNibErr.Error())
1207 if strings.Compare(rNibErr.Error(), tc.failure.Error()) != 0 {
1208 t.Errorf("want: %s, got: %s", tc.failure, rNibErr.Error())