PCU: Add test for SNS Change Weight procedure

Change-Id: Ia63865139f63969ccde010b01ddb8fb073209f3a
diff --git a/pcu/PCU_Tests_RAW_SNS.ttcn b/pcu/PCU_Tests_RAW_SNS.ttcn
index 41a4059..2369b04 100644
--- a/pcu/PCU_Tests_RAW_SNS.ttcn
+++ b/pcu/PCU_Tests_RAW_SNS.ttcn
@@ -89,6 +89,19 @@
 	rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 24, omit, v4));
 }
 
+function f_outgoing_sns_chg_weight(integer idx_chg, uint8_t w_sig, uint8_t w_user, integer idx := 0)
+runs on RAW_NS_CT {
+	log("f_outgoing_sns_chg_weight(idx_chg=", idx_chg, ")");
+	var PDU_NS rx;
+	var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx_chg].local_ip,
+							     g_nsconfig[idx_chg].local_udp_port,
+							     w_sig, w_user) };
+	NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CHG_WEIGHT(g_nsconfig[idx].nsei, 25, v4)));
+	rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 25, omit, v4));
+}
+
+
+
 
 
 /* PCU-originated SNS-SIZE: successful case */
@@ -225,6 +238,15 @@
 	setverdict(pass);
 }
 
+/* Test changing weights at runtime */
+testcase TC_sns_chg_weight() runs on RAW_NS_CT {
+	f_sns_bringup_1c1u();
+
+	/* change w_user from 1 to 200 */
+	f_outgoing_sns_chg_weight(idx_chg := 1, w_sig := 0, w_user := 200, idx := 0);
+	setverdict(pass);
+}
+
 
 
 control {
@@ -236,6 +258,7 @@
 	execute( TC_sns_1c1u() );
 	execute( TC_sns_add() );
 	execute( TC_sns_del() );
+	execute( TC_sns_chg_weight() );
 }
 
 }