blob: d2d184f4a4436ffeba3f1cb2abb6d96802d7f594 [file] [log] [blame]
Harald Welte023b61b2020-09-12 20:41:05 +02001module FR_Tests {
2
3import from General_Types all;
4import from Osmocom_Types all;
5import from Osmocom_Gb_Types all;
6
7import from NS_Emulation all;
8import from BSSGP_Emulation all;
9
10modulepar {
11 NSConfigurations mp_nsconfig := {
12 {
Harald Welte023b61b2020-09-12 20:41:05 +020013 nsei := 123,
14 role_sgsn := false,
Harald Welte90f19742020-11-06 19:34:40 +010015 handle_sns := false,
16 nsvc := {
17 {
18 provider := {
19 fr := {
20 netdev := "hdlc1",
21 dlci := 123
22 }
23 },
24 nsvci := 123
25 }
26 }
Harald Welte023b61b2020-09-12 20:41:05 +020027 }
28 };
29}
30
31type record GbInstance {
32 NS_CT vc_NS,
33 BSSGP_CT vc_BSSGP,
34 BssgpConfig cfg
35};
36
37const integer NUM_GB := 1;
38type record length(NUM_GB) of GbInstance GbInstances;
39type record length(NUM_GB) of NSConfiguration NSConfigurations;
40type record length(NUM_GB) of BssgpCellId BssgpCellIds;
41
42
43type component test_CT {
44 var GbInstances g_gb;
45};
46
47private 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
56testcase TC_foo() runs on test_CT {
57 g_gb[0].cfg := {
58 nsei := 123,
59 sgsn_role := false,
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
83control {
84 execute( TC_foo() );
85}
86
87}