RAW_NS: rework NS connection to use NS_Provider

Previous RAW_NS only supported NS over UDP because
it handled the UDP connection on it's own.
Because of this there was no cleanup function for the tests
because no virtual component were started.
Using the new NS_Provider allows to use the same tests over
UDP and FR with no changes.

Change-Id: I8a3b6c72798a75f434f54229fdbfc802cd13967e
This commit is contained in:
Alexander Couzens 2021-01-11 02:51:45 +01:00 committed by lynxis lazus
parent d6f8981401
commit c316572db1
11 changed files with 261 additions and 149 deletions

View File

@ -10,23 +10,29 @@ module RAW_NS {
* SPDX-License-Identifier: GPL-2.0-or-later
*/
import from Misc_Helpers all;
import from General_Types all;
import from Osmocom_Types all;
import from Osmocom_Gb_Types all;
import from NS_CodecPort all;
import from NS_Emulation all;
import from NS_Types all;
import from BSSGP_Types all;
import from NS_CodecPort all;
import from NS_CodecPort_CtrlFunct all;
import from NS_Emulation all;
import from Native_Functions all;
import from IPL4asp_Types all;
import from NS_Provider_IPL4 all;
#ifdef NS_EMULATION_FR
import from NS_Provider_FR all;
#endif
public type component RAW_NS_CT {
/* UDP port towards the bottom (IUT) */
port NS_CODEC_PT NSCP[4];
var ConnectionId g_ns_conn_id[4] := {-1, -1, -1, -1};
var NSConfiguration g_nsconfig[4];
port NS_PROVIDER_PT NSCP[4];
var NS_Provider_IPL4_CT vc_NSP_IP[4];
#ifdef NS_EMULATION_FR
var NS_Provider_FR_CT vc_NSP_FR[4];
#endif
var NSConfiguration g_nsconfig;
timer g_T_guard;
}
@ -37,7 +43,7 @@ public altstep as_Tguard() runs on RAW_NS_CT {
}
}
function f_init_ns_codec(NSConfiguration ns_config, integer idx := 0, float guard_secs := 60.0, integer tc_offset := 0) runs on RAW_NS_CT {
function f_init_ns_codec(NSConfiguration ns_config, integer idx := 0, float guard_secs := 60.0, charstring id := testcasename()) runs on RAW_NS_CT {
var Result res;
if (not g_T_guard.running) {
@ -45,54 +51,64 @@ function f_init_ns_codec(NSConfiguration ns_config, integer idx := 0, float guar
activate(as_Tguard());
}
if (not isbound(g_nsconfig) or not isbound(g_nsconfig[idx])) {
/* copy most parts from mp_nsconfig */
g_nsconfig[idx] := ns_config;
/* adjust those parts different for each NS-VC */
g_nsconfig[idx].nsvc[0].nsvci := ns_config.nsvc[0].nsvci + idx;
g_nsconfig[idx].nsvc[0].provider.ip.local_udp_port := ns_config.nsvc[0].provider.ip.local_udp_port + idx + tc_offset;
if (not isbound(g_nsconfig)) {
g_nsconfig := ns_config;
}
map(self:NSCP[idx], system:NSCP);
/* Connect the UDP socket */
var NSConfiguration nscfg := g_nsconfig[idx];
var NSVCConfiguration nsvc_cfg := nscfg.nsvc[0];
log("connecting NSCP[", idx, "] to ", nscfg);
res := f_IPL4_connect(NSCP[idx], nsvc_cfg.provider.ip.remote_ip, nsvc_cfg.provider.ip.remote_udp_port,
nsvc_cfg.provider.ip.local_ip, nsvc_cfg.provider.ip.local_udp_port, 0, { udp := {}});
if (not ispresent(res.connId)) {
setverdict(fail, "Could not connect NS UDP socket, check your configuration ", g_nsconfig[idx]);
mtc.stop;
if (ischosen(ns_config.nsvc[idx].provider.ip)) {
/* Connect the UDP socket */
vc_NSP_IP[idx] := NS_Provider_IPL4_CT.create(id & "-provIP");
connect(self:NSCP[idx], vc_NSP_IP[idx]:NSE);
vc_NSP_IP[idx].start(NS_Provider_IPL4.main(ns_config.nsvc[idx], ns_config, id));
#ifdef NS_EMULATION_FR
} else if (ischosen(ns_config.nsvc[idx].provider.fr)) {
vc_NSP_FR[idx] := NS_Provider_FR_CT.create(id & "-provFR");
connect(self:NSCP[idx], vc_NSP_FR[idx]:NSE);
vc_NSP_FR[idx].start(NS_Provider_FR.main(ns_config.nsvc[idx], ns_config, id));
#endif
} else {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Unsupported NS provider");
}
g_ns_conn_id[idx] := res.connId;
NSCP[idx].receive(NS_Provider_Evt:{link_status:=NS_PROV_LINK_STATUS_UP});
}
function f_clean_ns_codec() runs on RAW_NS_CT {
for (var integer i := 0; i < lengthof(vc_NSP_IP); i := i + 1) {
vc_NSP_IP[i].stop;
}
#ifdef NS_EMULATION_FR
for (var integer i := 0; i < lengthof(vc_NSP_FR); i := i + 1) {
vc_NSP_FR[i].stop;
}
#endif NS_EMULATION_FR
}
public altstep ax_rx_fail_on_any_ns(integer idx := 0) runs on RAW_NS_CT {
var NS_RecvFrom nrf;
[] NSCP[idx].receive(t_NS_RecvFrom(?)) -> value nrf {
var PDU_NS nrf;
[] NSCP[idx].receive(PDU_NS: ?) -> value nrf {
setverdict(fail, "Received unexpected NS: ", nrf);
mtc.stop;
}
}
function f_ns_exp(template PDU_NS exp_rx, integer idx := 0) runs on RAW_NS_CT return PDU_NS {
var NS_RecvFrom nrf;
var PDU_NS nrf;
log("f_ns_exp() expecting ", exp_rx);
/* last activated altstep has the lowest priority */
var default d := activate(ax_rx_fail_on_any_ns());
alt {
[] NSCP[idx].receive(t_NS_RecvFrom(exp_rx)) -> value nrf { }
[] NSCP[idx].receive(PDU_NS: exp_rx) -> value nrf { }
}
deactivate(d);
return nrf.msg;
return nrf;
}
/* perform outbound NS-ALIVE procedure */
function f_outgoing_ns_alive(integer idx := 0) runs on RAW_NS_CT {
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_ALIVE));
NSCP[idx].send(t_NS_ALIVE);
alt {
[] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK));
[] NSCP[idx].receive(t_NS_ALIVE_ACK);
[] NSCP[idx].receive { repeat; }
}
}
@ -100,10 +116,10 @@ function f_outgoing_ns_alive(integer idx := 0) runs on RAW_NS_CT {
/* perform outbound NS-ALIVE procedure */
function f_outgoing_ns_alive_no_ack(integer idx := 0, float tout := 10.0) runs on RAW_NS_CT {
timer T := tout;
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_ALIVE));
NSCP[idx].send(t_NS_ALIVE);
T.start;
alt {
[] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK)) {
[] NSCP[idx].receive(t_NS_ALIVE_ACK) {
setverdict(fail, "Received unexpected NS-ALIVE ACK");
}
[] NSCP[idx].receive { repeat; }
@ -115,11 +131,11 @@ function f_outgoing_ns_alive_no_ack(integer idx := 0, float tout := 10.0) runs o
function f_outgoing_ns_reset(integer idx := 0, float tout := 10.0) runs on RAW_NS_CT {
timer T := tout;
var template PDU_NS reset := ts_NS_RESET(NS_CAUSE_EQUIPMENT_FAILURE, g_nsconfig[idx].nsvc[0].nsvci, g_nsconfig[idx].nsei)
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], reset));
var template PDU_NS reset := ts_NS_RESET(NS_CAUSE_EQUIPMENT_FAILURE, g_nsconfig.nsvc[idx].nsvci, g_nsconfig.nsei)
NSCP[idx].send(reset);
T.start;
alt {
[] NSCP[idx].receive(t_NS_RecvFrom(ts_NS_RESET_ACK(g_nsconfig[idx].nsvc[0].nsvci, g_nsconfig[idx].nsei))) {
[] NSCP[idx].receive(ts_NS_RESET_ACK(g_nsconfig.nsvc[idx].nsvci, g_nsconfig.nsei)) {
setverdict(pass);
}
[] NSCP[idx].receive { repeat; }
@ -131,17 +147,26 @@ function f_outgoing_ns_reset(integer idx := 0, float tout := 10.0) runs on RAW_N
/* perform outbound NS-BLOCK procedure */
function f_outgoing_ns_block(NsCause cause, integer idx := 0) runs on RAW_NS_CT {
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_BLOCK(cause, g_nsconfig[idx].nsvc[0].nsvci)));
NSCP[idx].send(ts_NS_BLOCK(cause, g_nsconfig.nsvc[idx].nsvci));
alt {
[] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_BLOCK_ACK(g_nsconfig[idx].nsvc[0].nsvci)));
[] NSCP[idx].receive(tr_NS_BLOCK_ACK(g_nsconfig.nsvc[idx].nsvci));
[] NSCP[idx].receive { repeat; }
}
}
/* perform outbound NS-UNBLOCK procedure */
function f_outgoing_ns_unblock(integer idx := 0) runs on RAW_NS_CT {
NSCP[idx].send(t_NS_UNBLOCK);
alt {
[] NSCP[idx].receive(t_NS_UNBLOCK_ACK);
[] NSCP[idx].receive { repeat; }
}
}
/* receive NS-ALIVE and ACK it */
altstep as_rx_alive_tx_ack(boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
[] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE)) {
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_ALIVE_ACK));
[] NSCP[idx].receive(t_NS_ALIVE) {
NSCP[idx].send(t_NS_ALIVE_ACK);
if (not oneshot) { repeat; }
}
}
@ -153,11 +178,11 @@ runs on RAW_NS_CT {
var PDU_BSSGP bssgp_tx := valueof(ts_BVC_RESET(BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS, bvci,
tx_cell_id));
timer T := 5.0;
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx))));
NSCP[idx].send(ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx)));
T.start;
alt {
[exp_ack] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
decmatch tr_BVC_RESET_ACK(bvci, rx_cell_id)))) {
[exp_ack] NSCP[idx].receive(tr_NS_UNITDATA(t_SduCtrlB, 0,
decmatch tr_BVC_RESET_ACK(bvci, rx_cell_id))) {
setverdict(pass);
}
[exp_ack] T.timeout {
@ -173,13 +198,13 @@ runs on RAW_NS_CT {
/* Receive a BSSGP RESET for given BVCI and ACK it */
altstep as_rx_bvc_reset_tx_ack(BssgpBvci bvci, template BssgpCellId rx_cell_id, template (omit) BssgpCellId tx_cell_id,
boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
var NS_RecvFrom ns_rf;
[] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
decmatch tr_BVC_RESET(?, bvci, rx_cell_id))))
var PDU_NS ns_rf;
[] NSCP[idx].receive(tr_NS_UNITDATA(t_SduCtrlB, 0,
decmatch tr_BVC_RESET(?, bvci, rx_cell_id)))
-> value ns_rf {
var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.pDU_NS_Unitdata.nS_SDU);
var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.pDU_NS_Unitdata.nS_SDU);
var PDU_BSSGP bssgp_tx := valueof(ts_BVC_RESET_ACK(bvci, tx_cell_id));
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx))));
NSCP[idx].send(ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx)));
if (not oneshot) { repeat; }
}
}
@ -187,27 +212,25 @@ altstep as_rx_bvc_reset_tx_ack(BssgpBvci bvci, template BssgpCellId rx_cell_id,
/* Receive a BSSGP UNBLOCK for given BVCI and ACK it */
altstep as_rx_bvc_unblock_tx_ack(BssgpBvci bvci, boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
var NS_RecvFrom ns_rf;
[] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
decmatch t_BVC_UNBLOCK(bvci))))
-> value ns_rf {
var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.pDU_NS_Unitdata.nS_SDU);
var PDU_NS ns_rf;
[] NSCP[idx].receive(tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch t_BVC_UNBLOCK(bvci))) -> value ns_rf {
var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.pDU_NS_Unitdata.nS_SDU);
var PDU_BSSGP bssgp_tx := valueof(t_BVC_UNBLOCK_ACK(bvci));
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx))));
NSCP[idx].send(ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx)));
if (not oneshot) { repeat; }
}
}
/* Receive a BSSGP FLOW-CONTROL-BVC and ACK it */
altstep as_rx_bvc_fc_tx_ack(BssgpBvci bvci, boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
var NS_RecvFrom ns_rf;
[] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, bvci,
decmatch tr_BVC_FC_BVC)))
var PDU_NS ns_rf;
[] NSCP[idx].receive(tr_NS_UNITDATA(t_SduCtrlB, bvci,
decmatch tr_BVC_FC_BVC))
-> value ns_rf {
var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.pDU_NS_Unitdata.nS_SDU);
var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.pDU_NS_Unitdata.nS_SDU);
var OCT1 tag := bssgp_rx.pDU_BSSGP_FLOW_CONTROL_BVC.tag.unstructured_Value;
var PDU_BSSGP bssgp_tx := valueof(t_BVC_FC_BVC_ACK(tag));
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_UNITDATA(t_SduCtrlB, bvci, enc_PDU_BSSGP(bssgp_tx))));
NSCP[idx].send(ts_NS_UNITDATA(t_SduCtrlB, bvci, enc_PDU_BSSGP(bssgp_tx)));
if (not oneshot) { repeat; }
}
}
@ -218,19 +241,18 @@ altstep as_rx_bvc_fc_tx_ack(BssgpBvci bvci, boolean oneshot := false, integer id
/* Receive a NS-RESET and ACK it */
public altstep as_rx_ns_reset_ack(boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
var NS_RecvFrom ns_rf;
[] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_RESET(NS_CAUSE_OM_INTERVENTION, g_nsconfig[idx].nsvc[0].nsvci,
g_nsconfig[idx].nsei))) -> value ns_rf {
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_RESET_ACK(g_nsconfig[idx].nsvc[0].nsvci,
g_nsconfig[idx].nsei)));
var PDU_NS ns_rf;
[] NSCP[idx].receive(tr_NS_RESET(NS_CAUSE_OM_INTERVENTION, g_nsconfig.nsvc[idx].nsvci,
g_nsconfig.nsei)) -> value ns_rf {
NSCP[idx].send(ts_NS_RESET_ACK(g_nsconfig.nsvc[idx].nsvci, g_nsconfig.nsei));
if (not oneshot) { repeat; }
}
}
/* Receive a NS-UNBLOCK and ACK it */
public altstep as_rx_ns_unblock_ack(boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
var NS_RecvFrom ns_rf;
[] NSCP[idx].receive(t_NS_RecvFrom(t_NS_UNBLOCK)) -> value ns_rf {
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_UNBLOCK_ACK));
var PDU_NS ns_rf;
[] NSCP[idx].receive(t_NS_UNBLOCK) -> value ns_rf {
NSCP[idx].send(t_NS_UNBLOCK_ACK);
if (not oneshot) { repeat; }
}
}

