aboutsummaryrefslogtreecommitdiffstats
path: root/pcu/PCU_Tests_NS.ttcn
diff options
context:
space:
mode:
Diffstat (limited to 'pcu/PCU_Tests_NS.ttcn')
-rw-r--r--pcu/PCU_Tests_NS.ttcn51
1 files changed, 29 insertions, 22 deletions
diff --git a/pcu/PCU_Tests_NS.ttcn b/pcu/PCU_Tests_NS.ttcn
index 4db78d87..eea8d3f5 100644
--- a/pcu/PCU_Tests_NS.ttcn
+++ b/pcu/PCU_Tests_NS.ttcn
@@ -12,15 +12,14 @@ module PCU_Tests_NS {
import from General_Types all;
import from Osmocom_Types all;
+import from Osmocom_VTY_Functions all;
+import from TELNETasp_PortType 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;
@@ -28,20 +27,23 @@ import from PCUIF_Types all;
import from PCUIF_CodecPort all;
import from RAW_NS all;
-modulepar {
- /* tolerate CellID absence/presence in BVC-RESET in violation to spec */
- boolean mp_tolerate_bvc_reset_cellid := false;
-}
-
type component RAW_PCU_CT {
/* PCUIF (we emulate the BTS part) */
port PCUIF_CODEC_PT PCU;
var ConnectionId g_pcu_conn_id := -1;
+ /* VTY connection to the PCU */
+ port TELNETasp_PT PCUVTY;
}
type component RAW_Test_CT extends RAW_NS_CT, RAW_PCU_CT {
}
+function f_init_vty(charstring id) runs on RAW_PCU_CT {
+ map(self:PCUVTY, system:PCUVTY);
+ f_vty_set_prompts(PCUVTY);
+ f_vty_transceive(PCUVTY, "enable");
+}
+
function f_init_pcuif() runs on RAW_PCU_CT {
var PCUIF_info_ind info_ind;
map(self:PCU, system:PCU);
@@ -70,7 +72,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 +90,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 +100,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].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 +120,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 +137,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 +163,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 +178,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 */
@@ -193,11 +202,7 @@ testcase TC_ns_full_bringup() runs on RAW_Test_CT {
f_outgoing_ns_alive();
/* Expect BVC-RESET for signaling (0) and ptp BVCI */
- if (mp_tolerate_bvc_reset_cellid) {
- as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.bvc[0].cell_id, omit, oneshot := true);
- } else {
- as_rx_bvc_reset_tx_ack(0, omit, omit, oneshot := true);
- }
+ as_rx_bvc_reset_tx_ack(0, omit, omit, oneshot := true);
as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, omit, oneshot := true);
as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);
@@ -205,6 +210,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 +230,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();
}