summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-03-23 07:26:41 +0100
committerHarald Welte <laforge@gnumonks.org>2019-03-27 15:07:43 +0100
commitf711c1626a4b91ca95671fcfa23d81da43366dac (patch)
tree615d907c463044d1ad5128d85086cd96bdd9ea36
parentf9f9563c1044cd292249dbca153a5b320048170b (diff)
Move NS_RAW_CT to new NS_RAW module
-rw-r--r--library/NS_RAW.ttcn227
-rw-r--r--pcu/PCU_Tests.ttcn1
-rw-r--r--pcu/PCU_Tests_RAW.ttcn219
-rw-r--r--pcu/PCU_Tests_RAW_SNS.ttcn53
-rwxr-xr-xpcu/gen_links.sh2
5 files changed, 267 insertions, 235 deletions
diff --git a/library/NS_RAW.ttcn b/library/NS_RAW.ttcn
new file mode 100644
index 0000000..848f488
--- /dev/null
+++ b/library/NS_RAW.ttcn
@@ -0,0 +1,227 @@
+module NS_RAW {
+
+/* "RAW" NS utilities: Wrapper around several NS_CodecPort */
+
+import from General_Types all;
+import from Osmocom_Types all;
+import from GSM_Types all;
+import from GSM_RR_Types all;
+
+import from NS_Types all;
+import from BSSGP_Types all;
+import from Osmocom_Gb_Types all;
+
+import from IPL4asp_Types all;
+import from NS_CodecPort all;
+import from NS_CodecPort_CtrlFunct all;
+import from Native_Functions all;
+
+import from NS_Emulation all;
+import from BSSGP_Emulation all;
+
+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];
+ timer g_T_guard;
+}
+
+private altstep as_Tguard() runs on RAW_NS_CT {
+ [] g_T_guard.timeout {
+ setverdict(fail, "Timeout of T_guard");
+ mtc.stop;
+ }
+}
+
+function f_init_ns_codec(NSConfiguration nsconfig, integer idx := 0, float guard_secs := 60.0)
+runs on RAW_NS_CT {
+ var Result res;
+
+ if (not g_T_guard.running) {
+ g_T_guard.start(guard_secs);
+ activate(as_Tguard());
+ }
+
+ if (not isbound(g_nsconfig) or not isbound(g_nsconfig[idx])) {
+ /* copy most parts from nsconfig */
+ g_nsconfig[idx] := nsconfig;
+/* FIXME */
+ /* adjust those parts different for each NS-VC */
+ g_nsconfig[idx].nsvci := nsconfig.nsvci + idx;
+ g_nsconfig[idx].local_udp_port := nsconfig.local_udp_port + idx;
+ }
+
+ map(self:NSCP[idx], system:NSCP);
+ /* Connect the UDP socket */
+ log("connecting NSCP[", idx, "] to ", g_nsconfig[idx]);
+ res := f_IPL4_connect(NSCP[idx], g_nsconfig[idx].remote_ip, g_nsconfig[idx].remote_udp_port,
+ g_nsconfig[idx].local_ip, g_nsconfig[idx].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;
+ }
+ g_ns_conn_id[idx] := res.connId;
+
+}
+
+function f_ns_exp(template PDU_NS exp_rx, integer idx := 0) runs on RAW_NS_CT return PDU_NS {
+ var NS_RecvFrom nrf;
+ log("f_ns_exp() expecting ", exp_rx);
+ alt {
+ [] NSCP[idx].receive(t_NS_RecvFrom(exp_rx)) -> value nrf { }
+ [] NSCP[idx].receive {
+ setverdict(fail, "Received unexpected NS: ", nrf);
+ mtc.stop;
+ }
+ }
+ return nrf.msg;
+}
+
+/* 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));
+ alt {
+ [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK));
+ [] NSCP[idx].receive { repeat; }
+ }
+}
+
+/* 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));
+ T.start;
+ alt {
+ [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK)) {
+ setverdict(fail, "Received unexpected NS-ALIVE ACK");
+ }
+ [] NSCP[idx].receive { repeat; }
+ [] T.timeout {
+ setverdict(pass);
+ }
+ }
+}
+
+/* ensure no matching message is received within 'tout' */
+function f_ensure_no_ns(template PDU_NS ns := ?, integer idx := 0, float tout := 3.0)
+runs on RAW_NS_CT {
+ timer T := tout;
+ T.start;
+ alt {
+ [] NSCP[idx].receive(t_NS_RecvFrom(ns)) {
+ setverdict(fail, "NS-ALIVE from unconfigured (possibly initial) endpoint");
+ }
+ [] T.timeout {
+ setverdict(pass);
+ }
+ }
+}
+
+/* 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].nsvci)));
+ alt {
+ [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_BLOCK_ACK(g_nsconfig[idx].nsvci)));
+ [] 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));
+ if (not oneshot) { repeat; }
+ }
+}
+
+/* Transmit BSSGP RESET for given BVCI and expect ACK */
+function f_tx_bvc_reset_rx_ack(BssgpBvci bvci, BssgpCellId cell_id, integer idx := 0, boolean exp_ack := true)
+runs on RAW_NS_CT {
+ var PDU_BSSGP bssgp_tx := valueof(ts_BVC_RESET(BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS, bvci,
+ 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))));
+ T.start;
+ alt {
+ [exp_ack] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
+ decmatch tr_BVC_RESET_ACK(bvci, ?)))) {
+ setverdict(pass);
+ }
+ [exp_ack] T.timeout {
+ setverdict(fail, "No response to BVC-RESET");
+ }
+ [not exp_ack] T.timeout {
+ setverdict(pass);
+ }
+ [] NSCP[idx].receive { repeat; }
+ }
+}
+
+/* Receive a BSSGP RESET for given BVCI and ACK it */
+altstep as_rx_bvc_reset_tx_ack(BssgpBvci bvci, BssgpCellId cell_id, boolean oneshot := false,
+ integer idx := 0)
+runs on RAW_NS_CT {
+ var NS_RecvFrom ns_rf;
+ /* FIXME: nail down received cell_id in match */
+ [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
+ decmatch tr_BVC_RESET(?, bvci, ?))))
+ -> value ns_rf {
+ var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.pDU_NS_Unitdata.nS_SDU);
+ var PDU_BSSGP bssgp_tx := valueof(ts_BVC_RESET_ACK(bvci, cell_id));
+ NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx))));
+ if (not oneshot) { repeat; }
+ }
+}
+
+
+/* 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_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))));
+ 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)))
+ -> value ns_rf {
+ var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.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))));
+ if (not oneshot) { repeat; }
+ }
+}
+
+
+/* Receive a NS-RESET and ACK it */
+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].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].nsvci,
+ g_nsconfig[idx].nsei)));
+ if (not oneshot) { repeat; }
+ }
+}
+/* Receive a NS-UNBLOCK and ACK it */
+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));
+ if (not oneshot) { repeat; }
+ }
+}
+
+
+
+}
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 4dce7dd..10f293c 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -20,6 +20,7 @@ import from L1CTL_PortType all;
import from MobileL3_Types all;
import from MobileL3_CommonIE_Types all;
import from L3_Templates all;
+import from NS_RAW all;
modulepar {
BssgpConfig mp_gb_cfg := {
diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 20a0307..13898d4 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -24,6 +24,7 @@ import from PCUIF_CodecPort all;
import from IPL4asp_Types all;
import from NS_CodecPort all;
import from NS_CodecPort_CtrlFunct all;
+import from NS_RAW all;
import from Native_Functions all;
import from PCU_Tests all;
@@ -31,14 +32,6 @@ modulepar {
charstring mp_pcu_sock_path := PCU_SOCK_DEFAULT;
}
-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];
- timer g_T_guard;
-}
-
type component RAW_PCU_CT {
/* PCUIF (we emulate the BTS part) */
port PCUIF_CODEC_PT PCU;
@@ -49,13 +42,6 @@ type component RAW_PCU_CT {
type component RAW_Test_CT extends RAW_NS_CT, RAW_PCU_CT {
}
-private altstep as_Tguard() runs on RAW_NS_CT {
- [] g_T_guard.timeout {
- setverdict(fail, "Timeout of T_guard");
- mtc.stop;
- }
-}
-
function f_init_pcuif() runs on RAW_PCU_CT {
map(self:PCU, system:PCU);
@@ -81,196 +67,13 @@ function f_pcuif_tx(template (value) PCUIF_Message msg) runs on RAW_PCU_CT {
PCU.send(t_SD_PCUIF(g_pcu_conn_id, msg));
}
-function f_init_ns_codec(integer idx := 0, float guard_secs := 60.0) runs on RAW_NS_CT {
- var Result res;
-
- if (not g_T_guard.running) {
- g_T_guard.start(guard_secs);
- activate(as_Tguard());
- }
-
- if (not isbound(g_nsconfig) or not isbound(g_nsconfig[idx])) {
- /* copy most parts from mp_nsconfig */
- g_nsconfig[idx] := mp_nsconfig;
- /* adjust those parts different for each NS-VC */
- g_nsconfig[idx].nsvci := mp_nsconfig.nsvci + idx;
- g_nsconfig[idx].local_udp_port := mp_nsconfig.local_udp_port + idx;
- }
-
- map(self:NSCP[idx], system:NSCP);
- /* Connect the UDP socket */
- log("connecting NSCP[", idx, "] to ", g_nsconfig[idx]);
- res := f_IPL4_connect(NSCP[idx], g_nsconfig[idx].remote_ip, g_nsconfig[idx].remote_udp_port,
- g_nsconfig[idx].local_ip, g_nsconfig[idx].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;
- }
- g_ns_conn_id[idx] := res.connId;
-
-}
-
-function f_ns_exp(template PDU_NS exp_rx, integer idx := 0) runs on RAW_NS_CT return PDU_NS {
- var NS_RecvFrom nrf;
- log("f_ns_exp() expecting ", exp_rx);
- alt {
- [] NSCP[idx].receive(t_NS_RecvFrom(exp_rx)) -> value nrf { }
- [] NSCP[idx].receive {
- setverdict(fail, "Received unexpected NS: ", nrf);
- mtc.stop;
- }
- }
- return nrf.msg;
-}
-
-/* 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));
- alt {
- [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK));
- [] NSCP[idx].receive { repeat; }
- }
-}
-
-/* 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));
- T.start;
- alt {
- [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK)) {
- setverdict(fail, "Received unexpected NS-ALIVE ACK");
- }
- [] NSCP[idx].receive { repeat; }
- [] T.timeout {
- setverdict(pass);
- }
- }
-}
-
-/* ensure no matching message is received within 'tout' */
-function f_ensure_no_ns(template PDU_NS ns := ?, integer idx := 0, float tout := 3.0)
-runs on RAW_Test_CT {
- timer T := tout;
- T.start;
- alt {
- [] NSCP[idx].receive(t_NS_RecvFrom(ns)) {
- setverdict(fail, "NS-ALIVE from unconfigured (possibly initial) endpoint");
- }
- [] T.timeout {
- setverdict(pass);
- }
- }
-}
-
-/* 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].nsvci)));
- alt {
- [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_BLOCK_ACK(g_nsconfig[idx].nsvci)));
- [] 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));
- if (not oneshot) { repeat; }
- }
-}
-
-/* Transmit BSSGP RESET for given BVCI and expect ACK */
-function f_tx_bvc_reset_rx_ack(BssgpBvci bvci, integer idx := 0, boolean exp_ack := true)
-runs on RAW_NS_CT {
- var PDU_BSSGP bssgp_tx := valueof(ts_BVC_RESET(BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS, bvci,
- mp_gb_cfg.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))));
- T.start;
- alt {
- [exp_ack] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
- decmatch tr_BVC_RESET_ACK(bvci, ?)))) {
- setverdict(pass);
- }
- [exp_ack] T.timeout {
- setverdict(fail, "No response to BVC-RESET");
- }
- [not exp_ack] T.timeout {
- setverdict(pass);
- }
- [] NSCP[idx].receive { repeat; }
- }
-}
-
-/* Receive a BSSGP RESET for given BVCI and ACK it */
-altstep as_rx_bvc_reset_tx_ack(BssgpBvci bvci, boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
- var NS_RecvFrom ns_rf;
- /* FIXME: nail down received cell_id in match */
- [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
- decmatch tr_BVC_RESET(?, bvci, ?))))
- -> value ns_rf {
- var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.pDU_NS_Unitdata.nS_SDU);
- var PDU_BSSGP bssgp_tx := valueof(ts_BVC_RESET_ACK(bvci, mp_gb_cfg.cell_id));
- NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx))));
- if (not oneshot) { repeat; }
- }
-}
-
-
-/* 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_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))));
- 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)))
- -> value ns_rf {
- var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.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))));
- if (not oneshot) { repeat; }
- }
-}
-
/**********************************************************************************
* Classic Gb/IP bring-up test cases using NS-{RESET,BLOCK,UNBLOCK} and no IP-SNS *
**********************************************************************************/
-/* Receive a NS-RESET and ACK it */
-private 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].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].nsvci,
- g_nsconfig[idx].nsei)));
- if (not oneshot) { repeat; }
- }
-}
-/* Receive a NS-UNBLOCK and ACK it */
-private 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));
- if (not oneshot) { repeat; }
- }
-}
-
/* test the NS-RESET procedure */
testcase TC_ns_reset() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
@@ -281,7 +84,7 @@ testcase TC_ns_reset() runs on RAW_Test_CT {
/* ensure NS-RESET are re-transmitted */
testcase TC_ns_reset_retrans() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
var integer i;
@@ -297,7 +100,7 @@ testcase TC_ns_reset_retrans() runs on RAW_Test_CT {
/* test the inbound NS-ALIVE procedure after NS-RESET */
testcase TC_ns_alive() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
/* Expect inbound NS-RESET procedure */
@@ -310,7 +113,7 @@ testcase TC_ns_alive() runs on RAW_Test_CT {
/* Test for NS-RESET after NS-ALIVE timeout */
testcase TC_ns_alive_timeout_reset() runs on RAW_Test_CT {
- f_init_ns_codec(guard_secs := 100.0);
+ f_init_ns_codec(mp_nsconfig, guard_secs := 100.0);
f_init_pcuif();
/* Expect inbound NS-RESET procedure */
@@ -328,7 +131,7 @@ testcase TC_ns_alive_timeout_reset() runs on RAW_Test_CT {
/* test for NS-RESET/NS-ALIVE/NS-UNBLOCK */
testcase TC_ns_unblock() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
/* Expect inbound NS-RESET procedure */
@@ -344,7 +147,7 @@ testcase TC_ns_unblock() runs on RAW_Test_CT {
/* test for NS-UNBLOCK re-transmissions */
testcase TC_ns_unblock_retrans() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
/* Expect inbound NS-RESET procedure */
@@ -364,7 +167,7 @@ testcase TC_ns_unblock_retrans() runs on RAW_Test_CT {
/* full bring-up of the Gb link for NS and BSSGP layer up to BVC-FC */
testcase TC_ns_full_bringup() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
/* Expect inbound NS-RESET procedure */
@@ -379,8 +182,8 @@ testcase TC_ns_full_bringup() runs on RAW_Test_CT {
f_outgoing_ns_alive();
/* Expect BVC-RESET for signaling (0) and ptp BVCI */
- as_rx_bvc_reset_tx_ack(0, oneshot := true);
- as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, oneshot := true);
+ as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true);
+ as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true);
as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true);
/* wait for one FLOW-CONTROL BVC and then ACK any further in the future */
@@ -391,7 +194,7 @@ testcase TC_ns_full_bringup() runs on RAW_Test_CT {
/* test outbound (SGSN-originated) NS-BLOCK procedure */
testcase TC_ns_so_block() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
/* Expect inbound NS-RESET procedure */
diff --git a/pcu/PCU_Tests_RAW_SNS.ttcn b/pcu/PCU_Tests_RAW_SNS.ttcn
index 768c15f..1a1d9ad 100644
--- a/pcu/PCU_Tests_RAW_SNS.ttcn
+++ b/pcu/PCU_Tests_RAW_SNS.ttcn
@@ -5,6 +5,7 @@ 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_RAW all;
import from NS_Types all;
import from RLCMAC_Types all;
import from LAPDm_RAW_PT all;
@@ -123,7 +124,7 @@ runs on RAW_NS_CT {
/* PCU-originated SNS-SIZE: successful case */
testcase TC_sns_po_size_success() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
f_incoming_sns_size();
f_sleep(1.0);
@@ -132,7 +133,7 @@ testcase TC_sns_po_size_success() runs on RAW_Test_CT {
/* PCU-originated SNS-SIZE: NACK from our side */
testcase TC_sns_po_size_nack() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
f_incoming_sns_size(NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED);
/* FIXME: ensure we don't get a SNS-CONFIG */
@@ -143,7 +144,7 @@ testcase TC_sns_po_size_nack() runs on RAW_Test_CT {
/* PCU-originated SNS-CONFIG: successful case */
testcase TC_sns_po_config_success() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
f_incoming_sns_size();
f_incoming_sns_config();
@@ -153,7 +154,7 @@ testcase TC_sns_po_config_success() runs on RAW_Test_CT {
/* PCU-originated SNS-CONFIG: successful case */
testcase TC_sns_po_config_nack() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
f_incoming_sns_size();
f_incoming_sns_config(NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED);
@@ -165,7 +166,7 @@ testcase TC_sns_po_config_nack() runs on RAW_Test_CT {
/* SGSN-originated SNS-SIZE: successful case */
testcase TC_sns_so_config_success() runs on RAW_Test_CT {
- f_init_ns_codec();
+ f_init_ns_codec(mp_nsconfig);
f_init_pcuif();
f_incoming_sns_size();
f_incoming_sns_config();
@@ -178,8 +179,8 @@ testcase TC_sns_so_config_success() runs on RAW_Test_CT {
f_outgoing_ns_alive();
/* Expect BVC-RESET for signaling (0) and ptp BVCI */
- as_rx_bvc_reset_tx_ack(0, oneshot := true);
- as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, oneshot := true);
+ as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true);
+ as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true);
as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true);
/* wait for one FLOW-CONTROL BVC and then ACK any further in the future */
@@ -190,8 +191,8 @@ testcase TC_sns_so_config_success() runs on RAW_Test_CT {
private function f_sns_bringup_1c1u(boolean sgsn_originated_reset := false) runs on RAW_Test_CT {
/* Activate two NS codec ports */
- f_init_ns_codec();
- f_init_ns_codec(1);
+ f_init_ns_codec(mp_nsconfig);
+ f_init_ns_codec(mp_nsconfig, 1);
f_init_pcuif();
/* Perform Size + BSS-originated config */
f_incoming_sns_size();
@@ -211,12 +212,12 @@ private function f_sns_bringup_1c1u(boolean sgsn_originated_reset := false) runs
f_outgoing_ns_alive(1);
if (sgsn_originated_reset) {
- f_tx_bvc_reset_rx_ack(0);
- f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci);
+ f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.cell_id);
+ f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id);
} else {
/* Expect BVC-RESET for signaling (0) and ptp BVCI */
- as_rx_bvc_reset_tx_ack(0, oneshot := true);
- as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, oneshot := true);
+ as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true);
+ as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true);
}
/* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==0) */
as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true);
@@ -235,9 +236,9 @@ testcase TC_sns_1c1u() runs on RAW_Test_CT {
private function f_sns_bringup_1c1u_separate(boolean sgsn_originated_reset := false) runs on RAW_Test_CT {
/* Activate two NS codec ports */
- f_init_ns_codec();
- f_init_ns_codec(1);
- f_init_ns_codec(2);
+ f_init_ns_codec(mp_nsconfig);
+ f_init_ns_codec(mp_nsconfig, 1);
+ f_init_ns_codec(mp_nsconfig, 2);
f_init_pcuif();
/* Perform Size + BSS-originated config */
f_incoming_sns_size();
@@ -261,12 +262,12 @@ private function f_sns_bringup_1c1u_separate(boolean sgsn_originated_reset := fa
f_outgoing_ns_alive_no_ack(idx := 0);
if (sgsn_originated_reset) {
- f_tx_bvc_reset_rx_ack(0, idx := 1);
- f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci, idx := 1);
+ f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.cell_id, idx := 1);
+ f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, idx := 1);
} else {
/* Expect BVC-RESET for signaling BVCI=0 and ptp BVCI */
- as_rx_bvc_reset_tx_ack(0, oneshot := true, idx := 1);
- as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 1);
+ as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true, idx := 1);
+ as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true, idx := 1);
}
/* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==1) */
as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 1);
@@ -294,9 +295,9 @@ testcase TC_sns_1c1u_so_bvc_reset() runs on RAW_Test_CT {
/* Transmit BVC-RESET before NS-ALIVE of PCU was ACKed: expect no response */
testcase TC_sns_1c1u_so_bvc_reset_too_early() runs on RAW_Test_CT {
/* Activate two NS codec ports */
- f_init_ns_codec();
- f_init_ns_codec(1);
- f_init_ns_codec(2);
+ f_init_ns_codec(mp_nsconfig);
+ f_init_ns_codec(mp_nsconfig, 1);
+ f_init_ns_codec(mp_nsconfig, 2);
f_init_pcuif();
/* Perform Size + BSS-originated config */
f_incoming_sns_size();
@@ -313,8 +314,8 @@ testcase TC_sns_1c1u_so_bvc_reset_too_early() runs on RAW_Test_CT {
f_outgoing_ns_alive_no_ack(idx := 0);
/* Transmit BVC-RESET and expect no ACK*/
- f_tx_bvc_reset_rx_ack(0, idx := 1, exp_ack := false);
- f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci, idx := 1, exp_ack := false);
+ f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.cell_id, idx := 1, exp_ack := false);
+ f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, idx := 1, exp_ack := false);
}
/* Test adding new IP endpoints at runtime */
@@ -322,7 +323,7 @@ testcase TC_sns_add() runs on RAW_Test_CT {
f_sns_bringup_1c1u();
/* crate another NS codec port on the tester side */
- f_init_ns_codec(2);
+ f_init_ns_codec(mp_nsconfig, 2);
f_outgoing_sns_add(idx_add := 2, w_sig := 0, w_user := 1, idx := 0);
diff --git a/pcu/gen_links.sh b/pcu/gen_links.sh
index f9f6dd5..2ad9108 100755
--- a/pcu/gen_links.sh
+++ b/pcu/gen_links.sh
@@ -47,7 +47,7 @@ gen_links $DIR $FILES
DIR=../library
FILES="Misc_Helpers.ttcn General_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn L1CTL_PortType_CtrlFunct.ttcn L1CTL_PortType_CtrlFunctDef.cc LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn "
-FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc "
+FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_RAW.ttcn NS_CodecPort_CtrlFunctDef.cc "
FILES+="BSSGP_Emulation.ttcn Osmocom_Gb_Types.ttcn "
FILES+="LLC_Templates.ttcn L3_Templates.ttcn L3_Common.ttcn "
FILES+="PCUIF_Types.ttcn PCUIF_CodecPort.ttcn "