View File

@ -22,6 +22,30 @@ SGSN_Components.mp_nsconfig := {
}
},
nsvci := 1234
},
{
provider := {
ip := {
address_family := AF_INET,
local_ip := "127.0.0.1",
local_udp_port := 23001,
remote_ip := "127.0.0.1",
remote_udp_port := 22000
}
},
nsvci := 1234
},
{
provider := {
ip := {
address_family := AF_INET,
local_ip := "127.0.0.1",
local_udp_port := 23002,
remote_ip := "127.0.0.1",
remote_udp_port := 22000
}
},
nsvci := 1234
}
}
}

View File

@ -15,12 +15,9 @@ import from Osmocom_Types all;
import from PCU_Tests all;
import from SGSN_Components all;
import from Osmocom_Gb_Types all;
import from NS_CodecPort all;
import from NS_Types all;
import from BSSGP_Types all;
import from UD_Types all;
import from NS_CodecPort all;
import from NS_CodecPort_CtrlFunct all;
import from NS_Emulation all;
import from Native_Functions all;
import from IPL4asp_Types all;
@ -70,7 +67,7 @@ runs on RAW_Test_CT {
timer T := tout;
T.start;
alt {
[] NSCP[idx].receive(t_NS_RecvFrom(ns)) {
[] NSCP[idx].receive(ns) {
setverdict(fail, "NS-ALIVE from unconfigured (possibly initial) endpoint");
}
[] T.timeout {
@ -88,6 +85,7 @@ testcase TC_ns_reset() runs on RAW_Test_CT {
/* Expect inbound NS-RESET procedure */
as_rx_ns_reset_ack(oneshot := true);
setverdict(pass);
f_clean_ns_codec();
}
/* ensure NS-RESET are re-transmitted */
@ -97,13 +95,14 @@ testcase TC_ns_reset_retrans() runs on RAW_Test_CT {
var integer i;
for (i := 0; i < 3; i := i+1) {
NSCP[0].receive(t_NS_RecvFrom(tr_NS_RESET(NS_CAUSE_OM_INTERVENTION,
g_nsconfig[0].nsvc[0].nsvci, g_nsconfig[0].nsei)));
NSCP[0].receive(tr_NS_RESET(NS_CAUSE_OM_INTERVENTION,
g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei));
}
/* Expect inbound NS-RESET procedure */
as_rx_ns_reset_ack(oneshot := true);
setverdict(pass);
f_clean_ns_codec();
}
/* test the inbound NS-ALIVE procedure after NS-RESET */
@ -116,9 +115,10 @@ testcase TC_ns_alive() runs on RAW_Test_CT {
alt {
/* wait for one ALIVE cycle, then ACK any further ALIVE in the background */
[] NSCP[0].receive(t_NS_RecvFrom(t_NS_ALIVE)) { setverdict(pass); };
[] NSCP[0].receive(t_NS_RecvFrom(t_NS_UNBLOCK)) { repeat; }
[] NSCP[0].receive(t_NS_ALIVE) { setverdict(pass); };
[] NSCP[0].receive(t_NS_UNBLOCK) { repeat; }
}
f_clean_ns_codec();
}
/* Test for NS-RESET after NS-ALIVE timeout */
@ -132,15 +132,17 @@ testcase TC_ns_alive_timeout_reset() runs on RAW_Test_CT {
/* wait for at least one NS-ALIVE */
alt {
[] as_rx_alive_tx_ack(oneshot := true) { };
[] NSCP[0].receive(t_NS_RecvFrom(t_NS_UNBLOCK)) { repeat; }
[] NSCP[0].receive(t_NS_UNBLOCK) { repeat; }
}
/* wait for NS-RESET to re-appear, ignoring any NS-ALIVE until then */
alt {
[] as_rx_ns_reset_ack(oneshot := true) { setverdict(pass); }
[] NSCP[0].receive(t_NS_RecvFrom(t_NS_ALIVE)) { repeat; }
[] NSCP[0].receive(t_NS_RecvFrom(t_NS_UNBLOCK)) { repeat; }
[] NSCP[0].receive(t_NS_ALIVE) { repeat; }
[] NSCP[0].receive(t_NS_UNBLOCK) { repeat; }
}
f_clean_ns_codec();
}
/* test for NS-RESET/NS-ALIVE/NS-UNBLOCK */
@ -156,6 +158,7 @@ testcase TC_ns_unblock() runs on RAW_Test_CT {
as_rx_ns_unblock_ack(oneshot := true);
setverdict(pass);
f_clean_ns_codec();
}
/* test for NS-UNBLOCK re-transmissions */
@ -170,11 +173,12 @@ testcase TC_ns_unblock_retrans() runs on RAW_Test_CT {
activate(as_rx_alive_tx_ack());
/* wait for first NS-UNBLOCK, don't respond */
NSCP[0].receive(t_NS_RecvFrom(t_NS_UNBLOCK));
NSCP[0].receive(t_NS_UNBLOCK);
/* wait for re-transmission of NS-UNBLOCK */
as_rx_ns_unblock_ack(oneshot := true);
setverdict(pass);
f_clean_ns_codec();
}
/* full bring-up of the Gb link for NS and BSSGP layer up to BVC-FC */
@ -205,6 +209,7 @@ testcase TC_ns_full_bringup() runs on RAW_Test_CT {
as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);
activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci));
setverdict(pass);
f_clean_ns_codec();
}
/* test outbound (SGSN-originated) NS-BLOCK procedure */
@ -224,6 +229,7 @@ testcase TC_ns_so_block() runs on RAW_Test_CT {
f_outgoing_ns_block(NS_CAUSE_EQUIPMENT_FAILURE);
setverdict(pass);
f_clean_ns_codec();
}

View File

@ -21,6 +21,30 @@ SGSN_Components.mp_nsconfig := {
}
},
nsvci := 1234
},
{
provider := {
ip := {
address_family := AF_INET,
local_ip := "127.0.0.1",
local_udp_port := 23001,
remote_ip := "127.0.0.1",
remote_udp_port := 22000
}
},
nsvci := 1234
},
{
provider := {
ip := {
address_family := AF_INET,
local_ip := "127.0.0.1",
local_udp_port := 23002,
remote_ip := "127.0.0.1",
remote_udp_port := 22000
}
},
nsvci := 1234
}
}
}

