blob: c2994f66631d340e8e17829658e953bcc1db49e4 [file] [log] [blame]
Harald Welte023b61b2020-09-12 20:41:05 +02001module FRNET_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 {
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
27type record GbInstance {
28 NS_CT vc_NS,
29 BSSGP_CT vc_BSSGP,
30 BssgpConfig cfg
31};
32
33const integer NUM_GB := 1;
34type record length(NUM_GB) of GbInstance GbInstances;
35type record length(NUM_GB) of NSConfiguration NSConfigurations;
36type record length(NUM_GB) of BssgpCellId BssgpCellIds;
37
38
39type component test_CT {
40 var GbInstances g_gb;
41};
42
43private 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
52testcase 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
79
80}