pcu: SNS: add TC_sns_add_existent
Try to add via SNS an already existent NSVC which should
fail.
Change-Id: I096bcbe38d82d08a150a2f8e56f6bc02353273a1
diff --git a/pcu/PCU_Tests_SNS.ttcn b/pcu/PCU_Tests_SNS.ttcn
index 5c03b94..937e30e 100644
--- a/pcu/PCU_Tests_SNS.ttcn
+++ b/pcu/PCU_Tests_SNS.ttcn
@@ -143,7 +143,7 @@
rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx);
}
-function f_outgoing_sns_add(integer idx_add, uint8_t w_sig := 1, uint8_t w_user := 1, integer idx := 0)
+function f_outgoing_sns_add(integer idx_add, uint8_t w_sig := 1, uint8_t w_user := 1, integer idx := 0, template (omit) NsCause cause := omit)
runs on RAW_NS_CT {
log("f_outgoing_sns_add(idx_add=", idx_add, ")");
var PDU_NS rx;
@@ -153,13 +153,13 @@
nsvc_cfg.provider.ip.local_udp_port,
w_sig, w_user) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_ADD(g_nsconfig[idx].nsei, 23, v4)));
- rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, omit, v4));
+ rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, cause, v4));
} else {
var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(nsvc_cfg.provider.ip.local_ip,
nsvc_cfg.provider.ip.local_udp_port,
w_sig, w_user) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_ADD(g_nsconfig[idx].nsei, 23, omit, v6)));
- rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, omit, omit, v6));
+ rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, cause, omit, v6));
}
}
@@ -420,6 +420,14 @@
setverdict(pass);
}
+/* Test adding an already present IP endpoint at runtime */
+testcase TC_sns_add_nack() runs on RAW_Test_CT {
+ f_sns_bringup_1c1u();
+
+ f_outgoing_sns_add(idx_add := 0, w_sig := 0, w_user := 1, idx := 0, cause := NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED);
+ setverdict(pass);
+}
+
/* Test deleting IP endpoints at runtime */
testcase TC_sns_del() runs on RAW_Test_CT {
f_sns_bringup_1c1u();
@@ -473,6 +481,7 @@
execute( TC_sns_1c1u_so_bvc_reset() );
execute( TC_sns_1c1u_so_bvc_reset_too_early() );
execute( TC_sns_add() );
+ execute( TC_sns_add_nack() );
execute( TC_sns_del() );
execute( TC_sns_chg_weight() );