blob: dd68b05dc05888ced5367908b6bf48fc58cca899 [file] [log] [blame]
Alexander Couzens8e1dfd02020-09-07 04:26:20 +02001module SGSN_Tests_NS {
2
3/* Osmocom SGSN test suite in TTCN-3
4 * (C) 2020 sysmocom - s.f.m.c. GmbH
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
13import from Osmocom_Types all;
14import from Osmocom_Gb_Types all;
15import from Osmocom_VTY_Functions all;
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020016import from NS_Types all;
17import from RAW_NS all;
18import from SGSN_Tests all;
19
20type component RAW_Test_CT extends RAW_NS_CT, test_CT {
21}
22
23testcase TC_NS_connect_reset() runs on RAW_Test_CT {
24 f_init_vty();
Alexander Couzensc3165722021-01-11 02:51:45 +010025 f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0);
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020026
27 /* Send a NS-ALIVE */
28 f_outgoing_ns_reset();
29
30 f_sleep(1.0);
Alexander Couzensc3165722021-01-11 02:51:45 +010031 f_clean_ns_codec();
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020032}
33
34testcase TC_NS_connect_alive() runs on RAW_Test_CT {
35 f_init_vty();
Alexander Couzensc3165722021-01-11 02:51:45 +010036 f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0);
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020037
38 /* Send a NS-ALIVE */
Alexander Couzensc3165722021-01-11 02:51:45 +010039 NSCP[0].send(t_NS_ALIVE);
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020040 alt {
Alexander Couzensc3165722021-01-11 02:51:45 +010041 [] NSCP[0].receive(t_NS_ALIVE_ACK);
42 [] NSCP[0].receive(tr_NS_STATUS(*)) { setverdict(fail); }
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020043 [] NSCP[0].receive { repeat; }
44 }
45
46 f_sleep(1.0);
Alexander Couzensc3165722021-01-11 02:51:45 +010047 f_clean_ns_codec();
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020048}
49
50control {
51 execute( TC_NS_connect_alive() );
52 execute( TC_NS_connect_reset() );
53}
54
55}