Osmocom test suites in TTCN-3 (Eclipse Titan) https://osmocom.org/projects/core-testing-infra
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
osmo-ttcn3-hacks/sgsn/SGSN_Tests_NS.ttcn

58 lines
1.4 KiB

module SGSN_Tests_NS {
/* Osmocom SGSN test suite in TTCN-3
* (C) 2020 sysmocom - s.f.m.c. GmbH
* All rights reserved.
*
* Released under the terms of GNU General Public License, Version 2 or
* (at your option) any later version.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
import from Osmocom_Types all;
import from Osmocom_Gb_Types all;
import from Osmocom_VTY_Functions all;
import from NS_CodecPort all;
import from NS_Types all;
import from RAW_NS all;
import from SGSN_Tests all;
type component RAW_Test_CT extends RAW_NS_CT, test_CT {
}
testcase TC_NS_connect_reset() runs on RAW_Test_CT {
f_init_vty();
f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0, tc_offset := 10);
f_vty_config(SGSNVTY, "ns", "encapsulation udp use-reset-block-unblock enabled");
/* Send a NS-ALIVE */
f_outgoing_ns_reset();
f_sleep(1.0);
f_cleanup();
}
testcase TC_NS_connect_alive() runs on RAW_Test_CT {
f_init_vty();
f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0, tc_offset := 20);
f_vty_config(SGSNVTY, "ns", "encapsulation udp use-reset-block-unblock disabled");
/* Send a NS-ALIVE */
NSCP[0].send(t_NS_Send(g_ns_conn_id[0], t_NS_ALIVE));
alt {
[] NSCP[0].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK));
[] NSCP[0].receive(t_NS_RecvFrom(tr_NS_STATUS(*))) { setverdict(fail); }
[] NSCP[0].receive { repeat; }
}
f_sleep(1.0);
f_cleanup();
}
control {
execute( TC_NS_connect_alive() );
execute( TC_NS_connect_reset() );
}
}