X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fe2pdus%2Fx2_reset_known_causes_test.go;h=2988f40e1184bbd476a31764dbd81b83ee551069;hb=refs%2Fheads%2Fg-release;hp=5a3d474f76032c965e6ebf02361fce669d208092;hpb=574c21e37f9e740579227c81c22253b8c7aa5404;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/e2pdus/x2_reset_known_causes_test.go b/E2Manager/e2pdus/x2_reset_known_causes_test.go index 5a3d474..2988f40 100644 --- a/E2Manager/e2pdus/x2_reset_known_causes_test.go +++ b/E2Manager/e2pdus/x2_reset_known_causes_test.go @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2019 AT&T Intellectual Property. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * This source code is part of the near-RT RIC (RAN Intelligent Controller) + * platform project (RICP). + */ + package e2pdus import ( @@ -8,13 +29,13 @@ import ( ) func TestKnownCausesToX2ResetPDU(t *testing.T) { - _,err := logger.InitLogger(logger.InfoLevel) - if err!=nil{ + _, err := logger.InitLogger(logger.InfoLevel) + if err != nil { t.Errorf("failed to initialize logger, error: %s", err) } var testCases = []struct { - cause string - packedPdu string + cause string + packedPdu string }{ { cause: OmInterventionCause, @@ -33,7 +54,6 @@ func TestKnownCausesToX2ResetPDU(t *testing.T) { cause: "radioNetwork:invalid-MME-groupid", packedPdu: "00070009000001000540020680", }, - } for _, tc := range testCases { @@ -56,33 +76,31 @@ func TestKnownCausesToX2ResetPDU(t *testing.T) { } } - func TestKnownCausesToX2ResetPDUFailure(t *testing.T) { _, err := logger.InitLogger(logger.InfoLevel) if err != nil { t.Errorf("failed to initialize logger, error: %s", err) } - _, ok := KnownCausesToX2ResetPDU("xxxx") + _, ok := KnownCausesToX2ResetPDU("xxxx") if ok { t.Errorf("want: not found, got: success.\n") } } - func TestPrepareX2ResetPDUsFailure(t *testing.T) { _, err := logger.InitLogger(logger.InfoLevel) if err != nil { t.Errorf("failed to initialize logger, error: %s", err) } - err = prepareX2ResetPDUs(1, 4096) + err = prepareX2ResetPDUs(1, 4096) if err == nil { t.Errorf("want: error, got: success.\n") } - expected:= "#reset_request_handler.Handle - failed to build and pack the reset message #src/asn1codec_utils.c.pack_pdu_aux - Encoded output of E2AP-PDU, is too big:" + expected := "failed to build and pack the reset message #src/asn1codec_utils.c.pack_pdu_aux - Encoded output of E2AP-PDU, is too big:" if !strings.Contains(err.Error(), expected) { t.Errorf("want :[%s], got: [%s]\n", expected, err) } -} \ No newline at end of file +}