[RIC-384] Unmarshal Ran Functions and populate proto 45/3845/3
authoridanshal <idan.shalom@intl.att.com>
Tue, 26 May 2020 11:00:14 +0000 (14:00 +0300)
committerIdan Shalom <idan.shalom@intl.att.com>
Tue, 26 May 2020 11:37:15 +0000 (11:37 +0000)
Change-Id: I2863a5c3b019a318b819a91e31c028d1486bb3b7
Signed-off-by: idanshal <idan.shalom@intl.att.com>
14 files changed:
.gitreview
Automation/Tests/Get_E2T_Instances/get_e2t_instances.robot
Automation/Tests/Scripts/e2mdbscripts.py
E2Manager/container-tag.yaml
E2Manager/converters/endc_setup_failure_response_converter_test.go
E2Manager/converters/endc_setup_response_converter_test.go
E2Manager/converters/x2_setup_failure_response_converter_test.go
E2Manager/converters/x2_setup_response_converter_test.go
E2Manager/go.mod
E2Manager/go.sum
E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go
E2Manager/models/e2_setup_request_message.go
E2Manager/models/e2_setup_response_message.go
E2Manager/rNibWriter/rNibWriter_test.go

index 5de862e..a007eed 100644 (file)
@@ -2,5 +2,5 @@
 host=gerrit.o-ran-sc.org
 port=29418
 project=ric-plt/e2mgr
-defaultbranch=master
+defaultbranch=PI5
 
index 09bc6ca..4f580c0 100644 (file)
@@ -37,7 +37,7 @@ Get E2T instances
     ${headers}=  Create Dictionary    Accept=application/json
     ${resp}=    Get Request   getE2tInstances     /v1/e2t/list    headers=${headers}
     Should Be Equal As Strings   ${resp.status_code}    200
-    Should Be Equal As Strings    ${resp.content}        [{"e2tAddress":"e2t.att.com:38000","ranNames":["test1","test2","test3"]},{"e2tAddress":"e2t.att.com:38001","ranNames":[]}]
+    Should Be Equal As Strings    ${resp.content}        [{"e2tAddress":"e2t.att.com:38000","ranNames":["test1","test2","test3"]}]
     ${flush}  cleanup_db.flush
 
 
index b452b93..b671cd5 100644 (file)
@@ -52,9 +52,8 @@ def verify_e2t_instance_key_exists(e2tAddress):
 
 def populate_e2t_instances_in_e2m_db_for_get_e2t_instances_tc():
     r = getRedisClientDecodeResponse()
-    r.set("{e2Manager},E2TAddresses", "[\"e2t.att.com:38000\",\"e2t.att.com:38001\"]")
+    r.set("{e2Manager},E2TAddresses", "[\"e2t.att.com:38000\"]")
     r.set("{e2Manager},E2TInstance:e2t.att.com:38000", "{\"address\":\"e2t.att.com:38000\",\"associatedRanList\":[\"test1\",\"test2\",\"test3\"],\"keepAliveTimestamp\":1577619310484022369,\"state\":\"ACTIVE\"}")
-    r.set("{e2Manager},E2TInstance:e2t.att.com:38001", "{\"address\":\"e2t.att.com:38001\",\"associatedRanList\":[],\"keepAliveTimestamp\":1577619310484022369,\"state\":\"ACTIVE\"}")
     return True
 
 # def dissociate_ran_from_e2tInstance(ranName, e2tAddress):
index 4491f06..3188b04 100644 (file)
@@ -1,4 +1,4 @@
 # The Jenkins job requires a tag to build the Docker image.
 # Global-JJB script assumes this file is in the repo root.
 ---
-tag: 4.4.10
+tag: 5.0.1
index 77c60b5..ac5aa52 100644 (file)
@@ -25,6 +25,7 @@ import (
        "e2mgr/logger"
        "fmt"
        "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+       "regexp"
        "strings"
        "testing"
 )