View File

@ -15,7 +15,6 @@ import from PCU_Tests_NS all;
import from SGSN_Components all;
import from Osmocom_Gb_Types all;
import from NS_Emulation all;
import from NS_CodecPort all;
import from NS_Types all;
import from RAW_NS all;
@ -28,18 +27,18 @@ function f_incoming_sns_size(template (omit) NsCause cause := omit, integer idx
runs on RAW_NS_CT {
log("f_incoming_sns_size(idx=", idx, ")");
var PDU_NS rx;
var NSVCConfiguration nsvc_cfg := g_nsconfig[idx].nsvc[0];
var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[idx];
if (nsvc_cfg.provider.ip.address_family == AF_INET) {
/* expect one single SNS-SIZE with RESET flag; 4x v4 EP; no v6 EP */
rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 8,
rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := 8,
num_v4 := 4, num_v6 := omit), idx);
} else {
/* expect one single SNS-SIZE with RESET flag; no v4 EP; 4x v6 EP */
rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 8,
rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := 8,
num_v4 := omit, num_v6 := 4), idx);
}
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_SIZE_ACK(g_nsconfig[idx].nsei, cause)));
NSCP[idx].send(ts_SNS_SIZE_ACK(g_nsconfig.nsei, cause));
}
/* perform outbound SNS-SIZE procedure */
@ -47,19 +46,19 @@ function f_outgoing_sns_size(template (omit) NsCause cause := omit, integer idx:
runs on RAW_NS_CT {
log("f_outgoing_sns_size(idx=", idx, ")");
var PDU_NS rx;
var NSVCConfiguration nsvc_cfg := g_nsconfig[idx].nsvc[0];
var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[idx];
if (nsvc_cfg.provider.ip.address_family == AF_INET) {
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 1,
NSCP[idx].send(ts_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := 1,
num_v4 := 1, num_v6 := omit)
));
);
} else {
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 1,
NSCP[idx].send(ts_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := 1,
num_v4 := omit, num_v6 := 1)
));
);
}
/* expect one single SNS-SIZE with RESET flag; 4x v4 EP; no v6 EP */
rx := f_ns_exp(tr_SNS_SIZE_ACK(g_nsconfig[idx].nsei, cause), idx);
rx := f_ns_exp(tr_SNS_SIZE_ACK(g_nsconfig.nsei, cause), idx);
}
/* perform inbound SNS-CONFIG procedure */
@ -67,18 +66,18 @@ function f_incoming_sns_config(template (omit) NsCause cause := omit, integer id
runs on RAW_NS_CT {
log("f_incoming_sns_config(idx=", idx, ")");
var PDU_NS rx;
var NSVCConfiguration nsvc_cfg := g_nsconfig[idx].nsvc[0];
var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[idx];
if (nsvc_cfg.provider.ip.address_family == AF_INET) {
var template IP4_Elements v4_elem := { tr_SNS_IPv4(nsvc_cfg.provider.ip.remote_ip,
nsvc_cfg.provider.ip.remote_udp_port) };
rx := f_ns_exp(tr_SNS_CONFIG(g_nsconfig[idx].nsei, end_flag := true, v4 := v4_elem), idx);
rx := f_ns_exp(tr_SNS_CONFIG(g_nsconfig.nsei, end_flag := true, v4 := v4_elem), idx);
} else {
var template IP6_Elements v6_elem := { tr_SNS_IPv6(nsvc_cfg.provider.ip.remote_ip,
nsvc_cfg.provider.ip.remote_udp_port) };
rx := f_ns_exp(tr_SNS_CONFIG(g_nsconfig[idx].nsei, end_flag := true, v6 := v6_elem), idx);
rx := f_ns_exp(tr_SNS_CONFIG(g_nsconfig.nsei, end_flag := true, v6 := v6_elem), idx);
}
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause)));
NSCP[idx].send(ts_SNS_CONFIG_ACK(g_nsconfig.nsei, cause));
}
/* perform outbound SNS-CONFIG procedure */
@ -86,18 +85,18 @@ function f_outgoing_sns_config(template (omit) NsCause cause := omit, integer id
runs on RAW_NS_CT {
log("f_outgoing_sns_config(idx=", idx, ")");
var PDU_NS rx;
var NSVCConfiguration nsvc_cfg := g_nsconfig[idx].nsvc[0];
var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[idx];
if (nsvc_cfg.provider.ip.address_family == AF_INET) {
var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(nsvc_cfg.provider.ip.local_ip,
nsvc_cfg.provider.ip.local_udp_port) }
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4)));
NSCP[idx].send(ts_SNS_CONFIG(g_nsconfig.nsei, true, v4));
} else {
var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(nsvc_cfg.provider.ip.local_ip,
nsvc_cfg.provider.ip.local_udp_port) }
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, omit, v6)));
NSCP[idx].send(ts_SNS_CONFIG(g_nsconfig.nsei, true, omit, v6));
}
rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx);
rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig.nsei, cause), idx);
}
/* perform outbound SNS-CONFIG procedure (separate endpoints: 1 for control, 1 for user */
@ -107,19 +106,19 @@ runs on RAW_NS_CT {
var PDU_NS rx;
if (mp_nsconfig.nsvc[0].provider.ip.address_family == AF_INET) {
var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[0].nsvc[0].provider.ip.local_ip,
g_nsconfig[0].nsvc[0].provider.ip.local_udp_port, 1, 0),
ts_SNS_IPv4(g_nsconfig[1].nsvc[0].provider.ip.local_ip,
g_nsconfig[1].nsvc[0].provider.ip.local_udp_port, 0, 1) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4)));
var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig.nsvc[0].provider.ip.local_ip,
g_nsconfig.nsvc[0].provider.ip.local_udp_port, 1, 0),
ts_SNS_IPv4(g_nsconfig.nsvc[1].provider.ip.local_ip,
g_nsconfig.nsvc[1].provider.ip.local_udp_port, 0, 1) };
NSCP[idx].send(ts_SNS_CONFIG(g_nsconfig.nsei, true, v4));
} else {
var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig[0].nsvc[0].provider.ip.local_ip,
g_nsconfig[0].nsvc[0].provider.ip.local_udp_port, 1, 0),
ts_SNS_IPv6(g_nsconfig[1].nsvc[0].provider.ip.local_ip,
g_nsconfig[1].nsvc[0].provider.ip.local_udp_port, 0, 1) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, omit, v6)));
var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig.nsvc[0].provider.ip.local_ip,
g_nsconfig.nsvc[0].provider.ip.local_udp_port, 1, 0),
ts_SNS_IPv6(g_nsconfig.nsvc[1].provider.ip.local_ip,
g_nsconfig.nsvc[1].provider.ip.local_udp_port, 0, 1) };
NSCP[idx].send(ts_SNS_CONFIG(g_nsconfig.nsei, true, omit, v6));
}
rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx);
rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig.nsei, cause), idx);
}
/* perform outbound SNS-CONFIG procedure (separate endpoints: 1 for control, 1 for user */
@ -128,38 +127,38 @@ runs on RAW_NS_CT {
log("f_outgoing_sns_config_1c1u_separate(idx=", idx, ")");
var PDU_NS rx;
if (mp_nsconfig.nsvc[0].provider.ip.address_family == AF_INET) {
var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[1].nsvc[0].provider.ip.local_ip,
g_nsconfig[1].nsvc[0].provider.ip.local_udp_port, 1, 0),
ts_SNS_IPv4(g_nsconfig[2].nsvc[0].provider.ip.local_ip,
g_nsconfig[2].nsvc[0].provider.ip.local_udp_port, 0, 1) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4)));
var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig.nsvc[1].provider.ip.local_ip,
g_nsconfig.nsvc[1].provider.ip.local_udp_port, 1, 0),
ts_SNS_IPv4(g_nsconfig.nsvc[2].provider.ip.local_ip,
g_nsconfig.nsvc[2].provider.ip.local_udp_port, 0, 1) };
NSCP[idx].send(ts_SNS_CONFIG(g_nsconfig.nsei, true, v4));
} else {
var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig[1].nsvc[0].provider.ip.local_ip,
g_nsconfig[1].nsvc[0].provider.ip.local_udp_port, 1, 0),
ts_SNS_IPv6(g_nsconfig[2].nsvc[0].provider.ip.local_ip,
g_nsconfig[2].nsvc[0].provider.ip.local_udp_port, 0, 1) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, omit, v6)));
var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig.nsvc[1].provider.ip.local_ip,
g_nsconfig.nsvc[1].provider.ip.local_udp_port, 1, 0),
ts_SNS_IPv6(g_nsconfig.nsvc[2].provider.ip.local_ip,
g_nsconfig.nsvc[2].provider.ip.local_udp_port, 0, 1) };
NSCP[idx].send(ts_SNS_CONFIG(g_nsconfig.nsei, true, omit, v6));
}
rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx);
rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig.nsei, cause), idx);
}
function f_outgoing_sns_add(integer idx_add, uint8_t w_sig := 1, uint8_t w_user := 1, integer idx := 0, template (omit) NsCause cause := omit)
runs on RAW_NS_CT {
log("f_outgoing_sns_add(idx_add=", idx_add, ")");
var PDU_NS rx;
var NSVCConfiguration nsvc_cfg := g_nsconfig[idx_add].nsvc[0];
var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[idx_add];
if (nsvc_cfg.provider.ip.address_family == AF_INET) {
var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(nsvc_cfg.provider.ip.local_ip,
nsvc_cfg.provider.ip.local_udp_port,
w_sig, w_user) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_ADD(g_nsconfig[idx].nsei, 23, v4)));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, cause, v4));
NSCP[idx].send(ts_SNS_ADD(g_nsconfig.nsei, 23, v4));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig.nsei, 23, cause, v4));
} else {
var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(nsvc_cfg.provider.ip.local_ip,
nsvc_cfg.provider.ip.local_udp_port,
w_sig, w_user) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_ADD(g_nsconfig[idx].nsei, 23, omit, v6)));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, cause, omit, v6));
NSCP[idx].send(ts_SNS_ADD(g_nsconfig.nsei, 23, omit, v6));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig.nsei, 23, cause, omit, v6));
}
}
@ -167,19 +166,19 @@ function f_outgoing_sns_del(integer idx_del, uint8_t w_sig := 1, uint8_t w_user
runs on RAW_NS_CT {
log("f_outgoing_sns_del(idx_del=", idx_del, ")");
var PDU_NS rx;
var NSVCConfiguration nsvc_cfg := g_nsconfig[idx_del].nsvc[0];
var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[idx_del];
if (nsvc_cfg.provider.ip.address_family == AF_INET) {
var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(nsvc_cfg.provider.ip.local_ip,
nsvc_cfg.provider.ip.local_udp_port,
w_sig, w_user) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_DEL(g_nsconfig[idx].nsei, 24, omit, v4)));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 24, omit, v4));
NSCP[idx].send(ts_SNS_DEL(g_nsconfig.nsei, 24, omit, v4));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig.nsei, 24, omit, v4));
} else {
var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(nsvc_cfg.provider.ip.local_ip,
nsvc_cfg.provider.ip.local_udp_port,
w_sig, w_user) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_DEL(g_nsconfig[idx].nsei, 24, omit, omit, v6)));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 24, omit, omit, v6));
NSCP[idx].send(ts_SNS_DEL(g_nsconfig.nsei, 24, omit, omit, v6));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig.nsei, 24, omit, omit, v6));
}
}
@ -187,19 +186,19 @@ function f_outgoing_sns_chg_weight(integer idx_chg, uint8_t w_sig, uint8_t w_use
runs on RAW_NS_CT {
log("f_outgoing_sns_chg_weight(idx_chg=", idx_chg, ")");
var PDU_NS rx;
var NSVCConfiguration nsvc_cfg := g_nsconfig[idx_chg].nsvc[0];
var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[idx_chg];
if (nsvc_cfg.provider.ip.address_family == AF_INET) {
var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(nsvc_cfg.provider.ip.local_ip,
nsvc_cfg.provider.ip.local_udp_port,
w_sig, w_user) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CHG_WEIGHT(g_nsconfig[idx].nsei, 25, v4)));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 25, omit, v4));
NSCP[idx].send(ts_SNS_CHG_WEIGHT(g_nsconfig.nsei, 25, v4));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig.nsei, 25, omit, v4));
} else {
var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(nsvc_cfg.provider.ip.local_ip,
nsvc_cfg.provider.ip.local_udp_port,
w_sig, w_user) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CHG_WEIGHT(g_nsconfig[idx].nsei, 25, omit, v6)));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 25, omit, omit, v6));
NSCP[idx].send(ts_SNS_CHG_WEIGHT(g_nsconfig.nsei, 25, omit, v6));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig.nsei, 25, omit, omit, v6));
}
}
@ -214,6 +213,7 @@ testcase TC_sns_po_size_success() runs on RAW_Test_CT {
f_incoming_sns_size();
f_sleep(1.0);
setverdict(pass);
f_clean_ns_codec();
}
/* PCU-originated SNS-SIZE: NACK from our side */
@ -225,6 +225,7 @@ testcase TC_sns_po_size_nack() runs on RAW_Test_CT {
/* FIXME: ensure we get re-transmitted SNS-SIZE attempts */
f_sleep(10.0);
setverdict(pass);
f_clean_ns_codec();
}
/* PCU-originated SNS-CONFIG: successful case */
@ -235,6 +236,7 @@ testcase TC_sns_po_config_success() runs on RAW_Test_CT {
f_incoming_sns_config();
f_sleep(1.0);
setverdict(pass);
f_clean_ns_codec();
}
/* PCU-originated SNS-CONFIG: successful case */
@ -246,6 +248,7 @@ testcase TC_sns_po_config_nack() runs on RAW_Test_CT {
/* FIXME: ensure we get re-transmitted SNS-CONFIG attempts */
f_sleep(10.0);
setverdict(pass);
f_clean_ns_codec();
}
@ -272,6 +275,7 @@ testcase TC_sns_so_config_success() runs on RAW_Test_CT {
as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);
activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci));
setverdict(pass);
f_clean_ns_codec();
}
private function f_sns_bringup_1c1u(boolean sgsn_originated_reset := false) runs on RAW_Test_CT {
@ -327,6 +331,7 @@ private function f_sns_bringup_1c1u(boolean sgsn_originated_reset := false) runs
testcase TC_sns_1c1u() runs on RAW_Test_CT {
f_sns_bringup_1c1u();
setverdict(pass);
f_clean_ns_codec();
}
private function f_sns_bringup_1c1u_separate(boolean sgsn_originated_reset := false) runs on RAW_Test_CT {
@ -387,6 +392,7 @@ private function f_sns_bringup_1c1u_separate(boolean sgsn_originated_reset := fa
testcase TC_sns_1c1u_separate() runs on RAW_Test_CT {
f_sns_bringup_1c1u_separate();
setverdict(pass);
f_clean_ns_codec();
}
/* Test full IP-SNS bring-up with two NS-VCs, one sig-only and one user-only and use
@ -394,6 +400,7 @@ testcase TC_sns_1c1u_separate() runs on RAW_Test_CT {
testcase TC_sns_1c1u_so_bvc_reset() runs on RAW_Test_CT {
f_sns_bringup_1c1u_separate(sgsn_originated_reset := true);
setverdict(pass);
f_clean_ns_codec();
}
/* Transmit BVC-RESET before NS-ALIVE of PCU was ACKed: expect no response */
@ -420,6 +427,7 @@ testcase TC_sns_1c1u_so_bvc_reset_too_early() runs on RAW_Test_CT {
/* Transmit BVC-RESET and expect no ACK*/
f_tx_bvc_reset_rx_ack(0, omit, omit, idx := 1, exp_ack := false);
f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, omit, mp_gb_cfg.bvc[0].cell_id, idx := 1, exp_ack := false);
f_clean_ns_codec();
}
/* Test adding new IP endpoints at runtime */
@ -437,6 +445,7 @@ testcase TC_sns_add() runs on RAW_Test_CT {
f_outgoing_ns_alive(2);
setverdict(pass);
f_clean_ns_codec();
}
/* Test adding an already present IP endpoint at runtime */
@ -445,6 +454,7 @@ testcase TC_sns_add_nack() runs on RAW_Test_CT {
f_outgoing_sns_add(idx_add := 0, w_sig := 0, w_user := 1, idx := 0, cause := NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED);
setverdict(pass);
f_clean_ns_codec();
}
/* Test deleting IP endpoints at runtime */
@ -454,6 +464,7 @@ testcase TC_sns_del() runs on RAW_Test_CT {
f_outgoing_sns_del(idx_del := 1, w_sig := 0, w_user := 1, idx := 0);
/* FIXME: ensure we don't receive anything on just-deleted NS-VC anymore */
setverdict(pass);
f_clean_ns_codec();
}
/* Test changing weights at runtime */
@ -463,6 +474,7 @@ testcase TC_sns_chg_weight() runs on RAW_Test_CT {
/* change w_user from 1 to 200 */
f_outgoing_sns_chg_weight(idx_chg := 1, w_sig := 0, w_user := 200, idx := 0);
setverdict(pass);
f_clean_ns_codec();
}
import from PCUIF_Types all;
@ -485,6 +497,7 @@ testcase TC_pcuif_rach() runs on RAW_Test_CT {
tr_PCUIF_DATA_REQ(bts_nr:=0, trx_nr:=0, ts_nr:=0, block_nr:=?, fn:=?,
sapi:=PCU_IF_SAPI_AGCH, data:=?)));
setverdict(pass);
f_clean_ns_codec();
}

