blob: 9ef2dfb2d952bf2b726dc80732a2f95724ff291e [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 f_vty_config(SGSNVTY, "ns", "encapsulation udp use-reset-block-unblock enabled");
27
28 /* Send a NS-ALIVE */
29 f_outgoing_ns_reset();
30
31 f_sleep(1.0);
Alexander Couzensc3165722021-01-11 02:51:45 +010032 f_clean_ns_codec();
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020033}
34
35testcase TC_NS_connect_alive() runs on RAW_Test_CT {
36 f_init_vty();
Alexander Couzensc3165722021-01-11 02:51:45 +010037 f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0);
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020038 f_vty_config(SGSNVTY, "ns", "encapsulation udp use-reset-block-unblock disabled");
39
40 /* Send a NS-ALIVE */
Alexander Couzensc3165722021-01-11 02:51:45 +010041 NSCP[0].send(t_NS_ALIVE);
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020042 alt {
Alexander Couzensc3165722021-01-11 02:51:45 +010043 [] NSCP[0].receive(t_NS_ALIVE_ACK);
44 [] NSCP[0].receive(tr_NS_STATUS(*)) { setverdict(fail); }
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020045 [] NSCP[0].receive { repeat; }
46 }
47
48 f_sleep(1.0);
Alexander Couzensc3165722021-01-11 02:51:45 +010049 f_clean_ns_codec();
Alexander Couzens8e1dfd02020-09-07 04:26:20 +020050}
51
52control {
53 execute( TC_NS_connect_alive() );
54 execute( TC_NS_connect_reset() );
55}
56
57}