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; |
Alexander Couzens | 8e1dfd0 | 2020-09-07 04:26:20 +0200 | [diff] [blame] | 16 | import from NS_Types all; |
| 17 | import from RAW_NS all; |
| 18 | import from SGSN_Tests all; |
| 19 | |
| 20 | type component RAW_Test_CT extends RAW_NS_CT, test_CT { |
| 21 | } |
| 22 | |
| 23 | testcase TC_NS_connect_reset() runs on RAW_Test_CT { |
| 24 | f_init_vty(); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 25 | f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0); |
Alexander Couzens | 8e1dfd0 | 2020-09-07 04:26:20 +0200 | [diff] [blame] | 26 | |
| 27 | /* Send a NS-ALIVE */ |
| 28 | f_outgoing_ns_reset(); |
| 29 | |
| 30 | f_sleep(1.0); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 31 | f_clean_ns_codec(); |
Alexander Couzens | 8e1dfd0 | 2020-09-07 04:26:20 +0200 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | testcase TC_NS_connect_alive() runs on RAW_Test_CT { |
| 35 | f_init_vty(); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 36 | f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0); |
Alexander Couzens | 8e1dfd0 | 2020-09-07 04:26:20 +0200 | [diff] [blame] | 37 | |
| 38 | /* Send a NS-ALIVE */ |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 39 | NSCP[0].send(t_NS_ALIVE); |
Alexander Couzens | 8e1dfd0 | 2020-09-07 04:26:20 +0200 | [diff] [blame] | 40 | alt { |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 41 | [] NSCP[0].receive(t_NS_ALIVE_ACK); |
| 42 | [] NSCP[0].receive(tr_NS_STATUS(*)) { setverdict(fail); } |
Alexander Couzens | 8e1dfd0 | 2020-09-07 04:26:20 +0200 | [diff] [blame] | 43 | [] NSCP[0].receive { repeat; } |
| 44 | } |
| 45 | |
| 46 | f_sleep(1.0); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 47 | f_clean_ns_codec(); |
Alexander Couzens | 8e1dfd0 | 2020-09-07 04:26:20 +0200 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | control { |
| 51 | execute( TC_NS_connect_alive() ); |
| 52 | execute( TC_NS_connect_reset() ); |
| 53 | } |
| 54 | |
| 55 | } |