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 *******************************************************************************/
25 "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
31 Test permutations of x2 setup response to protobuf enb
34 func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
35 logger, _ := logger.InitLogger(logger.InfoLevel)
37 var testCases = []struct {
39 key *entities.GlobalNbId
45 saveToRNib: false, //TODO: use MOCK?
46 key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
47 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 ] []",
55 ProtocolIE_Container_elm
59 pLMN_Identity_t = 02 f8 29
61 macro_eNB_ID_t = 00 7a 80 (20 bits)
62 ProtocolIE_Container_elm
70 pLMN_Identity_t = 02 f8 29
71 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
74 BroadcastPLMNs_Item_elm = 02 f8 29
79 uL_Transmission_Bandwidth_t = 0x3
80 dL_Transmission_Bandwidth_t = 0x3`
82 packedPdu: "2006002a000002001500080002f82900007a8000140017000000630002f8290007ab50102002f829000001000133"},
84 key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
85 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 ] []",
93 ProtocolIE_Container_elm
97 pLMN_Identity_t = 02 f8 29
99 macro_eNB_ID_t = 00 7a 80 (20 bits)
100 ProtocolIE_Container_elm
108 pLMN_Identity_t = 02 f8 29
109 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
112 BroadcastPLMNs_Item_elm = 02 f8 29
117 uL_Transmission_Bandwidth_t = 0x3
118 dL_Transmission_Bandwidth_t = 0x3
123 pLMN_Identity_t = 02 f9 29
124 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
127 BroadcastPLMNs_Item_elm = 02 f8 29
128 BroadcastPLMNs_Item_elm = 02 f9 29
133 uL_Transmission_Bandwidth_t = 0x4
134 dL_Transmission_Bandwidth_t = 0x4
136 packedPdu: "20060043000002001500080002f82900007a8000140030010000630002f8290007ab50102002f8290000010001330000640002f9290007ac50203202f82902f929000002000344"},
138 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
139 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 ] []",
143 procedureCode_t = 0x6
147 ProtocolIE_Container_elm
151 pLMN_Identity_t = 02 f8 29
153 macro_eNB_ID_t = 00 7a 80 (20 bits)
154 ProtocolIE_Container_elm
162 pLMN_Identity_t = 02 f8 29
163 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
166 BroadcastPLMNs_Item_elm = 02 f8 29
171 uL_Transmission_Bandwidth_t = 0x3
172 dL_Transmission_Bandwidth_t = 0x3
174 ProtocolExtensionContainer_elm
175 id_t = 0x5f //ul_EARFCN
177 EARFCNExtension = 0x2
179 packedPdu: "20060033000002001500080002f82900007a8000140020000000630002f8290007ab50102002f8291000010001330000005f0003800102"},
180 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
181 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]",
185 procedureCode_t = 0x6
189 ProtocolIE_Container_elm
193 pLMN_Identity_t = 02 f8 29
195 macro_eNB_ID_t = 00 7a 80 (20 bits)
196 ProtocolIE_Container_elm
204 pLMN_Identity_t = 02 f8 29
205 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
208 BroadcastPLMNs_Item_elm = 02 f8 29
213 uL_Transmission_Bandwidth_t = 0x3
214 dL_Transmission_Bandwidth_t = 0x3
215 ProtocolIE_Container_elm
220 pLMN_Identity_t = 02 f7 29
221 mME_Group_ID_t = 02 03
223 pLMN_Identity_t = 02 f9 29
224 mME_Group_ID_t = 03 04
226 packedPdu: "2006003a000003001500080002f82900007a8000140017000000630002f8290007ab50102002f8290000010001330018000c1002f72902030002f9290304"},
228 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
229 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 ] []",
233 procedureCode_t = 0x6
237 ProtocolIE_Container_elm
241 pLMN_Identity_t = 02 f8 29
243 macro_eNB_ID_t = 00 7a 80 (20 bits)
244 ProtocolIE_Container_elm
252 pLMN_Identity_t = 02 f8 29
253 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
256 BroadcastPLMNs_Item_elm = 02 f8 29
260 transmission_Bandwidth_t = 0x3
261 subframeAssignment_t = 0x2
262 specialSubframe_Info_t
263 specialSubframePatterns_t = 0x4
265 cyclicPrefixUL_t = 0x1
267 packedPdu: "2006002a000002001500080002f82900007a8000140017000000630002f8290007ab50102002f829400001320820"},
268 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
269 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 ] []",
273 procedureCode_t = 0x6
277 ProtocolIE_Container_elm
281 pLMN_Identity_t = 02 f8 29
283 macro_eNB_ID_t = 00 7a 80 (20 bits)
284 ProtocolIE_Container_elm
292 pLMN_Identity_t = 02 f8 29
293 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
296 BroadcastPLMNs_Item_elm = 02 f8 29
300 transmission_Bandwidth_t = 0x3
301 subframeAssignment_t = 0x2
302 specialSubframe_Info_t
303 specialSubframePatterns_t = 0x4
304 cyclicPrefixDL_t = 0x1
307 ProtocolExtensionContainer_elm
310 AdditionalSpecialSubframe-Info
311 additionalspecialSubframePatterns_t = 0x9
313 cyclicPrefixUL_t = 0x1
315 packedPdu: "20060032000002001500080002f82900007a800014001f000000630002f8290007ab50102002f8295000013208800000006140021220"},
317 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
318 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 ] []",
322 procedureCode_t = 0x6
326 ProtocolIE_Container_elm
330 pLMN_Identity_t = 02 f8 29
332 macro_eNB_ID_t = 00 7a 80 (20 bits)
333 ProtocolIE_Container_elm
341 pLMN_Identity_t = 02 f8 29
342 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
345 BroadcastPLMNs_Item_elm = 02 f8 29
349 transmission_Bandwidth_t = 0x3
350 subframeAssignment_t = 0x2
351 specialSubframe_Info_t
352 specialSubframePatterns_t = 0x4
353 cyclicPrefixDL_t = 0x1
356 ProtocolExtensionContainer_elm
359 EARFCNExtension = 0x2
361 packedPdu: "20060033000002001500080002f82900007a8000140020000000630002f8290007ab50102002f8295000013208800000005e0003800102"},
363 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
364 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 ] []",
368 procedureCode_t = 0x6
372 ProtocolIE_Container_elm
376 pLMN_Identity_t = 02 f8 29
378 macro_eNB_ID_t = 00 7a 80 (20 bits)
379 ProtocolIE_Container_elm
387 pLMN_Identity_t = 02 f8 29
388 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
391 BroadcastPLMNs_Item_elm = 02 f8 29
395 transmission_Bandwidth_t = 0x3
396 subframeAssignment_t = 0x2
397 specialSubframe_Info_t
398 specialSubframePatterns_t = 0x4
399 cyclicPrefixDL_t = 0x1
402 ProtocolExtensionContainer_elm
405 AdditionalSpecialSubframeExtension-Info
406 additionalspecialSubframePatternsExtension_t = 0
410 packedPdu: "20060031000002001500080002f82900007a800014001e000000630002f8290007ab50102002f829500001320880000000b3400100"},
412 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
413 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 ] []",
417 procedureCode_t = 0x6
421 ProtocolIE_Container_elm
425 pLMN_Identity_t = 02 f8 29
427 macro_eNB_ID_t = 00 7a 80 (20 bits)
428 ProtocolIE_Container_elm
436 pLMN_Identity_t = 02 f8 29
437 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
440 BroadcastPLMNs_Item_elm = 02 f8 29
444 transmission_Bandwidth_t = 0x3
445 subframeAssignment_t = 0x2
446 specialSubframe_Info_t
447 specialSubframePatterns_t = 0x4
448 cyclicPrefixDL_t = 0x1
451 ProtocolExtensionContainer_elm
454 AdditionalSpecialSubframeExtension-Info
455 additionalspecialSubframePatternsExtension_t = 0
458 ProtocolExtensionContainer_elm
461 AdditionalSpecialSubframe-Info
462 additionalspecialSubframePatterns_t = 0x9
464 cyclicPrefixUL_t = 0x1
465 ProtocolExtensionContainer_elm
468 EARFCNExtension = 0x2
471 packedPdu: "2006003e000002001500080002f82900007a800014002b000000630002f8290007ab50102002f829500001320880000200b3400100006140021220005e0003800102"},
473 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80b0"},
474 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 ] []",
478 procedureCode_t = 0x6
482 ProtocolIE_Container_elm
486 pLMN_Identity_t = 02 f8 29
488 home_eNB_ID_t = 00 7a 80 b0 (28 bits)
489 ProtocolIE_Container_elm
497 pLMN_Identity_t = 02 f8 29
498 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
501 BroadcastPLMNs_Item_elm = 02 f8 29
506 uL_Transmission_Bandwidth_t = 0x3
507 dL_Transmission_Bandwidth_t = 0x3
509 ProtocolExtensionContainer_elm
512 Number-of-Antennaports = 0
517 pLMN_Identity_t = 02 f9 29
518 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
521 BroadcastPLMNs_Item_elm = 02 f8 29
522 BroadcastPLMNs_Item_elm = 02 f9 29
523 eUTRA_Mode_Info_t:nb_id
527 uL_Transmission_Bandwidth_t = 0x4
528 dL_Transmission_Bandwidth_t = 0x4
531 packedPdu: "2006004b000002001500090002f82940007a80b000140037010800630002f8290007ab50102002f829000001000133000000294001000000640002f9290007ac50203202f82902f929000002000344"},
533 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a40"},
534 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 > ] []",
538 procedureCode_t = 0x6
542 ProtocolIE_Container_elm
546 pLMN_Identity_t = 02 f8 29
548 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
549 ProtocolIE_Container_elm
557 pLMN_Identity_t = 02 f8 29
558 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
561 BroadcastPLMNs_Item_elm = 02 f8 29
566 uL_Transmission_Bandwidth_t = 0x3
567 dL_Transmission_Bandwidth_t = 0x3
569 ProtocolExtensionContainer_elm
572 Number-of-Antennaports = 0
577 pLMN_Identity_t = 02 f9 29
578 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
581 BroadcastPLMNs_Item_elm = 02 f8 29
582 BroadcastPLMNs_Item_elm = 02 f9 29
587 uL_Transmission_Bandwidth_t = 0x4
588 dL_Transmission_Bandwidth_t = 0x4
590 ProtocolExtensionContainer_elm
594 rootSequenceIndex_t = 0xf
595 zeroCorrelationIndex_t = 0x7
596 highSpeedFlag_t = true
597 prach_FreqOffset_t = 0x1e
600 packedPdu: "20060056000002001500090002f8298003007a4000140042010800630002f8290007ab50102002f829000001000133000000294001000800640002f9290007ac50203202f82902f92900000200034400000037400500000f79e0"},
602 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a40"},
603 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 > ] []",
607 procedureCode_t = 0x6
611 ProtocolIE_Container_elm
615 pLMN_Identity_t = 02 f8 29
617 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
618 ProtocolIE_Container_elm
626 pLMN_Identity_t = 02 f8 29
627 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
630 BroadcastPLMNs_Item_elm = 02 f8 29
635 uL_Transmission_Bandwidth_t = 0x3
636 dL_Transmission_Bandwidth_t = 0x3
638 ProtocolExtensionContainer_elm
641 Number-of-Antennaports = 0
646 pLMN_Identity_t = 02 f9 29
647 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
650 BroadcastPLMNs_Item_elm = 02 f8 29
651 BroadcastPLMNs_Item_elm = 02 f9 29
656 uL_Transmission_Bandwidth_t = 0x4
657 dL_Transmission_Bandwidth_t = 0x4
659 ProtocolExtensionContainer_elm
662 MBSFN-Subframe-Infolist:
663 MBSFN_Subframe_Infolist_elm
664 radioframeAllocationPeriod_t = 0x3
665 radioframeAllocationOffset_t = 0x3
666 subframeAllocation_t:
667 oneframe_t = 28 (6 bits)
669 packedPdu: "20060054000002001500090002f8298003007a4000140040010800630002f8290007ab50102002f829000001000133000000294001000800640002f9290007ac50203202f82902f929000002000344000000384003019850"},
670 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a40"},
671 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 ] []",
675 procedureCode_t = 0x6
679 ProtocolIE_Container_elm
683 pLMN_Identity_t = 02 f8 29
685 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
686 ProtocolIE_Container_elm
694 pLMN_Identity_t = 02 f8 29
695 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
698 BroadcastPLMNs_Item_elm = 02 f8 29
703 uL_Transmission_Bandwidth_t = 0x3
704 dL_Transmission_Bandwidth_t = 0x3
706 ProtocolExtensionContainer_elm
709 Number-of-Antennaports = 0
710 ProtocolExtensionContainer_elm
713 MBSFN-Subframe-Infolist:
714 MBSFN_Subframe_Infolist_elm
715 radioframeAllocationPeriod_t = 0x3
716 radioframeAllocationOffset_t = 0x3
717 subframeAllocation_t:
718 oneframe_t = 28 (6 bits)
723 pLMN_Identity_t = 02 f9 29
724 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
727 BroadcastPLMNs_Item_elm = 02 f8 29
728 BroadcastPLMNs_Item_elm = 02 f9 29
733 uL_Transmission_Bandwidth_t = 0x4
734 dL_Transmission_Bandwidth_t = 0x4
736 packedPdu: "20060052000002001500090002f8298003007a400014003e010800630002f8290007ab50102002f82900000100013300010029400100003840030198500000640002f9290007ac50203202f82902f929000002000344"},
737 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a40"},
738 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 ] []",
742 procedureCode_t = 0x6
746 ProtocolIE_Container_elm
750 pLMN_Identity_t = 02 f8 29
752 short_Macro_eNB_ID_t = 00 7a 40 (18 bits)
753 ProtocolIE_Container_elm
761 pLMN_Identity_t = 02 f8 29
762 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
765 BroadcastPLMNs_Item_elm = 02 f8 29
770 uL_Transmission_Bandwidth_t = 0x3
771 dL_Transmission_Bandwidth_t = 0x3
773 ProtocolExtensionContainer_elm
776 Number-of-Antennaports = 0
777 ProtocolExtensionContainer_elm
781 rootSequenceIndex_t = 0xf
782 zeroCorrelationIndex_t = 0x7
783 highSpeedFlag_t = true
784 prach_FreqOffset_t = 0x1e
789 pLMN_Identity_t = 02 f9 29
790 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
793 BroadcastPLMNs_Item_elm = 02 f8 29
794 BroadcastPLMNs_Item_elm = 02 f9 29
799 uL_Transmission_Bandwidth_t = 0x4
800 dL_Transmission_Bandwidth_t = 0x4
802 packedPdu: "20060054000002001500090002f8298003007a4000140040010800630002f8290007ab50102002f829000001000133000100294001000037400500000f79e00000640002f9290007ac50203202f82902f929000002000344"},
803 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a08"},
804 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 ] []",
808 procedureCode_t = 0x6
812 ProtocolIE_Container_elm
816 pLMN_Identity_t = 02 f8 29
818 long_Macro_eNB_ID_t = 00 7a 08 (21 bits)
819 ProtocolIE_Container_elm
827 pLMN_Identity_t = 02 f8 29
828 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
831 BroadcastPLMNs_Item_elm = 02 f8 29
836 uL_Transmission_Bandwidth_t = 0x3
837 dL_Transmission_Bandwidth_t = 0x3
839 ProtocolExtensionContainer_elm
843 rootSequenceIndex_t = 0xf
844 zeroCorrelationIndex_t = 0x7
845 highSpeedFlag_t = true
846 prach_FreqOffset_t = 0x1e
847 prach_ConfigIndex_t = 0x3c
852 pLMN_Identity_t = 02 f9 29
853 eUTRANcellIdentifier_t = 00 07 ac 50 (28 bits)
856 BroadcastPLMNs_Item_elm = 02 f8 29
857 BroadcastPLMNs_Item_elm = 02 f9 29
862 uL_Transmission_Bandwidth_t = 0x4
863 dL_Transmission_Bandwidth_t = 0x4
865 //packedPdu: "20060050000002001500090002f8298103007a080014003c010800630002f8290007ab50102002f82900000100013300000037400640000f79ef000000640002f9290007ac50203202f82902f929000002000344"},
866 packedPdu: "20060050000002001500090002f829c003007a080014003c010800630002f8290007ab50102002f82900000100013300000037400640000f79ef000000640002f9290007ac50203202f82902f929000002000344"},
868 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
869 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 ] []",
873 procedureCode_t = 0x6
877 ProtocolIE_Container_elm
881 pLMN_Identity_t = 02 f8 29
883 macro_eNB_ID_t = 00 7a 80 (20 bits)
884 ProtocolIE_Container_elm
892 pLMN_Identity_t = 02 f8 29
893 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
896 BroadcastPLMNs_Item_elm = 02 f8 29
901 uL_Transmission_Bandwidth_t = 0x3
902 dL_Transmission_Bandwidth_t = 0x3
904 ProtocolExtensionContainer_elm
907 CSG-Id = 00 07 ab a0 (27 bits)
908 ProtocolExtensionContainer_elm
911 FreqBandIndicatorPriority = 0x1
912 ProtocolExtensionContainer_elm
915 BandwidthReducedSI = 0
917 packedPdu: "2006003e000002001500080002f82900007a800014002b000800630002f8290007ab50102002f8290000010001330002004640040007aba000a040014000b4400100"},
919 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
920 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 ] []",
924 procedureCode_t = 0x6
928 ProtocolIE_Container_elm
932 pLMN_Identity_t = 02 f8 29
934 macro_eNB_ID_t = 00 7a 80 (20 bits)
935 ProtocolIE_Container_elm
943 pLMN_Identity_t = 02 f8 29
944 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
947 BroadcastPLMNs_Item_elm = 02 f8 29
952 uL_Transmission_Bandwidth_t = 0x3
953 dL_Transmission_Bandwidth_t = 0x3
955 ProtocolExtensionContainer_elm
958 MBMS-Service-Area-Identity-List:
959 MBMS_Service_Area_Identity_List_elm = 02 f8
960 MBMS_Service_Area_Identity_List_elm = 03 f9
961 ProtocolExtensionContainer_elm
964 FreqBandIndicatorPriority = 0
965 ProtocolExtensionContainer_elm
969 MultibandInfoList_elm
970 freqBandIndicator_t = 0x1
971 MultibandInfoList_elm
972 freqBandIndicator_t = 0x2
973 MultibandInfoList_elm
974 freqBandIndicator_t = 0x3
976 packedPdu: "20060044000002001500080002f82900007a8000140031000800630002f8290007ab50102002f8290000010001330002004f40050102f803f900a040010000544006200000010002"},
977 { key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
978 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 > ] []",
982 procedureCode_t = 0x6
986 ProtocolIE_Container_elm
990 pLMN_Identity_t = 02 f8 29
992 macro_eNB_ID_t = 00 7a 80 (20 bits)
993 ProtocolIE_Container_elm
1001 pLMN_Identity_t = 02 f8 29
1002 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1005 BroadcastPLMNs_Item_elm = 02 f8 29
1010 uL_Transmission_Bandwidth_t = 0x3
1011 dL_Transmission_Bandwidth_t = 0x3
1013 Neighbour_Information_elm
1015 pLMN_Identity_t = 02 f8 29
1016 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1019 Neighbour_Information_elm
1021 pLMN_Identity_t = 03 f9 30
1022 eUTRANcellIdentifier_t = 00 08 bc 50 (28 bits)
1026 packedPdu: "20060044000002001500080002f82900007a8000140031004000630002f8290007ab50102002f82900000100013300020002f8290007ab50006300010003f9300008bc5000640002"},
1028 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
1029 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 > ] []",
1033 procedureCode_t = 0x6
1037 ProtocolIE_Container_elm
1041 pLMN_Identity_t = 02 f8 29
1043 macro_eNB_ID_t = 00 7a 80 (20 bits)
1044 ProtocolIE_Container_elm
1052 pLMN_Identity_t = 02 f8 29
1053 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1056 BroadcastPLMNs_Item_elm = 02 f8 29
1061 uL_Transmission_Bandwidth_t = 0x3
1062 dL_Transmission_Bandwidth_t = 0x3
1064 Neighbour_Information_elm
1066 pLMN_Identity_t = 02 f8 29
1067 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1071 ProtocolExtensionContainer_elm
1075 Neighbour_Information_elm
1077 pLMN_Identity_t = 03 f9 30
1078 eUTRANcellIdentifier_t = 00 08 bc 50 (28 bits)
1082 ProtocolExtensionContainer_elm
1085 EARFCNExtension = 0x3
1087 packedPdu: "20060055000002001500080002f82900007a8000140042004000630002f8290007ab50102002f82900000100013300024002f8290007ab50006300010000004c400201024003f9300008bc50006400020000005e0003800103"},
1089 {key: &entities.GlobalNbId{PlmnId:"02f829", NbId:"007a80"},
1090 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 > ] []",
1094 procedureCode_t = 0x6
1098 ProtocolIE_Container_elm
1102 pLMN_Identity_t = 02 f8 29
1104 macro_eNB_ID_t = 00 7a 80 (20 bits)
1105 ProtocolIE_Container_elm
1113 pLMN_Identity_t = 02 f8 29
1114 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1117 BroadcastPLMNs_Item_elm = 02 f8 29
1122 uL_Transmission_Bandwidth_t = 0x3
1123 dL_Transmission_Bandwidth_t = 0x3
1125 Neighbour_Information_elm
1127 pLMN_Identity_t = 02 f8 29
1128 eUTRANcellIdentifier_t = 00 07 ab 50 (28 bits)
1132 ProtocolExtensionContainer_elm
1136 Neighbour_Information_elm
1138 pLMN_Identity_t = 03 f9 30
1139 eUTRANcellIdentifier_t = 00 08 bc 50 (28 bits)
1143 ProtocolExtensionContainer_elm
1146 EARFCNExtension = 0x3
1148 packedPdu: "20060055000002001500080002f82900007a8000140042004000630002f8290007ab50102002f82900000100013300024002f8290007ab50006300010000004c400201024003f9300008bc50006400020000005e0003800103",
1149 /*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 for _, tc := range testCases {
1154 t.Run(tc.packedPdu, func(t *testing.T) {
1157 _, err := fmt.Sscanf(tc.packedPdu, "%x", &payload)
1159 t.Errorf("convert inputPayloadAsStr to payloadAsByte. Error: %v\n", err)
1162 key, enb, err := UnpackX2SetupResponseAndExtract(logger, e2pdus.MaxAsn1CodecAllocationBufferSize, len(payload), payload, e2pdus.MaxAsn1CodecMessageBufferSize /*message buffer*/)
1165 if tc.failure == nil {
1166 t.Errorf("want: success, got: error: %v\n", err)
1168 if strings.Compare(err.Error(), tc.failure.Error()) != 0 {
1169 t.Errorf("want: %s, got: %s", tc.failure, err)
1175 if tc.failure == nil {
1176 t.Errorf("want: key=%v, got: empty key", tc.key)
1179 if strings.Compare(key.PlmnId, tc.key.PlmnId) != 0 || strings.Compare(key.NbId, tc.key.NbId) != 0 {
1180 t.Errorf("want: key=%s, got: %s", tc.key, key)
1185 if tc.failure == nil {
1186 t.Errorf("want: enb=%s, got: empty enb", tc.enb)
1189 nb := &entities.NodebInfo{}
1190 nb.ConnectionStatus = entities.ConnectionStatus_CONNECTED
1191 nb.Configuration = &entities.NodebInfo_Enb{Enb:enb}
1192 embStr := fmt.Sprintf("%s %s %s %s", nb.ConnectionStatus, enb.EnbType, enb.ServedCells, enb.GuGroupIds)
1193 if !strings.EqualFold(embStr, tc.enb) {
1194 t.Errorf("want: enb=%s, got: %s", tc.enb, embStr)
1200 rNibWriter.Init("e2Manager", 1)
1203 nbIdentity := &entities.NbIdentity{InventoryName:"RanName", GlobalNbId:key}
1204 if rNibErr := rNibWriter.GetRNibWriter().SaveNodeb(nbIdentity, nb); rNibErr != nil {
1205 if tc.failure == nil {
1206 t.Errorf("rNibWriter failed to save ENB. Error: %s\n", rNibErr.Error())
1208 if strings.Compare(rNibErr.Error(), tc.failure.Error()) != 0 {
1209 t.Errorf("want: %s, got: %s", tc.failure, rNibErr.Error())