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