@@ -42,7 +43,7 @@ func TestUnpackEndcX2SetupFailureResponseAndExtract(t *testing.T) {
                failure   error
        }{
                {
-                       response: "CONNECTED_SETUP_FAILED network_layer_cause:HANDOVER_DESIRABLE_FOR_RADIO_REASONS time_to_wait:V1S criticality_diagnostics:<procedure_code:33 triggering_message:UNSUCCESSFUL_OUTCOME procedure_criticality:NOTIFY information_element_criticality_diagnostics:<ie_criticality:REJECT ie_id:128 type_of_error:MISSING > > ",
+                       response: "CONNECTED_SETUP_FAILED network_layer_cause:HANDOVER_DESIRABLE_FOR_RADIO_REASONS  time_to_wait:V1S  criticality_diagnostics:{procedure_code:33  triggering_message:UNSUCCESSFUL_OUTCOME  procedure_criticality:NOTIFY  information_element_criticality_diagnostics:{ie_criticality:REJECT  ie_id:128  type_of_error:MISSING}}",
                        /*
                                E2AP-PDU:
                                 unsuccessfulOutcome_t
@@ -110,10 +111,14 @@ func TestUnpackEndcX2SetupFailureResponseAndExtract(t *testing.T) {
                                nb.SetupFailure = response
                                nb.FailureType = entities.Failure_X2_SETUP_FAILURE
                                respStr := fmt.Sprintf("%s %s", nb.ConnectionStatus, response)
-                               if !strings.EqualFold(respStr, tc.response) {
-                                       t.Errorf("want: response=[%s], got: [%s]", tc.response, respStr)
-                               }
 
+                               space := regexp.MustCompile(`\s+`)
+                               s1 := space.ReplaceAllString(respStr, " ")
+                               s2 := space.ReplaceAllString(tc.response," ")
+
+                               if !strings.EqualFold(s1, s2) {
+                                       t.Errorf("want: [%s], got: [%s]", tc.response, respStr)
+                               }
                        }
                })
        }
index f68e4c0..d4b2848 100644 (file)
@@ -25,6 +25,7 @@ import (
        "e2mgr/logger"
        "fmt"
        "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+       "regexp"
        "strings"
        "testing"
 )
@@ -44,7 +45,7 @@ func TestUnpackEndcX2SetupResponseAndExtract(t *testing.T) {
        }{
                {
                        key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"},
-                       gnb: "CONNECTED [served_nr_cell_information:<nr_pci:5 cell_id:\"1e3f27:1f2e3d4ff0\" stac5g:\"3d44d3\" configured_stac:\"4e4f\" served_plmns:\"3e4e5e\" nr_mode:TDD choice_nr_mode:<tdd:<nr_freq_info:<nr_ar_fcn:1 sulInformation:<sul_ar_fcn:2 sul_transmission_bandwidth:<nrscs:SCS60 ncnrb:NRB107 > > frequency_bands:<nr_frequency_band:22 supported_sul_bands:11 > > transmission_bandwidth:<nrscs:SCS30 ncnrb:NRB133 > > > >  served_nr_cell_information:<nr_pci:5 cell_id:\"1e3f27:1f2e3d4ff0\" stac5g:\"3d44d3\" configured_stac:\"4e4f\" served_plmns:\"3e4e5e\" nr_mode:TDD choice_nr_mode:<tdd:<nr_freq_info:<nr_ar_fcn:1 sulInformation:<sul_ar_fcn:2 sul_transmission_bandwidth:<nrscs:SCS120 ncnrb:NRB121 > > frequency_bands:<nr_frequency_band:22 supported_sul_bands:11 > > transmission_bandwidth:<nrscs:SCS15 ncnrb:NRB132 > > > > nr_neighbour_infos:<nr_pci:44 nr_cgi:\"1e3f27:1f2e3d4ff0\" nr_mode:TDD choice_nr_mode:<tdd:<ar_fcn_nr_freq_info:<nr_ar_fcn:1 sulInformation:<sul_ar_fcn:2 sul_transmission_bandwidth:<nrscs:SCS15 ncnrb:NRB11 > > frequency_bands:<nr_frequency_band:22 supported_sul_bands:11 > > > > > ]",
+                       gnb: "CONNECTED [served_nr_cell_information:{nr_pci:5  cell_id:\"1e3f27:1f2e3d4ff0\"  stac5g:\"3d44d3\"  configured_stac:\"4e4f\"  served_plmns:\"3e4e5e\"  nr_mode:TDD  choice_nr_mode:{tdd:{nr_freq_info:{nr_ar_fcn:1  sulInformation:{sul_ar_fcn:2  sul_transmission_bandwidth:{nrscs:SCS60  ncnrb:NRB107}}  frequency_bands:{nr_frequency_band:22  supported_sul_bands:11}}  transmission_bandwidth:{nrscs:SCS30  ncnrb:NRB133}}}} served_nr_cell_information:{nr_pci:5  cell_id:\"1e3f27:1f2e3d4ff0\"  stac5g:\"3d44d3\"  configured_stac:\"4e4f\"  served_plmns:\"3e4e5e\"  nr_mode:TDD  choice_nr_mode:{tdd:{nr_freq_info:{nr_ar_fcn:1  sulInformation:{sul_ar_fcn:2  sul_transmission_bandwidth:{nrscs:SCS120  ncnrb:NRB121}}  frequency_bands:{nr_frequency_band:22  supported_sul_bands:11}}  transmission_bandwidth:{nrscs:SCS15  ncnrb:NRB132}}}}  nr_neighbour_infos:{nr_pci:44  nr_cgi:\"1e3f27:1f2e3d4ff0\"  nr_mode:TDD  choice_nr_mode:{tdd:{ar_fcn_nr_freq_info:{nr_ar_fcn:1  sulInformation:{sul_ar_fcn:2  sul_transmission_bandwidth:{nrscs:SCS15  ncnrb:NRB11}}  frequency_bands:{nr_frequency_band:22  supported_sul_bands:11}}}}}]",
                        /*
                E2AP-PDU:
                         successfulOutcome_t
@@ -153,7 +154,7 @@ func TestUnpackEndcX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "202400808e00000100f600808640000200fc00090002f829504a952a0a00fd007200010c0005001e3f271f2e3d4ff03d44d34e4f003e4e5e4400010000150400000a000211e148033e4e5e4c0005001e3f271f2e3d4ff03d44d34e4f003e4e5e4400010000150400000a00021a0044033e4e5e000000002c001e3f271f2e3d4ff0031e3f274400010000150400000a00020000"},
                {
                        key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"},
-                       gnb: "CONNECTED [served_nr_cell_information:<nr_pci:5 cell_id:\"1e3f27:1f2e3d4ff0\" stac5g:\"3d44d3\" configured_stac:\"4e4f\" served_plmns:\"3e4e5e\" nr_mode:TDD choice_nr_mode:<tdd:<nr_freq_info:<nr_ar_fcn:1 sulInformation:<sul_ar_fcn:2 sul_transmission_bandwidth:<nrscs:SCS30 ncnrb:NRB107 > > frequency_bands:<nr_frequency_band:22 supported_sul_bands:11 > > transmission_bandwidth:<nrscs:SCS15 ncnrb:NRB121 > > > > nr_neighbour_infos:<nr_pci:44 nr_cgi:\"1e3f27:1f2e3d4ff0\" nr_mode:TDD choice_nr_mode:<tdd:<ar_fcn_nr_freq_info:<nr_ar_fcn:5 sulInformation:<sul_ar_fcn:6 sul_transmission_bandwidth:<nrscs:SCS120 ncnrb:NRB18 > > frequency_bands:<nr_frequency_band:22 supported_sul_bands:11 > > > > > ]",
+                       gnb: "CONNECTED [served_nr_cell_information:{nr_pci:5  cell_id:\"1e3f27:1f2e3d4ff0\"  stac5g:\"3d44d3\"  configured_stac:\"4e4f\"  served_plmns:\"3e4e5e\"  nr_mode:TDD  choice_nr_mode:{tdd:{nr_freq_info:{nr_ar_fcn:1  sulInformation:{sul_ar_fcn:2  sul_transmission_bandwidth:{nrscs:SCS30  ncnrb:NRB107}}  frequency_bands:{nr_frequency_band:22  supported_sul_bands:11}}  transmission_bandwidth:{nrscs:SCS15  ncnrb:NRB121}}}}  nr_neighbour_infos:{nr_pci:44  nr_cgi:\"1e3f27:1f2e3d4ff0\"  nr_mode:TDD  choice_nr_mode:{tdd:{ar_fcn_nr_freq_info:{nr_ar_fcn:5  sulInformation:{sul_ar_fcn:6  sul_transmission_bandwidth:{nrscs:SCS120  ncnrb:NRB18}}  frequency_bands:{nr_frequency_band:22  supported_sul_bands:11}}}}}]",
                        /*
                        E2AP-PDU:
                         successfulOutcome_t
@@ -234,7 +235,7 @@ func TestUnpackEndcX2SetupResponseAndExtract(t *testing.T) {
 
                {
                        key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"},
-                       gnb: "CONNECTED [served_nr_cell_information:<nr_pci:5 cell_id:\"1e3f27:1f2e3d4ff0\" stac5g:\"3d44d3\" configured_stac:\"4e4f\" served_plmns:\"3e4e5e\" nr_mode:TDD choice_nr_mode:<tdd:<nr_freq_info:<nr_ar_fcn:1 sulInformation:<sul_ar_fcn:2 sul_transmission_bandwidth:<nrscs:SCS60 ncnrb:NRB107 > > frequency_bands:<nr_frequency_band:22 supported_sul_bands:11 > > transmission_bandwidth:<nrscs:SCS30 ncnrb:NRB133 > > > >  served_nr_cell_information:<nr_pci:8 cell_id:\"2e3f45:1f2e3d4ff0\" stac5g:\"4faa3c\" configured_stac:\"1a2f\" served_plmns:\"50321e\" nr_mode:TDD choice_nr_mode:<tdd:<nr_freq_info:<nr_ar_fcn:4 sulInformation:<sul_ar_fcn:8 sul_transmission_bandwidth:<nrscs:SCS120 ncnrb:NRB121 > > frequency_bands:<nr_frequency_band:7 supported_sul_bands:3 > > transmission_bandwidth:<nrscs:SCS15 ncnrb:NRB132 > > > > nr_neighbour_infos:<nr_pci:44 nr_cgi:\"1e3f27:1f2e3d4ff0\" nr_mode:TDD choice_nr_mode:<tdd:<ar_fcn_nr_freq_info:<nr_ar_fcn:1 sulInformation:<sul_ar_fcn:2 sul_transmission_bandwidth:<nrscs:SCS15 ncnrb:NRB11 > > frequency_bands:<nr_frequency_band:22 supported_sul_bands:11 > > > > > ]",
+                       gnb: "CONNECTED [served_nr_cell_information:{nr_pci:5  cell_id:\"1e3f27:1f2e3d4ff0\"  stac5g:\"3d44d3\"  configured_stac:\"4e4f\"  served_plmns:\"3e4e5e\"  nr_mode:TDD  choice_nr_mode:{tdd:{nr_freq_info:{nr_ar_fcn:1  sulInformation:{sul_ar_fcn:2  sul_transmission_bandwidth:{nrscs:SCS60  ncnrb:NRB107}}  frequency_bands:{nr_frequency_band:22  supported_sul_bands:11}}  transmission_bandwidth:{nrscs:SCS30  ncnrb:NRB133}}}} served_nr_cell_information:{nr_pci:8  cell_id:\"2e3f45:1f2e3d4ff0\"  stac5g:\"4faa3c\"  configured_stac:\"1a2f\"  served_plmns:\"50321e\"  nr_mode:TDD  choice_nr_mode:{tdd:{nr_freq_info:{nr_ar_fcn:4  sulInformation:{sul_ar_fcn:8  sul_transmission_bandwidth:{nrscs:SCS120  ncnrb:NRB121}}  frequency_bands:{nr_frequency_band:7  supported_sul_bands:3}}  transmission_bandwidth:{nrscs:SCS15  ncnrb:NRB132}}}}  nr_neighbour_infos:{nr_pci:44  nr_cgi:\"1e3f27:1f2e3d4ff0\"  nr_mode:TDD  choice_nr_mode:{tdd:{ar_fcn_nr_freq_info:{nr_ar_fcn:1  sulInformation:{sul_ar_fcn:2  sul_transmission_bandwidth:{nrscs:SCS15  ncnrb:NRB11}}  frequency_bands:{nr_frequency_band:22  supported_sul_bands:11}}}}}]",
                        /*
                        E2AP-PDU:
                         successfulOutcome_t
@@ -343,7 +344,7 @@ func TestUnpackEndcX2SetupResponseAndExtract(t *testing.T) {
 
                {
                        key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"},
-                       gnb: "CONNECTED [served_nr_cell_information:<nr_pci:5 cell_id:\"1e3f27:1f2e3d4ff0\" served_plmns:\"3e4e5e\" nr_mode:FDD choice_nr_mode:<fdd:<ul_freq_info:<nr_ar_fcn:5 frequency_bands:<nr_frequency_band:44 supported_sul_bands:33 > > dl_freq_info:<nr_ar_fcn:1 frequency_bands:<nr_frequency_band:22 supported_sul_bands:11 > > ul_transmission_bandwidth:<nrscs:SCS120 ncnrb:NRB11 > dl_transmission_bandwidth:<nrscs:SCS15 ncnrb:NRB135 > > > > nr_neighbour_infos:<nr_pci:44 nr_cgi:\"1e3f27:1f2e3d4ff0\" nr_mode:FDD choice_nr_mode:<fdd:<ular_fcn_freq_info:<nr_ar_fcn:5 frequency_bands:<nr_frequency_band:22 supported_sul_bands:11 > > dlar_fcn_freq_info:<nr_ar_fcn:1 frequency_bands:<nr_frequency_band:22 supported_sul_bands:11 > > > > > ]",
+                       gnb: "CONNECTED [served_nr_cell_information:{nr_pci:5  cell_id:\"1e3f27:1f2e3d4ff0\"  served_plmns:\"3e4e5e\"  nr_mode:FDD  choice_nr_mode:{fdd:{ul_freq_info:{nr_ar_fcn:5  frequency_bands:{nr_frequency_band:44  supported_sul_bands:33}}  dl_freq_info:{nr_ar_fcn:1  frequency_bands:{nr_frequency_band:22  supported_sul_bands:11}}  ul_transmission_bandwidth:{nrscs:SCS120  ncnrb:NRB11}  dl_transmission_bandwidth:{nrscs:SCS15  ncnrb:NRB135}}}}  nr_neighbour_infos:{nr_pci:44  nr_cgi:\"1e3f27:1f2e3d4ff0\"  nr_mode:FDD  choice_nr_mode:{fdd:{ular_fcn_freq_info:{nr_ar_fcn:5  frequency_bands:{nr_frequency_band:22  supported_sul_bands:11}}  dlar_fcn_freq_info:{nr_ar_fcn:1  frequency_bands:{nr_frequency_band:22  supported_sul_bands:11}}}}}]",
                        /*
                        E2AP-PDU:
                         successfulOutcome_t
@@ -433,7 +434,7 @@ func TestUnpackEndcX2SetupResponseAndExtract(t *testing.T) {
 
                {
                        key: &entities.GlobalNbId{PlmnId: "04a5c1", NbId: "4fc52bff"},
-                       gnb: "CONNECTED [served_nr_cell_information:<nr_pci:9 cell_id:\"aeafa7:2a3e3b4cd0\" stac5g:\"7d4773\" configured_stac:\"477f\" served_plmns:\"7e7e7e\" nr_mode:TDD choice_nr_mode:<tdd:<nr_freq_info:<nr_ar_fcn:8 sulInformation:<sul_ar_fcn:9 sul_transmission_bandwidth:<nrscs:SCS15 ncnrb:NRB121 > > frequency_bands:<nr_frequency_band:22 supported_sul_bands:11 > > transmission_bandwidth:<nrscs:SCS60 ncnrb:NRB18 > > > > nr_neighbour_infos:<nr_pci:44 nr_cgi:\"5a5ff1:2a3e3b4cd0\" nr_mode:TDD choice_nr_mode:<tdd:<ar_fcn_nr_freq_info:<nr_ar_fcn:5 sulInformation:<sul_ar_fcn:6 sul_transmission_bandwidth:<nrscs:SCS30 ncnrb:NRB18 > > frequency_bands:<nr_frequency_band:4 supported_sul_bands:3 > > > > > nr_neighbour_infos:<nr_pci:9 nr_cgi:\"5d5caa:af3e354ac0\" nr_mode:TDD choice_nr_mode:<tdd:<ar_fcn_nr_freq_info:<nr_ar_fcn:7 sulInformation:<sul_ar_fcn:8 sul_transmission_bandwidth:<nrscs:SCS120 ncnrb:NRB25 > > frequency_bands:<nr_frequency_band:3 supported_sul_bands:1 > > > > > ]",
+                       gnb: "CONNECTED [served_nr_cell_information:{nr_pci:9  cell_id:\"aeafa7:2a3e3b4cd0\"  stac5g:\"7d4773\"  configured_stac:\"477f\"  served_plmns:\"7e7e7e\"  nr_mode:TDD  choice_nr_mode:{tdd:{nr_freq_info:{nr_ar_fcn:8  sulInformation:{sul_ar_fcn:9  sul_transmission_bandwidth:{nrscs:SCS15  ncnrb:NRB121}}  frequency_bands:{nr_frequency_band:22  supported_sul_bands:11}}  transmission_bandwidth:{nrscs:SCS60  ncnrb:NRB18}}}}  nr_neighbour_infos:{nr_pci:44  nr_cgi:\"5a5ff1:2a3e3b4cd0\"  nr_mode:TDD  choice_nr_mode:{tdd:{ar_fcn_nr_freq_info:{nr_ar_fcn:5  sulInformation:{sul_ar_fcn:6  sul_transmission_bandwidth:{nrscs:SCS30  ncnrb:NRB18}}  frequency_bands:{nr_frequency_band:4  supported_sul_bands:3}}}}}  nr_neighbour_infos:{nr_pci:9  nr_cgi:\"5d5caa:af3e354ac0\"  nr_mode:TDD  choice_nr_mode:{tdd:{ar_fcn_nr_freq_info:{nr_ar_fcn:7  sulInformation:{sul_ar_fcn:8  sul_transmission_bandwidth:{nrscs:SCS120  ncnrb:NRB25}}  frequency_bands:{nr_frequency_band:3  supported_sul_bands:1}}}}}]",
                        /*
                        E2AP-PDU:
                         successfulOutcome_t
@@ -602,8 +603,13 @@ func TestUnpackEndcX2SetupResponseAndExtract(t *testing.T) {
                                nb.ConnectionStatus = entities.ConnectionStatus_CONNECTED
                                nb.Configuration = &entities.NodebInfo_Gnb{Gnb: gnb}
                                gnbStr := fmt.Sprintf("%s %s", nb.ConnectionStatus, gnb.ServedNrCells)
-                               if !strings.EqualFold(gnbStr, tc.gnb) {
-                                       t.Errorf("want: enb=%s, got: %s", tc.gnb, gnbStr)
+
+                               space := regexp.MustCompile(`\s+`)
+                               s1 := space.ReplaceAllString(gnbStr, " ")
+                               s2 := space.ReplaceAllString(tc.gnb," ")
+
+                               if !strings.EqualFold(s1, s2) {
+                                       t.Errorf("want: [%s], got: [%s]", tc.gnb, gnbStr)
                                }
 
                        }
index 54a1f53..3f4cebd 100644 (file)
@@ -25,6 +25,7 @@ import (
        "e2mgr/logger"
        "fmt"
        "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+       "regexp"
        "strings"
        "testing"
 )
@@ -42,7 +43,7 @@ func TestUnpackX2SetupFailureResponseAndExtract(t *testing.T) {
                failure   error
        }{
                {
-                       response: "CONNECTED_SETUP_FAILED network_layer_cause:HANDOVER_DESIRABLE_FOR_RADIO_REASONS time_to_wait:V1S criticality_diagnostics:<procedure_code:33 triggering_message:UNSUCCESSFUL_OUTCOME procedure_criticality:NOTIFY information_element_criticality_diagnostics:<ie_criticality:REJECT ie_id:128 type_of_error:MISSING > > ",
+                       response: "CONNECTED_SETUP_FAILED network_layer_cause:HANDOVER_DESIRABLE_FOR_RADIO_REASONS  time_to_wait:V1S  criticality_diagnostics:{procedure_code:33  triggering_message:UNSUCCESSFUL_OUTCOME  procedure_criticality:NOTIFY  information_element_criticality_diagnostics:{ie_criticality:REJECT  ie_id:128  type_of_error:MISSING}}",
                        /*
                                E2AP-PDU:
                                 unsuccessfulOutcome_t
@@ -74,7 +75,7 @@ func TestUnpackX2SetupFailureResponseAndExtract(t *testing.T) {
                        */
                        packedPdu: "4006001a0000030005400200000016400100001140087821a00000008040"},
                {
-                       response: "CONNECTED_SETUP_FAILED transport_layer_cause:TRANSPORT_RESOURCE_UNAVAILABLE criticality_diagnostics:<procedure_code:33 triggering_message:UNSUCCESSFUL_OUTCOME procedure_criticality:NOTIFY information_element_criticality_diagnostics:<ie_criticality:REJECT ie_id:128 type_of_error:MISSING > > ",
+                       response: "CONNECTED_SETUP_FAILED transport_layer_cause:TRANSPORT_RESOURCE_UNAVAILABLE  criticality_diagnostics:{procedure_code:33  triggering_message:UNSUCCESSFUL_OUTCOME  procedure_criticality:NOTIFY  information_element_criticality_diagnostics:{ie_criticality:REJECT  ie_id:128  type_of_error:MISSING}}",
                        /*
                                E2AP-PDU:
                                 unsuccessfulOutcome_t
@@ -102,7 +103,7 @@ func TestUnpackX2SetupFailureResponseAndExtract(t *testing.T) {
                        */
                        packedPdu: "400600140000020005400120001140087821a00000008040"},
                {
-                       response: "CONNECTED_SETUP_FAILED protocol_cause:ABSTRACT_SYNTAX_ERROR_IGNORE_AND_NOTIFY criticality_diagnostics:<triggering_message:UNSUCCESSFUL_OUTCOME procedure_criticality:NOTIFY information_element_criticality_diagnostics:<ie_criticality:REJECT ie_id:128 type_of_error:MISSING > > ",
+                       response: "CONNECTED_SETUP_FAILED protocol_cause:ABSTRACT_SYNTAX_ERROR_IGNORE_AND_NOTIFY  criticality_diagnostics:{triggering_message:UNSUCCESSFUL_OUTCOME  procedure_criticality:NOTIFY  information_element_criticality_diagnostics:{ie_criticality:REJECT  ie_id:128  type_of_error:MISSING}}",
                        /*
                                E2AP-PDU:
                                 unsuccessfulOutcome_t
@@ -130,7 +131,7 @@ func TestUnpackX2SetupFailureResponseAndExtract(t *testing.T) {
                        packedPdu: "400600130000020005400144001140073a800000008040"},
 
                {
-                       response: "CONNECTED_SETUP_FAILED miscellaneous_cause:UNSPECIFIED criticality_diagnostics:<procedure_criticality:NOTIFY information_element_criticality_diagnostics:<ie_criticality:REJECT ie_id:128 type_of_error:MISSING > > ",
+                       response: "CONNECTED_SETUP_FAILED miscellaneous_cause:UNSPECIFIED  criticality_diagnostics:{procedure_criticality:NOTIFY  information_element_criticality_diagnostics:{ie_criticality:REJECT  ie_id:128  type_of_error:MISSING}}",
                        /*
                                E2AP-PDU:
                                 unsuccessfulOutcome_t
@@ -157,7 +158,7 @@ func TestUnpackX2SetupFailureResponseAndExtract(t *testing.T) {
                        packedPdu: "400600120000020005400168001140061a0000008040"},
 
                {
-                       response: "CONNECTED_SETUP_FAILED miscellaneous_cause:UNSPECIFIED criticality_diagnostics:<information_element_criticality_diagnostics:<ie_criticality:REJECT ie_id:128 type_of_error:MISSING > information_element_criticality_diagnostics:<ie_criticality:NOTIFY ie_id:255 type_of_error:NOT_UNDERSTOOD > > ",
+                       response: "CONNECTED_SETUP_FAILED miscellaneous_cause:UNSPECIFIED  criticality_diagnostics:{information_element_criticality_diagnostics:{ie_criticality:REJECT  ie_id:128  type_of_error:MISSING}  information_element_criticality_diagnostics:{ie_criticality:NOTIFY  ie_id:255  type_of_error:NOT_UNDERSTOOD}}",
                        /*
                                E2AP-PDU:
                                 unsuccessfulOutcome_t
@@ -188,7 +189,7 @@ func TestUnpackX2SetupFailureResponseAndExtract(t *testing.T) {
 
 
                {
-                       response: "CONNECTED_SETUP_FAILED miscellaneous_cause:UNSPECIFIED criticality_diagnostics:<procedure_code:33 > ",
+                       response: "CONNECTED_SETUP_FAILED miscellaneous_cause:UNSPECIFIED  criticality_diagnostics:{procedure_code:33}",
                        /*
                                E2AP-PDU:
                                 unsuccessfulOutcome_t
@@ -210,7 +211,7 @@ func TestUnpackX2SetupFailureResponseAndExtract(t *testing.T) {
                        packedPdu: "4006000e0000020005400168001140024021"},
 
                {
-                       response: "CONNECTED_SETUP_FAILED miscellaneous_cause:UNSPECIFIED ",
+                       response: "CONNECTED_SETUP_FAILED miscellaneous_cause:UNSPECIFIED",
                        /*
                                E2AP-PDU:
                                 unsuccessfulOutcome_t
@@ -226,7 +227,7 @@ func TestUnpackX2SetupFailureResponseAndExtract(t *testing.T) {
                        */
                        packedPdu: "400600080000010005400168"},
                {
-                       response: "CONNECTED_SETUP_FAILED network_layer_cause:HANDOVER_DESIRABLE_FOR_RADIO_REASONS time_to_wait:V1S criticality_diagnostics:<procedure_code:33 triggering_message:UNSUCCESSFUL_OUTCOME procedure_criticality:NOTIFY information_element_criticality_diagnostics:<ie_criticality:REJECT ie_id:128 type_of_error:MISSING > > ",
+                       response: "CONNECTED_SETUP_FAILED network_layer_cause:HANDOVER_DESIRABLE_FOR_RADIO_REASONS  time_to_wait:V1S  criticality_diagnostics:{procedure_code:33  triggering_message:UNSUCCESSFUL_OUTCOME  procedure_criticality:NOTIFY  information_element_criticality_diagnostics:{ie_criticality:REJECT  ie_id:128  type_of_error:MISSING}}",
                        /*
                                E2AP-PDU:
                                 unsuccessfulOutcome_t
@@ -294,8 +295,13 @@ func TestUnpackX2SetupFailureResponseAndExtract(t *testing.T) {
                                nb.SetupFailure = response
                                nb.FailureType = entities.Failure_X2_SETUP_FAILURE
                                respStr := fmt.Sprintf("%s %s", nb.ConnectionStatus, response)
-                               if !strings.EqualFold(respStr, tc.response) {
-                                       t.Errorf("want: response=[%s], got: [%s]", tc.response, respStr)
+
+                               space := regexp.MustCompile(`\s+`)
+                               s1 := space.ReplaceAllString(respStr, " ")
+                               s2 := space.ReplaceAllString(tc.response," ")
+
+                               if !strings.EqualFold(s1, s2) {
+                                       t.Errorf("want: [%s], got: [%s]", tc.response, respStr)
                                }
 
                        }
index 8161747..739a412 100644 (file)
@@ -25,6 +25,7 @@ import (
        "e2mgr/logger"
        "fmt"
        "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+       "regexp"
        "strings"
        "testing"
 )
@@ -44,7 +45,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
        }{
                {
                        key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -82,7 +83,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "2006002a000002001500080002f82900007a8000140017000000630002f8290007ab50102002f829000001000133"},
                {
                        key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -136,7 +137,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "20060043000002001500080002f82900007a8000140030010000630002f8290007ab50102002f8290000010001330000640002f9290007ac50203202f82902f929000002000344"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -178,7 +179,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        */
                        packedPdu: "20060033000002001500080002f82900007a8000140020000000630002f8290007ab50102002f8291000010001330000005f0003800102"},
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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]",
+                       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]",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -226,7 +227,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "2006003a000003001500080002f82900007a8000140017000000630002f8290007ab50102002f8290000010001330018000c1002f72902030002f9290304"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -266,7 +267,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        */
                        packedPdu: "2006002a000002001500080002f82900007a8000140017000000630002f8290007ab50102002f829400001320820"},
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -315,7 +316,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "20060032000002001500080002f82900007a800014001f000000630002f8290007ab50102002f8295000013208800000006140021220"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -361,7 +362,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "20060033000002001500080002f82900007a8000140020000000630002f8290007ab50102002f8295000013208800000005e0003800102"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -410,7 +411,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "20060031000002001500080002f82900007a800014001e000000630002f8290007ab50102002f829500001320880000000b3400100"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -471,7 +472,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "2006003e000002001500080002f82900007a800014002b000000630002f8290007ab50102002f829500001320880000200b3400100006140021220005e0003800102"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80b0"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -531,7 +532,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "2006004b000002001500090002f82940007a80b000140037010800630002f8290007ab50102002f829000001000133000000294001000000640002f9290007ac50203202f82902f929000002000344"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a40"},
-                       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 > ] []",
+                       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}] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -600,7 +601,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "20060056000002001500090002f8298003007a4000140042010800630002f8290007ab50102002f829000001000133000000294001000800640002f9290007ac50203202f82902f92900000200034400000037400500000f79e0"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a40"},
-                       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 > ] []",
+                       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}] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -668,7 +669,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        */
                        packedPdu: "20060054000002001500090002f8298003007a4000140040010800630002f8290007ab50102002f829000001000133000000294001000800640002f9290007ac50203202f82902f929000002000344000000384003019850"},
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a40"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -735,7 +736,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        */
                        packedPdu: "20060052000002001500090002f8298003007a400014003e010800630002f8290007ab50102002f82900000100013300010029400100003840030198500000640002f9290007ac50203202f82902f929000002000344"},
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a40"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -801,7 +802,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        */
                        packedPdu: "20060054000002001500090002f8298003007a4000140040010800630002f8290007ab50102002f829000001000133000100294001000037400500000f79e00000640002f9290007ac50203202f82902f929000002000344"},
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a08"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -866,7 +867,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "20060050000002001500090002f829c003007a080014003c010800630002f8290007ab50102002f82900000100013300000037400640000f79ef000000640002f9290007ac50203202f82902f929000002000344"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -917,7 +918,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "2006003e000002001500080002f82900007a800014002b000800630002f8290007ab50102002f8290000010001330002004640040007aba000a040014000b4400100"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 ] []",
+                       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] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -975,7 +976,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        */
                        packedPdu: "20060044000002001500080002f82900007a8000140031000800630002f8290007ab50102002f8290000010001330002004f40050102f803f900a040010000544006200000010002"},
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 > ] []",
+                       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}] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -1026,7 +1027,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "20060044000002001500080002f82900007a8000140031004000630002f8290007ab50102002f82900000100013300020002f8290007ab50006300010003f9300008bc5000640002"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 > ] []",
+                       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}] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -1087,7 +1088,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                        packedPdu: "20060055000002001500080002f82900007a8000140042004000630002f8290007ab50102002f82900000100013300024002f8290007ab50006300010000004c400201024003f9300008bc50006400020000005e0003800103"},
 
                {key: &entities.GlobalNbId{PlmnId: "02f829", NbId: "007a80"},
-                       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 > ] []",
+                       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}] []",
                        /*
                                X2AP-PDU:
                                 successfulOutcome_t
@@ -1146,7 +1147,7 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                                           EARFCNExtension = 0x3
                        */
                        packedPdu: "20060055000002001500080002f82900007a8000140042004000630002f8290007ab50102002f82900000100013300024002f8290007ab50006300010000004c400201024003f9300008bc50006400020000005e0003800103",
