blob: a540b102191894e480ff5dc1bb7788efb68caee8 [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
Harald Welte0db44132019-10-17 11:09:05 +020022type component Test_CT {
23 port TELNETasp_PT VTY;
24 timer g_Tguard := 30.0;
25 var boolean g_test_initialized := false;
26}
27
28private altstep as_gTguard() runs on Test_CT {
29 [] g_Tguard.timeout {
30 setverdict(fail, "Global guard timer timed out");
31 mtc.stop;
32 }
33}
34
35friend function f_init_common() runs on Test_CT {
36 if (g_test_initialized) {
37 return;
38 }
39 g_test_initialized := true;
40
41 map(self:VTY, system:VTY);
42 f_vty_set_prompts(VTY);
43 f_vty_transceive(VTY, "enable");
44
45 activate(as_gTguard());
46 g_Tguard.start;
47}
48
49
50
51}