summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-09-06 00:20:42 +0200
committerlynxis lazus <lynxis@fe80.eu>2021-09-07 12:42:48 +0000
commit94d3d10777313f0d6e472df2a4b7f7130081f967 (patch)
treeffd99e698896fb5bec6873e71529b032144b9571
parent717bb2167bf175fffacc0b0327b262ea0f714597 (diff)
ns: add tests to test UNITDATA over a BLOCKED nsvcs
The UNITDATA should be rejected by a NS STATUS PDU. Change-Id: I62ce93ca4953f8b0476a15479089db2f6c2fa684
-rw-r--r--ns/NS_Tests.ttcn57
1 files changed, 55 insertions, 2 deletions
diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index 8553684b..105d3972 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -162,6 +162,52 @@ testcase TC_tx_reset_rx_alive() runs on RAW_Test_CT {
f_sleep(1.0);
}
+/* 48.016 7.2.1 transmit a UNIT DATA over a BLOCKED NSVC when ttcn3 blocked it
+ *
+ * TTCN -> NS: reset
+ * TTCN <- NS: reset ack
+ * TTCN -> NS: unblock
+ * TTCN <- NS: unblock ack
+ * TTCN -> NS: block
+ * TTCN <- NS: block ack
+ * TTCN -> NS: unitdata
+ * TTCN <- NS: status (cause blocked)
+ */
+testcase TC_tx_block_unitdata_over_blocked() runs on RAW_Test_CT {
+ f_tx_block();
+ f_sleep(1.0);
+
+ NSCP[0].send(ts_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O));
+ f_ns_exp(tr_NS_STATUS(NS_CAUSE_NSVC_BLOCKED));
+
+ setverdict(pass);
+ f_sleep(1.0);
+ f_clean_ns_codec();
+}
+
+/* 48.016 7.2.1 transmit a UNIT DATA over a BLOCKED NSVC when ns2 blocked it
+ *
+ * TTCN -> NS: reset
+ * TTCN <- NS: reset ack
+ * TTCN -> NS: unblock
+ * TTCN <- NS: unblock ack
+ * TTCN <- NS: block
+ * TTCN -> NS: block ack
+ * TTCN -> NS: unitdata
+ * TTCN <- NS: status (cause blocked)
+ */
+testcase TC_rx_block_unitdata_over_blocked() runs on RAW_Test_CT {
+ tx_block_by_vty();
+ f_sleep(1.0);
+
+ NSCP[0].send(ts_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O));
+ f_ns_exp(tr_NS_STATUS(NS_CAUSE_NSVC_BLOCKED));
+
+ setverdict(pass);
+ f_sleep(1.0);
+ f_clean_ns_codec();
+}
+
/* 48.016 7.2 unblock procedure
*
* TTCN -> NS: reset
@@ -219,9 +265,9 @@ testcase TC_tx_unblock_retries() runs on RAW_Test_CT {
* TTCN -> NS: block
* TTCN <- NS: block ack
*/
-testcase TC_tx_block() runs on RAW_Test_CT {
+function f_tx_block(float guard_secs := 30.0) runs on RAW_Test_CT {
f_init_vty();
- f_init_ns_codec(mp_nsconfig, guard_secs := 30.0);
+ f_init_ns_codec(mp_nsconfig, guard_secs := guard_secs);
/* do a NS Reset procedure */
f_outgoing_ns_reset();
@@ -235,6 +281,11 @@ testcase TC_tx_block() runs on RAW_Test_CT {
f_sleep(1.0);
}
+testcase TC_tx_block() runs on RAW_Test_CT {
+ f_tx_block()
+ f_clean_ns_codec();
+}
+
/* 48.016 7.2 block procedure by vty
*
* TTCN -> NS: reset
@@ -860,6 +911,8 @@ control {
execute( TC_tx_block() );
execute( TC_tx_block_by_vty() );
execute( TC_tx_block_by_vty_reset() );
+ execute( TC_tx_block_unitdata_over_blocked() );
+ execute( TC_rx_block_unitdata_over_blocked() );
// execute( TC_block_other_nsvc() ); // reset, unblock, sleep(1), block over another nsvci
/* 48.016 7.2 Unblock procedure */
execute( TC_tx_unblock() );