View File

@ -55,6 +55,30 @@ modulepar {
}
},
nsvci := 0
},
{
provider := {
ip := {
address_family := AF_INET,
local_udp_port := 23001,
local_ip := "127.0.0.1",
remote_udp_port := 21000,
remote_ip := "127.0.0.1"
}
},
nsvci := 0
},
{
provider := {
ip := {
address_family := AF_INET,
local_udp_port := 23002,
local_ip := "127.0.0.1",
remote_udp_port := 21000,
remote_ip := "127.0.0.1"
}
},
nsvci := 0
}
}
};

View File

@ -51,10 +51,10 @@ gen_links $DIR $FILES
DIR=../library
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Templates.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc "
FILES+="StatsD_Types.ttcn StatsD_CodecPort.ttcn StatsD_CodecPort_CtrlFunct.ttcn StatsD_CodecPort_CtrlFunctdef.cc StatsD_Checker.ttcn "
FILES+="NS_Provider_IPL4.ttcn NS_Emulation.ttcnpp NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc "
FILES+="NS_Provider_IPL4.ttcn NS_Emulation.ttcnpp "
FILES+="BSSGP_Emulation.ttcnpp Osmocom_Gb_Types.ttcn "
FILES+="LLC_Templates.ttcn L3_Templates.ttcn L3_Common.ttcn "
FILES+="PCUIF_Types.ttcn PCUIF_CodecPort.ttcn RAW_NS.ttcn "
FILES+="PCUIF_Types.ttcn PCUIF_CodecPort.ttcn RAW_NS.ttcnpp "
gen_links $DIR $FILES
ignore_pp_results

