bts: More complete AGCH / IMM.ASS testing

The existing test simply sent 1000 messages via RSL without checking
what actually arrived on the radio interface, or without
expecting/counting any RSL DELETE IND.

Let's fix this by introducing test sending IMM.ASS at three different
rates, with related expectations in terms of nubmer of IMM.ASS arriving
on Um vs. RSL DELETE IND arriving at BSC.

Change-Id: Ib6043b76ba1d7aaff107bb612f63b5a747d8720c
Related: OS#2990
Related: SYS#2695
diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn
index 2ceb1f8..ef209e4 100644
--- a/library/GSM_RR_Types.ttcn
+++ b/library/GSM_RR_Types.ttcn
@@ -357,6 +357,26 @@
 		req_ref.t3 := fn mod 51;
 		return req_ref
 	}
+	function tr_compute_ReqRef(template uint8_t ra, template GsmFrameNumber fn)
+	return template RequestReference {
+		var template RequestReference req_ref;
+		if (istemplatekind(ra, "?")) {
+			req_ref.ra := ?;
+		} else {
+			req_ref.ra := int2bit(valueof(ra), 8);
+		}
+		if (istemplatekind(fn, "?")) {
+			req_ref.t1p := ?;
+			req_ref.t2 := ?;
+			req_ref.t3 := ?;
+		} else {
+			var GsmFrameNumber fn_v := valueof(fn);
+			req_ref.t1p := (fn_v / 1326) mod 32;
+			req_ref.t2 := fn_v mod 26;
+			req_ref.t3 := fn_v mod 51;
+		}
+		return req_ref;
+	}
 
 	/* 10.5.2.40 */
 	type integer TimingAdvance (0..219);
@@ -674,7 +694,7 @@
 		with { extension "prototype(convert) decode(RAW)" };
 
 
-	template GsmRrMessage ts_IMM_ASS(uint8_t ra, GsmFrameNumber fn, TimingAdvance ta,
+	template (value) GsmRrMessage ts_IMM_ASS(uint8_t ra, GsmFrameNumber fn, TimingAdvance ta,
 						ChannelDescription ch_desc, MobileAllocation ma) := {
 		header := t_RrHeader(IMMEDIATE_ASSIGNMENT, 0),
 		payload := {
@@ -696,6 +716,31 @@
 		}
 	};
 
+	template GsmRrMessage tr_IMM_ASS(template uint8_t ra := ?, template GsmFrameNumber fn := ?,
+					 template TimingAdvance ta := ?,
+					 template ChannelDescription ch_desc := ?,
+					 template MobileAllocation ma := ?) := {
+		header := t_RrHeader(IMMEDIATE_ASSIGNMENT, 0),
+		payload := {
+			imm_ass := {
+				ded_or_tbf := {
+					spare := '0'B,
+					tma := false,
+					downlink := false,
+					tbf := false
+				},
+				page_mode := PAGE_MODE_NORMAL,
+				chan_desc := ch_desc,
+				pkt_chan_desc := omit,
+				req_ref := tr_compute_ReqRef(ra, fn),
+				timing_advance := ta,
+				mobile_allocation := ma,
+				rest_octets := *
+			}
+		}
+	};
+
+
 	template (value) GsmRrL3Message ts_MEAS_REP(boolean valid, uint6_t rxl_f, uint6_t rxl_s,
 						  uint3_t rxq_f, uint3_t rxq_s,
 						  template (omit) NcellReports reps) := {