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/pcu/PCU_Tests_SNS.ttcn b/pcu/PCU_Tests_SNS.ttcn
index aed363b..ea78761 100644
--- a/pcu/PCU_Tests_SNS.ttcn
+++ b/pcu/PCU_Tests_SNS.ttcn
@@ -297,11 +297,21 @@
 	f_outgoing_ns_alive(1);
 
 	if (sgsn_originated_reset) {
+		/* Expect BVC-RESET, but ignore it to prevent a race condition of BVC RESETs */
+		var template PDU_NS pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, 0, omit));
+		f_ns_exp(pdu);
+		/* SGSN originated BVC-RESET on an uninitialized signalling BVC */
 		f_tx_bvc_reset_rx_ack(0, omit, omit);
+
+		/* Expect BVC-RESET PTP BVC, but ignore it to prevent a race condition of BVC RESETs */
+		pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id));
+		f_ns_exp(pdu);
+		/* SGSN originated BVC-RESET on an uninitialized PTP BVC */
 		f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, omit, mp_gb_cfg.bvc[0].cell_id);
 	} else {
-		/* Expect BVC-RESET for signaling (0) and ptp BVCI */
+		/* Expect BVC-RESET for signaling BVCI=0 */
 		as_rx_bvc_reset_tx_ack(0, omit, omit, oneshot := true);
+		/* Expect BVC-RESET from the PCU on PTP BVC */
 		as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, omit, oneshot := true);
 	}
 	/* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==0) */
@@ -347,11 +357,20 @@
 	f_outgoing_ns_alive_no_ack(idx := 0);
 
 	if (sgsn_originated_reset) {
+		/* Expect BVC-RESET, but ignore it to prevent a race condition of BVC RESETs */
+		var template PDU_NS pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, 0, omit));
+		f_ns_exp(pdu, idx := 1);
+		/* SGSN originated BVC-RESET on an uninitialized sign BVC */
 		f_tx_bvc_reset_rx_ack(0, omit, omit, idx := 1);
+
+		/* Expect BVC-RESET PTP BVC, but ignore it to prevent a race condition of BVC RESETs */
+		pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id));
+		f_ns_exp(pdu, idx := 1);
 		f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, omit, mp_gb_cfg.bvc[0].cell_id, idx := 1);
 	} else {
-		/* Expect BVC-RESET for signaling BVCI=0 and ptp BVCI */
+		/* Expect BVC-RESET for signaling BVCI=0 */
 		as_rx_bvc_reset_tx_ack(0, omit, omit, oneshot := true, idx := 1);
+		/* Expect BVC-RESET from the PCU on PTP BVC */
 		as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, omit, oneshot := true, idx := 1);
 	}
 	/* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==1) */