2 ==================================================================================
3 Copyright (c) 2019 AT&T Intellectual Property.
4 Copyright (c) 2019 Nokia
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ==================================================================================
23 "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
27 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
30 func (testCtxt *E2ApTests) E2ApTestMsgIndication(t *testing.T) {
32 testCtxt.SetDesc("MsgIndication")
33 e2Ind := testCtxt.packerif.NewPackerIndication()
35 testCtxt.testPrint("########## Indication ##########")
36 testCtxt.testPrint("Indication: init")
38 aindenc := e2ap.E2APIndication{}
39 aindenc.RequestId.Id = 1
40 aindenc.RequestId.Seq = 22
41 aindenc.FunctionId = 33
42 aindenc.IndicationSn = 1
43 aindenc.IndicationType = e2ap.E2AP_IndicationTypeReport
44 aindenc.IndicationHeader.InterfaceId.GlobalEnbId.Present = true
45 aindenc.IndicationHeader.InterfaceId.GlobalEnbId.PlmnIdentity.StringPut("310150")
46 //Bits 20, 28(works), 18, 21 (asn1 problems)
47 aindenc.IndicationHeader.InterfaceId.GlobalEnbId.NodeId.Bits = e2ap.E2AP_ENBIDHomeBits28
48 aindenc.IndicationHeader.InterfaceId.GlobalEnbId.NodeId.Id = 202251
49 aindenc.IndicationHeader.InterfaceDirection = 0
50 aindenc.IndicationMessage.InterfaceMessage.Buf = []uint8{1, 2, 3, 4, 5}
51 //aindenc.CallProcessId.CallProcessIDVal=100
53 seterr := e2Ind.Set(&aindenc)
55 testCtxt.testError(t, "set err: %s", seterr.Error())
59 testCtxt.testPrint("Indication: print:\n%s", e2Ind.String())
60 testCtxt.testPrint("Indication: pack")
61 err, packedMsg := e2Ind.Pack(nil)
63 testCtxt.testError(t, "Indication Pack failed: %s", err.Error())
66 testCtxt.testPrint("Indication: unpack")
67 err = e2Ind.UnPack(packedMsg)
69 testCtxt.testError(t, "Indication UnPack failed: %s", err.Error())
72 testCtxt.testPrint("Indication: print:\n%s", e2Ind.String())
73 geterr, ainddec := e2Ind.Get()
75 testCtxt.testError(t, "Indication get nil: %s", geterr.Error())
78 testCtxt.testValueEquality(t, "msg", &aindenc, ainddec)