aboutsummaryrefslogtreecommitdiffstats
path: root/ns
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-09-23 15:16:08 +0200
committerlynxis lazus <lynxis@fe80.eu>2021-10-11 15:18:48 +0000
commit6d916910a3764a7934c96ab340c1b6344c707c7b (patch)
tree78e8359dbc101ea28540dacdd91ffab920db2cab /ns
parent46f199271ef77a5143d95894801eb0c86c51a565 (diff)
ns: add test case TC_tx_blocked_foreign_nsvc
Check if a BLOCK PDU over a different/foreign connection is parsed. * 2x initialize NSVC (RESET/UNBLOCK) * TTCN 0-> NS: block (nsvci 1) * TTCN <-0 NS: block ack (nsvci 1) * TTCN 1-> NS: unit data (nsvci 1) * TTCN <-1 NS: status (blocked) Change-Id: I2b37a712bd70037b35b9deb8dab4a72d1e1d29fb
Diffstat (limited to 'ns')
-rw-r--r--ns/NS_Tests.ttcn38
-rw-r--r--ns/NS_Tests.udp.cfg12
-rw-r--r--ns/osmo-ns.udp.cfg4
3 files changed, 54 insertions, 0 deletions
diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index b57d6869..722f8ecc 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -992,6 +992,43 @@ testcase TC_mirror_unitdata_tx_status_blocked() runs on RAW_Test_CT {
f_clean_ns_codec();
}
+/* 48.016 7.2 ensure tx status (blocked) is correctly parsed over a foreign NSVC
+ *
+ * 2x initialize NSVC (RESET/UNBLOCK)
+ * TTCN 0-> NS: block (nsvci 1)
+ * TTCN <-0 NS: block ack (nsvci 1)
+ * TTCN 1-> NS: unit data (nsvci 1)
+ * TTCN <-1 NS: status (blocked)
+ */
+testcase TC_tx_blocked_foreign_nsvc() runs on RAW_Test_CT {
+ f_init_vty();
+ f_vty_config2(NSVTY, {}, "mirror-mode enable");
+ f_init_ns_codec(mp_nsconfig, idx := 0);
+ f_init_ns_codec(mp_nsconfig, idx := 1);
+
+ /* do a NS Reset procedure */
+ f_outgoing_ns_reset(idx := 0);
+ f_outgoing_ns_reset(idx := 1);
+
+ /* send alive acks */
+ activate(as_rx_alive_tx_ack(idx := 0));
+ activate(as_rx_alive_tx_ack(idx := 1));
+
+ f_outgoing_ns_unblock(idx := 0);
+ f_outgoing_ns_unblock(idx := 1);
+
+ /* both NSVC are alive and unblocked */
+ NSCP[0].send(ts_NS_BLOCK(NS_CAUSE_TRANSIT_NETWORK_FAILURE, g_nsconfig.nsvc[1].nsvci));
+ f_ns_exp(tr_NS_BLOCK_ACK(g_nsconfig.nsvc[1].nsvci));
+
+ NSCP[1].send(ts_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O));
+ f_ns_exp(tr_NS_STATUS(NS_CAUSE_NSVC_BLOCKED), idx := 1);
+
+ setverdict(pass);
+ f_clean_ns_codec();
+}
+
+
control {
if (mp_dialect == NS2_DIALECT_STATIC_RESETBLOCK or mp_dialect == NS2_DIALECT_IPACCESS) {
execute( TC_tx_reset() );
@@ -1003,6 +1040,7 @@ control {
execute( TC_tx_block_unitdata_over_blocked() );
execute( TC_rx_block_unitdata_over_blocked() );
execute( TC_mirror_unitdata_tx_status_blocked() );
+ execute( TC_tx_blocked_foreign_nsvc() );
// execute( TC_block_other_nsvc() ); // reset, unblock, sleep(1), block over another nsvci
/* 48.016 7.2 Unblock procedure */
execute( TC_tx_unblock() );
diff --git a/ns/NS_Tests.udp.cfg b/ns/NS_Tests.udp.cfg
index f0409986..cdb071df 100644
--- a/ns/NS_Tests.udp.cfg
+++ b/ns/NS_Tests.udp.cfg
@@ -21,6 +21,18 @@ NS_Tests.mp_nsconfig := {
}
},
nsvci := 1234
+ },
+ {
+ provider := {
+ ip := {
+ address_family := AF_INET,
+ local_ip := "127.0.0.1",
+ local_udp_port := 22001,
+ remote_ip := "127.0.0.1",
+ remote_udp_port := 23001
+ }
+ },
+ nsvci := 1235
}
}
}
diff --git a/ns/osmo-ns.udp.cfg b/ns/osmo-ns.udp.cfg
index 95914274..b327c32d 100644
--- a/ns/osmo-ns.udp.cfg
+++ b/ns/osmo-ns.udp.cfg
@@ -91,5 +91,9 @@ ns
bind udp local
listen 127.0.0.1 23000
accept-ipaccess
+ bind udp local2
+ listen 127.0.0.1 23001
+ accept-ipaccess
nse 1234
nsvc ipa local 127.0.0.1 22000 nsvci 1234
+ nsvc ipa local2 127.0.0.1 22001 nsvci 1235