Harald Welte | 023b61b | 2020-09-12 20:41:05 +0200 | [diff] [blame] | 1 | module FRNET_Tests { |
| 2 | |
| 3 | import from General_Types all; |
| 4 | import from Osmocom_Types all; |
| 5 | import from Osmocom_Gb_Types all; |
| 6 | |
| 7 | import from NS_Emulation all; |
| 8 | import from BSSGP_Emulation all; |
| 9 | |
| 10 | modulepar { |
| 11 | NSConfigurations mp_nsconfig := { |
| 12 | { |
| 13 | provider := { |
| 14 | fr := { |
| 15 | netdev := "hdlc2", |
| 16 | dlci := 123 |
| 17 | } |
| 18 | }, |
| 19 | nsvci := 123, |
| 20 | nsei := 123, |
| 21 | role_sgsn := true, |
| 22 | handle_sns := false |
| 23 | } |
| 24 | }; |
| 25 | } |
| 26 | |
| 27 | type record GbInstance { |
| 28 | NS_CT vc_NS, |
| 29 | BSSGP_CT vc_BSSGP, |
| 30 | BssgpConfig cfg |
| 31 | }; |
| 32 | |
| 33 | const integer NUM_GB := 1; |
| 34 | type record length(NUM_GB) of GbInstance GbInstances; |
| 35 | type record length(NUM_GB) of NSConfiguration NSConfigurations; |
| 36 | type record length(NUM_GB) of BssgpCellId BssgpCellIds; |
| 37 | |
| 38 | |
| 39 | type component test_CT { |
| 40 | var GbInstances g_gb; |
| 41 | }; |
| 42 | |
| 43 | private function f_init_gb(inout GbInstance gb, charstring id, integer offset) runs on test_CT { |
| 44 | var charstring id_idx := id & int2str(offset); |
| 45 | gb.vc_NS := NS_CT.create(id_idx & "-NSemu"); |
| 46 | gb.vc_BSSGP := BSSGP_CT.create(id_idx & "-BSSGPemu"); |
| 47 | connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP); |
| 48 | gb.vc_NS.start(NSStart(mp_nsconfig[offset], id_idx)); |
| 49 | gb.vc_BSSGP.start(BssgpStart(gb.cfg, testcasename())); |
| 50 | } |
| 51 | |
| 52 | testcase TC_foo() runs on test_CT { |
| 53 | g_gb[0].cfg := { |
| 54 | nsei := 123, |
| 55 | sgsn_role := true, |
| 56 | bvc := { |
| 57 | { |
| 58 | bvci := 1123, |
| 59 | cell_id := { |
| 60 | ra_id := { |
| 61 | lai := { |
| 62 | mcc_mnc := '262F42'H, |
| 63 | lac := 11123 |
| 64 | }, |
| 65 | rac := 1 |
| 66 | }, |
| 67 | cell_id := 31123 |
| 68 | }, |
| 69 | depth := BSSGP_DECODE_DEPTH_LLC |
| 70 | } |
| 71 | } |
| 72 | }; |
| 73 | f_init_gb(g_gb[0], "gb", 0); |
| 74 | while (true) { |
| 75 | f_sleep(100.0); |
| 76 | } |
| 77 | } |
| 78 | |
Harald Welte | d077075 | 2020-11-11 19:03:41 +0100 | [diff] [blame] | 79 | control { |
| 80 | execute( TC_foo() ); |
| 81 | } |
| 82 | |
Harald Welte | 023b61b | 2020-09-12 20:41:05 +0200 | [diff] [blame] | 83 | |
| 84 | } |