Alexander Couzens | 8e1dfd0 | 2020-09-07 04:26:20 +0200 | [diff] [blame] | 1 | module 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 | |
| 13 | import from Osmocom_Types all; |
| 14 | import from Osmocom_Gb_Types all; |
| 15 | import from Osmocom_VTY_Functions all; |
| 16 | import from NS_CodecPort all; |
| 17 | import from NS_Types all; |
| 18 | import from RAW_NS all; |
| 19 | import from SGSN_Tests all; |
| 20 | |
| 21 | type component RAW_Test_CT extends RAW_NS_CT, test_CT { |
| 22 | } |
| 23 | |
| 24 | testcase 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 | |
| 36 | testcase 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 | |
| 53 | control { |
| 54 | execute( TC_NS_connect_alive() ); |
| 55 | execute( TC_NS_connect_reset() ); |
| 56 | } |
| 57 | |
| 58 | } |