bsc CBSP: clear all CBSP state between runs

Some tests may stop without cleaning up the CBSP state. Avoid affecting
subsequent tests by clearing the state for each f_cbsp_init_server().

Some ETWS CMD may still be left in the RSL queue (from the time period passing
between a stopped test and the next test starting up), so clear all RSL ports.

To be able to do so, move f_cbsp_reset_bss() to the cbsp_test_CT, from where it
can access both CBSP and IPA_RSL[] ports. All current callers are on
cbsp_test_CT anyway.

This patch should fix TC_cbsp_emerg_write_bts_cgi_cchan and
TC_cbsp_emerg_write_bts_cgi_cchan_disable, which so far break because of
leftover ETWS CMDs in the RSL queue from the preceding test run.

Change-Id: If7400a6624bb6dd9cacbcc733bdeba102d19e29c
diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn
index 67fbd50..497ff80 100644
--- a/bsc/BSC_Tests_CBSP.ttcn
+++ b/bsc/BSC_Tests_CBSP.ttcn
@@ -139,6 +139,8 @@
 	g_cbsp_msg_id := cbsp_msg_id;
 	g_cbsp_ser_no := cbsp_ser_no;
 	log("g_cbsp_msg_id=", g_cbsp_msg_id, "  g_cbsp_ser_no=", g_cbsp_ser_no);
+
+	f_cbsp_reset_bss(0);
 }
 private function f_expect_cbsp_restart() runs on cbsp_test_CT {
 	interleave {
@@ -161,7 +163,12 @@
 	return valueof(ts_CbspMsgContent(payload, payload_len));
 }
 
-function f_cbsp_reset_bss(integer idx) runs on CBSP_Adapter_CT {
+function f_cbsp_reset_bss(integer idx) runs on cbsp_test_CT {
+	/* Make sure no CBSP ETWS commands from a previous CBSP test remain in the RSL queue */
+	IPA_RSL[0].clear;
+	IPA_RSL[1].clear;
+	IPA_RSL[2].clear;
+
 	var template (value) CBSP_PDU tx;
 	timer T := 3.0;
 	tx := ts_CBSP_RESET(cell_list := ts_BSSMAP_CIL_BSS);