PCU_Tests_SNS: improve SGSN originated BVC-RESETs

The BVC-RESETs are a little bit more complicated. The PCU will send
a BVC-RESET after the NSE become available.
Ensure the RESET is received and ignored so there is no race condition
if both sides send a BVC-RESET at the same time.

The test case TC_sns_1c1u_so_bvc_reset is still failing because the PCU can't
handle BVC-RESETs properly (both PTP and signalling).

Change-Id: Id681749d75073c1d50a4b0a2e86f0a2dd0955b45
diff --git a/library/RAW_NS.ttcn b/library/RAW_NS.ttcn
index 8540f38..7f7b6c4 100644
--- a/library/RAW_NS.ttcn
+++ b/library/RAW_NS.ttcn
@@ -68,16 +68,23 @@
 
 }
 
-function f_ns_exp(template PDU_NS exp_rx, integer idx := 0) runs on RAW_NS_CT return PDU_NS {
+public altstep ax_rx_fail_on_any_ns(integer idx := 0) runs on RAW_NS_CT {
 	var NS_RecvFrom nrf;
-	log("f_ns_exp() expecting ", exp_rx);
-	alt {
-	[] NSCP[idx].receive(t_NS_RecvFrom(exp_rx)) -> value nrf { }
 	[] NSCP[idx].receive(t_NS_RecvFrom(?)) -> value nrf {
 		setverdict(fail, "Received unexpected NS: ", nrf);
 		mtc.stop;
 		}
+}
+
+function f_ns_exp(template PDU_NS exp_rx, integer idx := 0) runs on RAW_NS_CT return PDU_NS {
+	var NS_RecvFrom nrf;
+	log("f_ns_exp() expecting ", exp_rx);
+	/* last activated altstep has the lowest priority */
+	var default d := activate(ax_rx_fail_on_any_ns());
+	alt {
+	[] NSCP[idx].receive(t_NS_RecvFrom(exp_rx)) -> value nrf { }
 	}
+	deactivate(d);
 	return nrf.msg;
 }