-                       /*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),*/ },
+                       /*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),*/},
        }
 
        converter := NewX2SetupResponseConverter(logger)
@@ -1191,7 +1192,14 @@ func TestUnpackX2SetupResponseAndExtract(t *testing.T) {
                                nb.ConnectionStatus = entities.ConnectionStatus_CONNECTED
                                nb.Configuration = &entities.NodebInfo_Enb{Enb: enb}
                                embStr := fmt.Sprintf("%s %s %s %s", nb.ConnectionStatus, enb.EnbType, enb.ServedCells, enb.GuGroupIds)
-                               if !strings.EqualFold(embStr, tc.enb) {
+
+                               space := regexp.MustCompile(`\s+`)
+                               s1 := space.ReplaceAllString(embStr, " ")
+                               s2 := space.ReplaceAllString(tc.enb," ")
+
+
+
+                               if !strings.EqualFold(s1, s2) {
                                        t.Errorf("want: enb=%s, got: %s", tc.enb, embStr)
                                }
                        }
index 0339b3c..5dd7b9f 100644 (file)
@@ -1,13 +1,13 @@
 module e2mgr
 
 require (
-       gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35
-       gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35
-       gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35
+       gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.41
+       gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.41
+       gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.41
        gerrit.o-ran-sc.org/r/ric-plt/sdlgo v0.5.2
        github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
        github.com/go-ozzo/ozzo-validation v3.5.0+incompatible
-       github.com/golang/protobuf v1.3.4
+       github.com/golang/protobuf v1.4.2
        github.com/gorilla/mux v1.7.0
        github.com/magiconair/properties v1.8.1
        github.com/pelletier/go-toml v1.5.0 // indirect
@@ -23,7 +23,6 @@ require (
        google.golang.org/appengine v1.6.1 // indirect
        gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
        gopkg.in/yaml.v2 v2.2.8
-       k8s.io/apimachinery v0.17.0
        k8s.io/client-go v0.17.0
 )
 
index 4bb1c2a..c743f09 100644 (file)
@@ -1,12 +1,12 @@
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35 h1:TGXHb4DNY8on+ej4S9VUnk2HibIC/5chDy64OE+bQBQ=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35 h1:tkM3yE8UzmuH4nf9TqAmiNBSuIZ2CtcMRH2eBIYIzpQ=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35/go.mod h1:G+4sUBMbLfQ+RrGS65U15tKmbnP+/1b5oLTPmMfyfT4=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35 h1:LcxnUUDwsCzYEISKmkjkyYfg/lnLt8ofkPiGK69vNIA=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35/go.mod h1:2bSaXTpECbZieB8bMnubTqMwF3n+mMBxlTaAXvcduNg=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.41 h1:91VlUsqMooia8F1JvBXh8F8x3n0lj1xqCV0jmx4bm20=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.41/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.41 h1:nq2GgOIc/53lldmOe0pe6qZSxLkOrCRSNWeKTCeijDo=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.41/go.mod h1:YaQ+XEI4PcAoISxp9wUpUr2TP0J7JihpQTD0G1Lpd4A=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.41 h1:hVl06Y+wwusyuCHgbsUI/BY63HUvkoZYS3iS0vm1XKc=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.41/go.mod h1:xu3UO+VN6JdiWDRxzGzdanTbH7hh7sanrWtTB7YtBBs=
 gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2 h1:UK7awyRKIkVdokWvvkYvazlg3EWIfMnIqCcJxTnLlDA=
 gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2/go.mod h1:y2WhrCvdLkAKdH+ySdHSOSehACJkTMyZghCGVcqoZzc=
 github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
@@ -81,14 +81,23 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
 github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
 github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
-github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
 github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
 github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
 github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0=
+github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
 github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -305,6 +314,8 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
 google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -317,6 +328,13 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn
 google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
 gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
index 9ea0ef5..3e58c31 100644 (file)
@@ -236,6 +236,14 @@ func (h E2SetupRequestNotificationHandler) parseSetupRequest(payload []byte) (*m
                return nil, "", errors.New(fmt.Sprintf("#E2SetupRequestNotificationHandler.parseSetupRequest - Error unmarshalling E2 Setup Request payload: %x", payload))
        }
 
+       ranFunctionsList := setupRequest.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[1].Value.RANfunctionsList.ProtocolIESingleContainer
+
+       for i := 0; i < len(ranFunctionsList); i++ {
+               def := models.E2smGnbNrtRanFunctionDefinition{}
+               err = xml.Unmarshal([]byte(ranFunctionsList[i].Value.RANfunctionItem.RanFunctionDefinition.Text), &def)
+               ranFunctionsList[i].Value.RANfunctionItem.RanFunctionDefinition.E2smGnbNrtRanFunctionDefinition = def
+       }
+
        return setupRequest, e2tIpAddress, nil
 }
 
@@ -248,7 +256,7 @@ func (h E2SetupRequestNotificationHandler) buildNodebInfo(ranName string, e2tAdd
                RanName:                      ranName,
                NodeType:                     entities.Node_GNB,
                Configuration:                &entities.NodebInfo_Gnb{Gnb: &entities.Gnb{}},
-               GlobalNbId: h.buildGlobalNbId(request),
+               GlobalNbId:                   h.buildGlobalNbId(request),
        }
 
        err = h.setGnbFunctions(nodebInfo, request)
@@ -265,6 +273,6 @@ func (h E2SetupRequestNotificationHandler) buildGlobalNbId(setupRequest *models.
 func (h E2SetupRequestNotificationHandler) buildNbIdentity(ranName string, setupRequest *models.E2SetupRequestMessage) *entities.NbIdentity {
        return &entities.NbIdentity{
                InventoryName: ranName,
-               GlobalNbId: h.buildGlobalNbId(setupRequest),
+               GlobalNbId:    h.buildGlobalNbId(setupRequest),
        }
 }
index 44fe5f8..0515298 100644 (file)
@@ -21,10 +21,8 @@ package models
 
 import (
        "encoding/xml"
-       "errors"
-       "fmt"
        "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
-       "strconv"
+       "github.com/golang/protobuf/ptypes/wrappers"
        "strings"
 )
 
@@ -134,10 +132,119 @@ type E2SetupRequestMessage struct {
 }
 
 type RanFunctionItem struct {
-       Text                  string `xml:",chardata"`
-       RanFunctionID         string `xml:"ranFunctionID"`
-       RanFunctionDefinition string `xml:"ranFunctionDefinition"`
-       RanFunctionRevision   string `xml:"ranFunctionRevision"`
+       Text                  string                `xml:",chardata"`
+       RanFunctionID         uint32                `xml:"ranFunctionID"`
+       RanFunctionDefinition RanFunctionDefinition `xml:"ranFunctionDefinition"`
+       RanFunctionRevision   uint32                `xml:"ranFunctionRevision"`
+}
+
+type RanFunctionDefinition struct {
+       Text                            string                          `xml:",chardata"`
+       E2smGnbNrtRanFunctionDefinition E2smGnbNrtRanFunctionDefinition `xml:"E2SM-gNB-NRT-RANfunction-Definition"`
+}
+
+type RanFunctionName struct {
+       Text                   string  `xml:",chardata"`
+       RanFunctionShortName   string  `xml:"ranFunction-ShortName"`
+       RanFunctionE2smOid     string  `xml:"ranFunction-E2SM-OID"`
+       RanFunctionDescription string  `xml:"ranFunction-Description"`
+       RanFunctionInstance    *uint32 `xml:"ranFunction-Instance"`
+}
+
+type RicEventTriggerStyleList struct {
+       Text                      string `xml:",chardata"`
+       RicEventTriggerStyleType  uint32 `xml:"ric-EventTriggerStyle-Type"`
+       RicEventTriggerStyleName  string `xml:"ric-EventTriggerStyle-Name"`
+       RicEventTriggerFormatType uint32 `xml:"ric-EventTriggerFormat-Type"`
+}
+
+type RanParameterDefItem struct {
+       Text             string           `xml:",chardata"`
+       RanParameterID   uint32           `xml:"ranParameter-ID"`
+       RanParameterName string           `xml:"ranParameter-Name"`
+       RanParameterType RanParameterType `xml:"ranParameter-Type"`
+}
+
+type RanParameterType struct {
+       Text            string    `xml:",chardata"`
+       Boolean         *struct{} `xml:"boolean,omitempty"`
+       Integer         *struct{} `xml:"integer,omitempty"`
+       Enumerated      *struct{} `xml:"enumerated,omitempty"`
+       BitString       *struct{} `xml:"bit-string,omitempty"`
+       OctetString     *struct{} `xml:"octet-string,omitempty"`
+       PrintableString *struct{} `xml:"printable-string,omitempty"`
+}
+
+type RicReportStyleList struct {
+       Text                         string `xml:",chardata"`
+       RicReportStyleType           uint32 `xml:"ric-ReportStyle-Type"`
+       RicReportStyleName           string `xml:"ric-ReportStyle-Name"`
+       RicReportActionFormatType    uint32 `xml:"ric-ReportActionFormat-Type"`
+       RicReportRanParameterDefList struct {
+               Text                string                `xml:",chardata"`
+               RanParameterDefItem []RanParameterDefItem `xml:"RANparameterDef-Item"`
+       } `xml:"ric-ReportRanParameterDef-List"`
+       RicIndicationHeaderFormatType  uint32 `xml:"ric-IndicationHeaderFormat-Type"`
+       RicIndicationMessageFormatType uint32 `xml:"ric-IndicationMessageFormat-Type"`
+}
+
+type RicInsertStyleList struct {
+       Text                         string `xml:",chardata"`
+       RicInsertStyleType           uint32 `xml:"ric-InsertStyle-Type"`
+       RicInsertStyleName           string `xml:"ric-InsertStyle-Name"`
+       RicInsertActionFormatType    uint32 `xml:"ric-InsertActionFormat-Type"`
+       RicInsertRanParameterDefList struct {
+               Text                string                `xml:",chardata"`
+               RanParameterDefItem []RanParameterDefItem `xml:"RANparameterDef-Item"`
+       } `xml:"ric-InsertRanParameterDef-List"`
+       RicIndicationHeaderFormatType  uint32 `xml:"ric-IndicationHeaderFormat-Type"`
+       RicIndicationMessageFormatType uint32 `xml:"ric-IndicationMessageFormat-Type"`
+       RicCallProcessIdFormatType     uint32 `xml:"ric-CallProcessIDFormat-Type"`
+}
+
+type RicControlStyleList struct {
+       Text                        string `xml:",chardata"`
+       RicControlStyleType         uint32 `xml:"ric-ControlStyle-Type"`
+       RicControlStyleName         string `xml:"ric-ControlStyle-Name"`
+       RicControlHeaderFormatType  uint32 `xml:"ric-ControlHeaderFormat-Type"`
+       RicControlMessageFormatType uint32 `xml:"ric-ControlMessageFormat-Type"`
+       RicCallProcessIdFormatType  uint32 `xml:"ric-CallProcessIDFormat-Type"`
+}
+
+type RicPolicyStyleList struct {
+       Text                         string `xml:",chardata"`
+       RicPolicyStyleType           uint32 `xml:"ric-PolicyStyle-Type"`
+       RicPolicyStyleName           string `xml:"ric-PolicyStyle-Name"`
+       RicPolicyActionFormatType    uint32 `xml:"ric-PolicyActionFormat-Type"`
+       RicPolicyRanParameterDefList struct {
+               Text                string                `xml:",chardata"`
+               RanParameterDefItem []RanParameterDefItem `xml:"RANparameterDef-Item"`
+       } `xml:"ric-PolicyRanParameterDef-List"`
+}
+
+type E2smGnbNrtRanFunctionDefinition struct {
+       Text                     string          `xml:",chardata"`
+       RanFunctionName          RanFunctionName `xml:"ranFunction-Name"`
+       RicEventTriggerStyleList struct {
+               Text                     string                     `xml:",chardata"`
+               RicEventTriggerStyleList []RicEventTriggerStyleList `xml:"RIC-EventTriggerStyle-List"`
+       } `xml:"ric-EventTriggerStyle-List"`
+       RicReportStyleList struct {
+               Text               string               `xml:",chardata"`
+               RicReportStyleList []RicReportStyleList `xml:"RIC-ReportStyle-List"`
+       } `xml:"ric-ReportStyle-List"`
+       RicInsertStyleList struct {
+               Text               string               `xml:",chardata"`
+               RicInsertStyleList []RicInsertStyleList `xml:"RIC-InsertStyle-List"`
+       } `xml:"ric-InsertStyle-List"`
+       RicControlStyleList struct {
+               Text                string                `xml:",chardata"`
+               RicControlStyleList []RicControlStyleList `xml:"RIC-ControlStyle-List"`
+       } `xml:"ric-ControlStyle-List"`
+       RicPolicyStyleList struct {
+               Text               string               `xml:",chardata"`
+               RicPolicyStyleList []RicPolicyStyleList `xml:"RIC-PolicyStyle-List"`
+       } `xml:"ric-PolicyStyle-List"`
 }
 
 type RANfunctionsList struct {
@@ -161,42 +268,200 @@ func (m *E2SetupRequestMessage) ExtractRanFunctionsList() ([]*entities.RanFuncti
        funcs := make([]*entities.RanFunction, len(list))
        for i := 0; i < len(funcs); i++ {
                funcs[i] = &entities.RanFunction{}
-               id, err := strconv.ParseUint(list[i].Value.RANfunctionItem.RanFunctionID, 10, 32)
-               if err != nil {
-                       return nil, errors.New(fmt.Sprintf("#e2_setup_request_message.ExtractRanFunctionsList - Failed parse uint RanFunctionID from %s", list[i].Value.RANfunctionItem.RanFunctionID))
-               }
-               funcs[i].RanFunctionId = uint32(id)
-               rev, err := strconv.ParseUint(list[i].Value.RANfunctionItem.RanFunctionRevision, 10, 32)
-               if err != nil {
-                       return nil, errors.New(fmt.Sprintf("#e2_setup_request_message.ExtractRanFunctionsList - Failed parse uint RanFunctionRevision from %s", list[i].Value.RANfunctionItem.RanFunctionRevision))
-               }
-               funcs[i].RanFunctionDefinition = m.trimSpaces(list[i].Value.RANfunctionItem.RanFunctionDefinition)
-               funcs[i].RanFunctionRevision = uint32(rev)
+               funcs[i].RanFunctionId = &wrappers.UInt32Value{Value: list[i].Value.RANfunctionItem.RanFunctionID}
+               def, _ := m.buildRanFunctionDefinitionProto(&list[i].Value.RANfunctionItem.RanFunctionDefinition)
+               funcs[i].RanFunctionDefinition = def
+               funcs[i].RanFunctionRevision = &wrappers.UInt32Value{Value: list[i].Value.RANfunctionItem.RanFunctionRevision}
        }
        return funcs, nil
 }
 
+func (m *E2SetupRequestMessage) buildRanFunctionDefinitionProto(def *RanFunctionDefinition) (*entities.RanFunctionDefinition, error) {
+       defProto := &entities.RanFunctionDefinition{
+               E2SmGnbNrtRanFunctionDefinition: &entities.E2SmGnbNrtRanFunctionDefinition{
+                       RanFunctionName:       buildRanFunctionNameProto(def),
+                       RicEventTriggerStyles: buildRicEventTriggerStylesProto(def),
+                       RicReportStyles:       buildRicReportStylesProto(def),
+                       RicInsertStyles:       buildRicInsertStylesProto(def),
+                       RicControlStyles:      buildRicControlStylesProto(def),
+                       RicPolicyStyles:       buildRicPolicyStylesProto(def),
+               },
+       }
+
+       return defProto, nil
+}
+
+func buildRanFunctionNameProto(def *RanFunctionDefinition) *entities.RanFunctionName {
+       defRanFunctionName := def.E2smGnbNrtRanFunctionDefinition.RanFunctionName
+       ranFunctionName := &entities.RanFunctionName{
+               RanFunctionShortName:   &wrappers.StringValue{Value: defRanFunctionName.RanFunctionShortName},
+               RanFunctionE2SmOid:     &wrappers.StringValue{Value: defRanFunctionName.RanFunctionE2smOid},
+               RanFunctionDescription: &wrappers.StringValue{Value: defRanFunctionName.RanFunctionDescription},
+       }
+
+       if defRanFunctionName.RanFunctionInstance != nil {
+               ranFunctionName.OptionalRanFunctionInstance = &entities.RanFunctionName_RanFunctionInstance{
+                       RanFunctionInstance: *defRanFunctionName.RanFunctionInstance,
+               }
+       }
+
+       return ranFunctionName
+}
+
+func buildRicEventTriggerStylesProto(def *RanFunctionDefinition) []*entities.RicEventTriggerStyle {
+       defRicEventTriggerStyleList := def.E2smGnbNrtRanFunctionDefinition.RicEventTriggerStyleList.RicEventTriggerStyleList
+       ricEventTriggerStyles := make([]*entities.RicEventTriggerStyle, len(defRicEventTriggerStyleList))
+
+       for i, v := range defRicEventTriggerStyleList {
+               ricEventTriggerStyles[i] = &entities.RicEventTriggerStyle{}
+               ricEventTriggerStyles[i].RicEventTriggerStyleType = &wrappers.UInt32Value{Value: v.RicEventTriggerStyleType}
+               ricEventTriggerStyles[i].RicEventTriggerStyleName = &wrappers.StringValue{Value: v.RicEventTriggerStyleName}
+               ricEventTriggerStyles[i].RicEventTriggerFormatType = &wrappers.UInt32Value{Value: v.RicEventTriggerFormatType}
+       }
+
+       return ricEventTriggerStyles
+}
+
+func buildRicReportStylesProto(def *RanFunctionDefinition) []*entities.RicReportStyle {
+       defRicReportStyleList := def.E2smGnbNrtRanFunctionDefinition.RicReportStyleList.RicReportStyleList
+       ricReportStyles := make([]*entities.RicReportStyle, len(defRicReportStyleList))
+
+       for i, v := range defRicReportStyleList {
+               ricReportStyles[i] = &entities.RicReportStyle{}
+               ricReportStyles[i].RicReportStyleType = &wrappers.UInt32Value{Value: v.RicReportStyleType}
+               ricReportStyles[i].RicReportStyleName = &wrappers.StringValue{Value: v.RicReportStyleName}
+               ricReportStyles[i].RicReportActionFormatType = &wrappers.UInt32Value{Value: v.RicReportActionFormatType}
+               ricReportStyles[i].RicReportRanParameterDefs = buildRicReportRanParameterDefsProto(v)
+               ricReportStyles[i].RicIndicationHeaderFormatType = &wrappers.UInt32Value{Value: v.RicIndicationHeaderFormatType}
+               ricReportStyles[i].RicIndicationMessageFormatType = &wrappers.UInt32Value{Value: v.RicIndicationMessageFormatType}
+       }
+
+       return ricReportStyles
+}
+
+func buildRicReportRanParameterDefsProto(ricReportStyleList RicReportStyleList) []*entities.RanParameterDef {
+       ricReportRanParameterDefList := ricReportStyleList.RicReportRanParameterDefList.RanParameterDefItem
+       ranParameterDefs := make([]*entities.RanParameterDef, len(ricReportRanParameterDefList))
+
+       for i, v := range ricReportRanParameterDefList {
+               ranParameterDefs[i] = &entities.RanParameterDef{}
+               ranParameterDefs[i].RanParameterId = &wrappers.UInt32Value{Value: v.RanParameterID}
+               ranParameterDefs[i].RanParameterName = &wrappers.StringValue{Value: v.RanParameterName}
+               ranParameterDefs[i].RanParameterType = getRanParameterTypeEnumValue(v.RanParameterType)
+       }
+
+       return ranParameterDefs
+}
+
+func getRanParameterTypeEnumValue(ranParameterType RanParameterType) entities.RanParameterType {
+       if ranParameterType.Boolean != nil {
+               return entities.RanParameterType_BOOLEAN
+       }
+
+       if ranParameterType.BitString != nil {
+               return entities.RanParameterType_BIT_STRING
+       }
+
+       if ranParameterType.Enumerated != nil {
+               return entities.RanParameterType_ENUMERATED
+       }
+
+       if ranParameterType.Integer != nil {
+               return entities.RanParameterType_INTEGER
+       }
+
+       if ranParameterType.OctetString != nil {
+               return entities.RanParameterType_OCTET_STRING
+       }
+
+       if ranParameterType.PrintableString != nil {
+               return entities.RanParameterType_PRINTABLE_STRING
+       }
+
+       return entities.RanParameterType_UNKNOWN_RAN_PARAMETER_TYPE
+}
+
+func buildRicInsertStylesProto(def *RanFunctionDefinition) []*entities.RicInsertStyle {
+       defRicInsertStyleList := def.E2smGnbNrtRanFunctionDefinition.RicInsertStyleList.RicInsertStyleList
+       ricInsertStyles := make([]*entities.RicInsertStyle, len(defRicInsertStyleList))
+
+       for i, v := range defRicInsertStyleList {
+               ricInsertStyles[i] = &entities.RicInsertStyle{}
+               ricInsertStyles[i].RicInsertStyleType = &wrappers.UInt32Value{Value: v.RicInsertStyleType}
+               ricInsertStyles[i].RicInsertStyleName = &wrappers.StringValue{Value: v.RicInsertStyleName}
+               ricInsertStyles[i].RicInsertActionFormatType = &wrappers.UInt32Value{Value: v.RicInsertActionFormatType}
+               ricInsertStyles[i].RicInsertRanParameterDefs = buildRicInsertRanParameterDefsProto(v)
+               ricInsertStyles[i].RicIndicationHeaderFormatType = &wrappers.UInt32Value{Value: v.RicIndicationHeaderFormatType}
+               ricInsertStyles[i].RicIndicationMessageFormatType = &wrappers.UInt32Value{Value: v.RicIndicationMessageFormatType}
+               ricInsertStyles[i].RicCallProcessIdFormatType = &wrappers.UInt32Value{Value: v.RicCallProcessIdFormatType}
+       }
+
+       return ricInsertStyles
+}
+
+func buildRicInsertRanParameterDefsProto(ricInsertStyleList RicInsertStyleList) []*entities.RanParameterDef {
+       ricInsertRanParameterDefList := ricInsertStyleList.RicInsertRanParameterDefList.RanParameterDefItem
+       ranParameterDefs := make([]*entities.RanParameterDef, len(ricInsertRanParameterDefList))
+
+       for i, v := range ricInsertRanParameterDefList {
+               ranParameterDefs[i] = &entities.RanParameterDef{}
+               ranParameterDefs[i].RanParameterId = &wrappers.UInt32Value{Value: v.RanParameterID}
+               ranParameterDefs[i].RanParameterName = &wrappers.StringValue{Value: v.RanParameterName}
+               ranParameterDefs[i].RanParameterType = getRanParameterTypeEnumValue(v.RanParameterType)
+       }
+
+       return ranParameterDefs
+}
+
+func buildRicControlStylesProto(def *RanFunctionDefinition) []*entities.RicControlStyle {
+       defRicControlStyleList := def.E2smGnbNrtRanFunctionDefinition.RicControlStyleList.RicControlStyleList
+       ricControlStyles := make([]*entities.RicControlStyle, len(defRicControlStyleList))
+
+       for i, v := range defRicControlStyleList {
+               ricControlStyles[i] = &entities.RicControlStyle{}
+               ricControlStyles[i].RicControlStyleType = &wrappers.UInt32Value{Value: v.RicControlStyleType}
+               ricControlStyles[i].RicControlStyleName = &wrappers.StringValue{Value: v.RicControlStyleName}
+               ricControlStyles[i].RicControlHeaderFormatType = &wrappers.UInt32Value{Value: v.RicControlHeaderFormatType}
+               ricControlStyles[i].RicControlMessageFormatType = &wrappers.UInt32Value{Value: v.RicControlMessageFormatType}
+               ricControlStyles[i].RicCallProcessIdFormatType = &wrappers.UInt32Value{Value: v.RicCallProcessIdFormatType}
+       }
+
+       return ricControlStyles
+}
+
+func buildRicPolicyRanParameterDefsProto(ricPolicyStyleList RicPolicyStyleList) []*entities.RanParameterDef {
+       ricPolicyRanParameterDefList := ricPolicyStyleList.RicPolicyRanParameterDefList.RanParameterDefItem
+       ranParameterDefs := make([]*entities.RanParameterDef, len(ricPolicyRanParameterDefList))
+
+       for i, v := range ricPolicyRanParameterDefList {
+               ranParameterDefs[i] = &entities.RanParameterDef{}
+               ranParameterDefs[i].RanParameterId = &wrappers.UInt32Value{Value: v.RanParameterID}
+               ranParameterDefs[i].RanParameterName = &wrappers.StringValue{Value: v.RanParameterName}
+               ranParameterDefs[i].RanParameterType = getRanParameterTypeEnumValue(v.RanParameterType)
+       }
+
+       return ranParameterDefs
+}
+
+func buildRicPolicyStylesProto(def *RanFunctionDefinition) []*entities.RicPolicyStyle {
+       defRicPolicyStyleList := def.E2smGnbNrtRanFunctionDefinition.RicPolicyStyleList.RicPolicyStyleList
+       ricPolicyStyles := make([]*entities.RicPolicyStyle, len(defRicPolicyStyleList))
+
+       for i, v := range defRicPolicyStyleList {
+               ricPolicyStyles[i] = &entities.RicPolicyStyle{}
+               ricPolicyStyles[i].RicPolicyStyleType = &wrappers.UInt32Value{Value: v.RicPolicyStyleType}
+               ricPolicyStyles[i].RicPolicyStyleName = &wrappers.StringValue{Value: v.RicPolicyStyleName}
+               ricPolicyStyles[i].RicPolicyActionFormatType = &wrappers.UInt32Value{Value: v.RicPolicyActionFormatType}
+               ricPolicyStyles[i].RicPolicyRanParameterDefs = buildRicPolicyRanParameterDefsProto(v)
+       }
+
+       return ricPolicyStyles
+}
+
 func (m *E2SetupRequestMessage) getGlobalE2NodeId() GlobalE2NodeId {
        return m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID
 }
 
-//func (m *E2SetupRequestMessage) GetNodeType() entities.Node_Type {
-//     globalE2NodeId := m.getGlobalE2NodeId()
-//     if id := globalE2NodeId.GNB.GlobalGNBID.PlmnID; id != "" {
-//             return entities.Node_GNB
-//     }
-//     if id := globalE2NodeId.EnGNB.GlobalGNBID.PlmnID; id != "" {
-//             return entities.Node_GNB
-//     }
-//     if id := globalE2NodeId.ENB.GlobalENBID.PlmnID; id != "" {
-//             return entities.Node_ENB
-//     }
-//     if id := globalE2NodeId.NgENB.GlobalNgENBID.PlmnID; id != "" {
-//             return entities.Node_ENB
-//     }
-//     return entities.Node_UNKNOWN
-//}
-
 func (m *E2SetupRequestMessage) GetPlmnId() string {
        globalE2NodeId := m.getGlobalE2NodeId()
        if id := globalE2NodeId.GNB.GlobalGNBID.PlmnID; id != "" {
index 654e2af..f4e3d30 100644 (file)
@@ -166,8 +166,8 @@ type ProtocolIESingleContainer struct {
                Text              string `xml:",chardata"`
                RANfunctionIDItem struct {
                        Text                string `xml:",chardata"`
-                       RanFunctionID       string `xml:"ranFunctionID"`
-                       RanFunctionRevision string `xml:"ranFunctionRevision"`
+                       RanFunctionID       uint32 `xml:"ranFunctionID"`
+                       RanFunctionRevision uint32 `xml:"ranFunctionRevision"`
                } `xml:"RANfunctionID-Item"`
        } `xml:"value"`
 }
index 257bb85..cd38bcc 100644 (file)
@@ -564,7 +564,7 @@ func TestSaveNilEntityFailure(t *testing.T) {
 
 func TestSaveUnknownTypeEntityFailure(t *testing.T) {
        w, _ := initSdlInstanceMock(namespace)
-       expectedErr := common.NewValidationError("#rNibWriter.saveNodeB - Unknown responding node type, entity: ip:\"localhost\" port:5656 ")
+       expectedErr := common.NewValidationError("#rNibWriter.saveNodeB - Unknown responding node type, entity: ip:\"localhost\" port:5656")
        nbIdentity := &entities.NbIdentity{InventoryName: "name", GlobalNbId: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"}}
        nb := &entities.NodebInfo{}
        nb.Port = 5656