PCU: Move SNS specific functions to PCU_Tests_RAW_SNS.ttcn

Change-Id: Ie41a21b6f2b95f4aaea84d8b717e96efefb704e3
RelateD: OS#3372
This commit is contained in:
Harald Welte 2019-02-21 18:21:01 +01:00
parent f7b74076c2
commit c4d7beb3ff
2 changed files with 38 additions and 35 deletions

View File

@ -96,41 +96,6 @@ function f_ns_exp(template PDU_NS exp_rx) runs on RAW_NS_CT return PDU_NS {
return nrf.msg;
}
/* perform inbound SNS-SIZE procedure */
function f_incoming_sns_size(template (omit) NsCause cause := omit) runs on RAW_NS_CT {
var PDU_NS rx;
/* expect one single SNS-SIZE with RESET flag; one remote v4 EP; no v6 EP */
rx := f_ns_exp(tr_SNS_SIZE(mp_nsconfig.nsei, rst_flag := true, max_nsvcs := ?,
num_v4 := 1, num_v6 := omit));
NSCP.send(t_NS_Send(g_ns_conn_id, ts_SNS_SIZE_ACK(mp_nsconfig.nsei, cause)));
}
/* perform outbound SNS-SIZE procedure */
function f_outgoing_sns_size(template (omit) NsCause cause := omit) runs on RAW_NS_CT {
var PDU_NS rx;
NSCP.send(t_NS_Send(g_ns_conn_id, ts_SNS_SIZE(mp_nsconfig.nsei, rst_flag := true, max_nsvcs := 1,
num_v4 := 1, num_v6 := omit)
));
/* expect one single SNS-SIZE with RESET flag; one remote v4 EP; no v6 EP */
rx := f_ns_exp(tr_SNS_SIZE_ACK(mp_nsconfig.nsei, cause));
}
/* perform inbound SNS-CONFIG procedure */
function f_incoming_sns_config(template (omit) NsCause cause := omit) runs on RAW_NS_CT {
var PDU_NS rx;
rx := f_ns_exp(tr_SNS_CONFIG(mp_nsconfig.nsei, end_flag := true, v4 := ?));
NSCP.send(t_NS_Send(g_ns_conn_id, ts_SNS_CONFIG_ACK(mp_nsconfig.nsei, cause)));
}
/* perform outbound SNS-CONFIG procedure */
function f_outgoing_sns_config(template (omit) NsCause cause := omit) runs on RAW_NS_CT {
var PDU_NS rx;
var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(mp_nsconfig.local_ip,
mp_nsconfig.local_udp_port) }
NSCP.send(t_NS_Send(g_ns_conn_id, ts_SNS_CONFIG(mp_nsconfig.nsei, true, v4)));
rx := f_ns_exp(tr_SNS_CONFIG_ACK(mp_nsconfig.nsei, cause));
}
/* perform outbound NS-ALIVE procedure */
function f_outgoing_ns_alive() runs on RAW_NS_CT {
NSCP.send(t_NS_Send(g_ns_conn_id, t_NS_ALIVE));

View File

@ -3,11 +3,49 @@ module PCU_Tests_RAW_SNS {
import from Osmocom_Types all;
import from PCU_Tests all;
import from PCU_Tests_RAW all;
import from Osmocom_Gb_Types all;
import from NS_CodecPort all;
import from NS_Types all;
/**********************************************************************************
* Modern Gb/IP bring-up test cases using IP Sub-Network Service (SNS)
**********************************************************************************/
/* perform inbound SNS-SIZE procedure */
function f_incoming_sns_size(template (omit) NsCause cause := omit) runs on RAW_NS_CT {
var PDU_NS rx;
/* expect one single SNS-SIZE with RESET flag; one remote v4 EP; no v6 EP */
rx := f_ns_exp(tr_SNS_SIZE(mp_nsconfig.nsei, rst_flag := true, max_nsvcs := ?,
num_v4 := 1, num_v6 := omit));
NSCP.send(t_NS_Send(g_ns_conn_id, ts_SNS_SIZE_ACK(mp_nsconfig.nsei, cause)));
}
/* perform outbound SNS-SIZE procedure */
function f_outgoing_sns_size(template (omit) NsCause cause := omit) runs on RAW_NS_CT {
var PDU_NS rx;
NSCP.send(t_NS_Send(g_ns_conn_id, ts_SNS_SIZE(mp_nsconfig.nsei, rst_flag := true, max_nsvcs := 1,
num_v4 := 1, num_v6 := omit)
));
/* expect one single SNS-SIZE with RESET flag; one remote v4 EP; no v6 EP */
rx := f_ns_exp(tr_SNS_SIZE_ACK(mp_nsconfig.nsei, cause));
}
/* perform inbound SNS-CONFIG procedure */
function f_incoming_sns_config(template (omit) NsCause cause := omit) runs on RAW_NS_CT {
var PDU_NS rx;
rx := f_ns_exp(tr_SNS_CONFIG(mp_nsconfig.nsei, end_flag := true, v4 := ?));
NSCP.send(t_NS_Send(g_ns_conn_id, ts_SNS_CONFIG_ACK(mp_nsconfig.nsei, cause)));
}
/* perform outbound SNS-CONFIG procedure */
function f_outgoing_sns_config(template (omit) NsCause cause := omit) runs on RAW_NS_CT {
var PDU_NS rx;
var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(mp_nsconfig.local_ip,
mp_nsconfig.local_udp_port) }
NSCP.send(t_NS_Send(g_ns_conn_id, ts_SNS_CONFIG(mp_nsconfig.nsei, true, v4)));
rx := f_ns_exp(tr_SNS_CONFIG_ACK(mp_nsconfig.nsei, cause));
}
/* PCU-originated SNS-SIZE: successful case */
testcase TC_sns_po_size_success() runs on RAW_NS_CT {
f_init_ns_codec();