Harald Welte | a013e68 | 2018-06-18 19:49:39 +0200 | [diff] [blame^] | 1 | module RANAP_Selftests { |
| 2 | |
| 3 | import from RANAP_CommonDataTypes all; |
| 4 | import from RANAP_Constants all; |
| 5 | import from RANAP_Containers all; |
| 6 | import from RANAP_IEs all; |
| 7 | import from RANAP_PDU_Contents all; |
| 8 | import from RANAP_PDU_Descriptions all; |
| 9 | import from RANAP_Types all; |
| 10 | |
| 11 | type component test_CT { |
| 12 | }; |
| 13 | |
| 14 | const octetstring c_InitUE_CM_SRV_REQ := '001340400000060003400100000f40060046f3120064003a40080046f312006400000010400e0d052471034f188005f407000008004f40030000000056400546f312000f'O; |
| 15 | const octetstring c_CommonId := '000f4010000001001740095046239134707780f3'O; |
| 16 | const octetstring c_DT_CM_SRV_ACK := '0014400f000002003b40010000104003020521'O; |
| 17 | const octetstring c_DT_MO_SETUP := '00144019000001001040121103450404600200815e0381654215021101'O; |
| 18 | const octetstring c_DT_MT_CALL_PROC := '00144010000002003b4001000010400403830280'O; |
| 19 | const octetstring c_RAB_AssReq := '0000404700000100360040000001003500363802d0012fa7202fa80000f44c080a028000514000272028140067400000222814003c40000000503d0800101faf026ed64047d40000400100'O; |
| 20 | const octetstring c_RAB_AssResp := '6000001a000001003440130000010033400c60087c0a80242240e2040000'O; |
| 21 | const octetstring c_IuRelReq := '000b4009000001000440020340'O; |
| 22 | const octetstring c_ResetResource := '001b001c00000300030001000004400142004d400b000001004e000400000000'O; |
| 23 | const octetstring c_IuRelCmd := '00014009000001000400020340'O; |
| 24 | |
| 25 | type record EnDecTestcase { |
| 26 | charstring name, |
| 27 | octetstring encoded |
| 28 | }; |
| 29 | |
| 30 | type record of EnDecTestcase EnDecTestcases; |
| 31 | |
| 32 | const EnDecTestcases test_data := { |
| 33 | { |
| 34 | name := "InitialUE_CM_SRV_REQ", |
| 35 | encoded := c_InitUE_CM_SRV_REQ |
| 36 | }, { |
| 37 | name := "CommonID", |
| 38 | encoded := c_CommonId |
| 39 | }, { |
| 40 | name := "DirectTransfer CM SERVICE ACK", |
| 41 | encoded := c_DT_CM_SRV_ACK |
| 42 | }, { |
| 43 | name := "DirectTransfer MO CC SETUP", |
| 44 | encoded := c_DT_MO_SETUP |
| 45 | }, { |
| 46 | name := "DirectTransfer MT CC CALL PROCEEDING", |
| 47 | encoded := c_DT_MT_CALL_PROC |
| 48 | }, { |
| 49 | name := "RAB Assignment Request", |
| 50 | encoded := c_RAB_AssReq |
| 51 | }, { |
| 52 | name := "RAB Assignment Response", |
| 53 | encoded := c_RAB_AssResp |
| 54 | }, { |
| 55 | name := "Iu Release Request", |
| 56 | encoded := c_IuRelReq |
| 57 | }, { |
| 58 | name := "Reset Resource", |
| 59 | encoded := c_ResetResource |
| 60 | }, { |
| 61 | name := "Iu Release Command", |
| 62 | encoded := c_IuRelCmd |
| 63 | } |
| 64 | }; |
| 65 | |
| 66 | testcase TC_foo() runs on test_CT { |
| 67 | var integer i; |
| 68 | for (i := 0; i < lengthof(test_data); i := i+1) { |
| 69 | var EnDecTestcase tc := test_data[i]; |
| 70 | var RANAP_PDU pdu := dec_RANAP_PDU(tc.encoded); |
| 71 | log(tc.name, " decoded: ", pdu); |
| 72 | } |
| 73 | setverdict(pass); |
| 74 | } |
| 75 | |
| 76 | } |