ns: add test case for UNITDATA transmission

Change-Id: I5f59581d4257436eb9651c0c5ab5dd002f23d834
diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index 58aeacd..c3247fc 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -77,6 +77,7 @@
 	map(self:NSVTY, system:NSVTY);
 	f_vty_set_prompts(NSVTY);
 	f_vty_transceive(NSVTY, "enable");
+	f_vty_config2(NSVTY, {}, "mirror-mode disable");
 	f_vty_transceive(NSVTY, "nsvc nsei " & int2str(mp_nsconfig.nsei) & " force-unconfigured");
 	if (mp_dialect == NS2_DIALECT_SNS) {
 		f_vty_config2(NSVTY, {"ns", "nse " & int2str(mp_nsconfig.nsei)}, "ip-sns-bind local");
@@ -218,7 +219,7 @@
  * TTCN  -> NS: unblock
  * TTCN <-  NS: unblock ack
  */
-testcase TC_tx_unblock() runs on RAW_Test_CT {
+function f_tx_unblock() runs on RAW_Test_CT {
 	f_init_vty();
 	f_init_ns_codec(mp_nsconfig, guard_secs := 30.0);
 
@@ -229,6 +230,10 @@
 
 	f_outgoing_ns_unblock();
 	setverdict(pass);
+}
+
+testcase TC_tx_unblock() runs on RAW_Test_CT {
+	f_tx_unblock();
 	f_sleep(1.0);
 	f_clean_ns_codec();
 }
@@ -922,6 +927,27 @@
 	f_clean_ns_codec();
 }
 
+/* 48.016 7.2 transmit a UNITDATA over an ALIVE connection
+ *
+ * TTCN  -> NS: reset
+ * TTCN <-  NS: reset ack
+ * TTCN  -> NS: unblock
+ * TTCN <-  NS: unblock ack
+ * TTCN  -> NS: unitdata
+ * TTCN <-  NS: unitdata (mirror)
+ */
+testcase TC_tx_unitdata() runs on RAW_Test_CT {
+	f_tx_unblock();
+
+	f_vty_config2(NSVTY, {}, "mirror-mode enable");
+	NSCP[0].send(ts_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O));
+	f_ns_exp(tr_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O));
+	f_vty_config2(NSVTY, {}, "mirror-mode disable");
+
+	f_sleep(1.0);
+	f_clean_ns_codec();
+}
+
 control {
 	if (mp_dialect == NS2_DIALECT_STATIC_RESETBLOCK or mp_dialect == NS2_DIALECT_IPACCESS) {
 		execute( TC_tx_reset() );
@@ -965,6 +991,7 @@
 		}
 
 		execute( TC_no_reset_alive_ack() );
+		execute( TC_tx_unitdata() );
 	}
 
 	if (mp_dialect == NS2_DIALECT_SNS) {