View File

@ -1,6 +1,6 @@
#!/bin/sh
FILES="*.ttcn *.ttcnpp BSSGP_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc NS_CodecPort_CtrlFunctDef.cc UD_PT.cc RLCMAC_EncDec.cc LLC_EncDec.cc TELNETasp_PT.cc Native_FunctionDefs.cc StatsD_CodecPort_CtrlFunctdef.cc"
FILES="*.ttcn *.ttcnpp BSSGP_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc UD_PT.cc RLCMAC_EncDec.cc LLC_EncDec.cc TELNETasp_PT.cc Native_FunctionDefs.cc StatsD_CodecPort_CtrlFunctdef.cc"
export CPPFLAGS_TTCN3="-DBSSGP_EM_L3"

View File

@ -13,7 +13,6 @@ module SGSN_Tests_NS {
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;
@ -23,31 +22,31 @@ 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_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0);
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();
f_clean_ns_codec();
}
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_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0);
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));
NSCP[0].send(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(t_NS_ALIVE_ACK);
[] NSCP[0].receive(tr_NS_STATUS(*)) { setverdict(fail); }
[] NSCP[0].receive { repeat; }
}
f_sleep(1.0);
f_cleanup();
f_clean_ns_codec();
}
control {

View File

@ -84,7 +84,7 @@ gen_links $DIR $FILES
DIR=../library
FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Templates.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc "
FILES+="NS_Provider_IPL4.ttcn NS_Emulation.ttcnpp PCUIF_Types.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc "
FILES+="NS_Provider_IPL4.ttcn NS_Emulation.ttcnpp PCUIF_Types.ttcn "
FILES+="BSSGP_Emulation.ttcnpp Osmocom_Gb_Types.ttcn "
FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn "
FILES+="Osmocom_VTY_Functions.ttcn "
@ -92,7 +92,7 @@ FILES+="LLC_Templates.ttcn L3_Templates.ttcn L3_Common.ttcn "
FILES+="RAN_Emulation.ttcnpp RAN_Adapter.ttcnpp SCCP_Templates.ttcn "
# IPA_Emulation + dependencies
FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc Native_Functions.ttcn Native_FunctionDefs.cc GSUP_Types.ttcn GSUP_Emulation.ttcn "
FILES+="GTP_CodecPort.ttcn GTP_CodecPort_CtrlFunct.ttcn GTP_CodecPort_CtrlFunctDef.cc GTP_Emulation.ttcn GTP_Templates.ttcn IPCP_Types.ttcn RAW_NS.ttcn "
FILES+="GTP_CodecPort.ttcn GTP_CodecPort_CtrlFunct.ttcn GTP_CodecPort_CtrlFunctDef.cc GTP_Emulation.ttcn GTP_Templates.ttcn IPCP_Types.ttcn RAW_NS.ttcnpp "
gen_links $DIR $FILES
ignore_pp_results

View File

@ -1,6 +1,6 @@
#!/bin/sh
FILES="*.ttcn *.ttcnpp *.asn BSSGP_EncDec.cc LLC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc NS_CodecPort_CtrlFunctDef.cc RLCMAC_EncDec.cc Native_FunctionDefs.cc TELNETasp_PT.cc IPA_CodecPort_CtrlFunctDef.cc GTPU_EncDec.cc GTPC_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc SCCP_EncDec.cc SCTPasp_PT.cc RANAP_EncDec.cc "
FILES="*.ttcn *.ttcnpp *.asn BSSGP_EncDec.cc LLC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RLCMAC_EncDec.cc Native_FunctionDefs.cc TELNETasp_PT.cc IPA_CodecPort_CtrlFunctDef.cc GTPU_EncDec.cc GTPC_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc SCCP_EncDec.cc SCTPasp_PT.cc RANAP_EncDec.cc "
export CPPFLAGS_TTCN3="-DIPA_EMULATION_GSUP -DIPA_EMULATION_CTRL -DUSE_MTP3_DISTRIBUTOR -DRAN_EMULATION_RANAP -DBSSGP_EM_L3"