blob: cce32cc163b5b5a48eb0227f924e5f7812eff8c5 [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;
16import from NS_CodecPort all;
17import from NS_Types all;
18import from RAW_NS all;
19import from SGSN_Tests all;
20
21type component RAW_Test_CT extends RAW_NS_CT, test_CT {
22}
23
24testcase TC_NS_connect_reset() runs on RAW_Test_CT {
25 f_init_vty();
26 f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0, tc_offset := 10);
27 f_vty_config(SGSNVTY, "ns", "encapsulation udp use-reset-block-unblock enabled");
28
29 /* Send a NS-ALIVE */
30 f_outgoing_ns_reset();
31
32 f_sleep(1.0);
33 f_cleanup();
34}
35
36testcase TC_NS_connect_alive() runs on RAW_Test_CT {
37 f_init_vty();
38 f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0, tc_offset := 20);
39 f_vty_config(SGSNVTY, "ns", "encapsulation udp use-reset-block-unblock disabled");
40
41 /* Send a NS-ALIVE */
42 NSCP[0].send(t_NS_Send(g_ns_conn_id[0], t_NS_ALIVE));
43 alt {
44 [] NSCP[0].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK));
45 [] NSCP[0].receive(t_NS_RecvFrom(tr_NS_STATUS(*))) { setverdict(fail); }
46 [] NSCP[0].receive { repeat; }
47 }
48
49 f_sleep(1.0);
50 f_cleanup();
51}
52
53control {
54 execute( TC_NS_connect_alive() );
55 execute( TC_NS_connect_reset() );
56}
57
58}