blob: aee5a886fc70d7b7985fcbd02767edfa3b3cec55 [file] [log] [blame]
Harald Welte0db44132019-10-17 11:09:05 +02001module STP_Tests_Common {
2
3/* Osmocom STP test suite in in TTCN-3
4 * (C) 2019 Harald Welte <laforge@gnumonks.org>
5 * All rights reserved.
6 *
7 * Released under the terms of GNU General Public License, Version 2 or
8 * (at your option) any later version.
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12
13friend module STP_Tests;
14friend module STP_Tests_M3UA;
15friend module STP_Tests_IPA;
16
17import from TELNETasp_PortType all;
18import from Osmocom_VTY_Functions all;
19
20import from IPL4asp_Types all;
21
22modulepar {
23 charstring mp_stp_ip := "127.0.0.1";
24 charstring mp_local_ip := "127.0.0.1";
25}
26
27friend template (value) SctpTuple ts_SCTP(template (omit) integer ppid := 3,
28 template (omit) integer stream := 0) := {
29 sinfo_stream := stream,
30 sinfo_ppid := ppid,
31 remSocks := omit,
32 assocId := omit
33}
34
35type component Test_CT {
36 port TELNETasp_PT VTY;
37 timer g_Tguard := 30.0;
38 var boolean g_test_initialized := false;
39}
40
41private altstep as_gTguard() runs on Test_CT {
42 [] g_Tguard.timeout {
43 setverdict(fail, "Global guard timer timed out");
44 mtc.stop;
45 }
46}
47
48friend function f_init_common() runs on Test_CT {
49 if (g_test_initialized) {
50 return;
51 }
52 g_test_initialized := true;
53
54 map(self:VTY, system:VTY);
55 f_vty_set_prompts(VTY);
56 f_vty_transceive(VTY, "enable");
57
58 activate(as_gTguard());
59 g_Tguard.start;
60}
61
62
63
64}