Change in osmo-ttcn3-hacks[master]: ns: add test case TC_tx_blocked_foreign_nsvc

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Thu Sep 23 13:46:19 UTC 2021


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25560 )


Change subject: ns: add test case TC_tx_blocked_foreign_nsvc
......................................................................

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
---
M ns/NS_Tests.ttcn
M ns/NS_Tests.udp.cfg
M ns/osmo-ns.udp.cfg
3 files changed, 54 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/25560/1

diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index b57d686..722f8ec 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -992,6 +992,43 @@
 	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 @@
 		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 f040998..cdb071d 100644
--- a/ns/NS_Tests.udp.cfg
+++ b/ns/NS_Tests.udp.cfg
@@ -21,6 +21,18 @@
 				}
 			},
 			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 9591427..b327c32 100644
--- a/ns/osmo-ns.udp.cfg
+++ b/ns/osmo-ns.udp.cfg
@@ -91,5 +91,9 @@
  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

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25560
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I2b37a712bd70037b35b9deb8dab4a72d1e1d29fb
Gerrit-Change-Number: 25560
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210923/0a57d775/attachment.htm>


More information about the gerrit-log mailing list