bts: Add testscase & infra to validate Osmux support BTS<->BSC

Related: SYS#5987
Change-Id: I1af23c7a60b05edc3b544f1fea0023f48e89f7a7
diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index 3acd619..a86be86 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -973,6 +973,14 @@
 		len := ?, /* overwritten */
 		cid := osmux_cid
 	};
+	function f_tr_RSL_IE_OSMO_Osmux_CID(template uint8_t osmux_cid := *)
+	return template RSL_IE_OSMO_Osmux_CID {
+		var template RSL_IE_OSMO_Osmux_CID ie := omit;
+		if (not istemplatekind(osmux_cid, "omit")) {
+			ie := tr_RSL_IE_OSMO_Osmux_CID(osmux_cid);
+		}
+		return ie;
+	}
 	template (value) RSL_IE_OSMO_Osmux_CID
 	ts_RSL_IE_OSMO_Osmux_CID(template (value) uint8_t osmux_cid) := {
 		len := 0, /* overwritten */
@@ -2157,7 +2165,8 @@
 
 	private function f_ts_RSL_IPA_CRCX_IEs(template (value) RslChannelNr chan_nr,
 					       template (omit) OCT4 remote_ip,
-					       template (omit) uint16_t remote_port)
+					       template (omit) uint16_t remote_port,
+					       template (omit) uint8_t osmux_cid)
 	return RSL_IE_List {
 		var RSL_IE_List ies;
 
@@ -2185,6 +2194,15 @@
 				})
 			};
 		}
+		/* Osmux CID extension IE is optional: */
+		if (not istemplatekind(osmux_cid, "omit")) {
+			ies := ies & {
+				valueof(RSL_IE:{
+					iei := RSL_IE_OSMO_OSMUX_CID,
+					body := { osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid) }
+				})
+			};
+		}
 
 		return ies;
 	}
@@ -2199,10 +2217,11 @@
 	template (value) RSL_Message
 	ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr,
 			template (omit) OCT4 remote_ip := omit,
-			template (omit) uint16_t remote_port := omit) := {
+			template (omit) uint16_t remote_port := omit,
+			template (omit) uint8_t osmux_cid := omit) := {
 		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
 		msg_type := RSL_MT_IPAC_CRCX,
-		ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port)
+		ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port, osmux_cid)
 	}
 
 	function ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
@@ -2227,19 +2246,27 @@
 		return msg;
 	}
 
-	template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
-						 template uint16_t ipa_conn_id,
-						 template OCT4 local_ip,
-						 template uint16_t local_port) := {
-		msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
-		msg_type := RSL_MT_IPAC_CRCX_ACK,
-		ies := {
-			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
-			tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
-			tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
-			tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
-			/* Optional: RTP Payload Type 2 IE */
+	function tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
+				     template uint16_t ipa_conn_id,
+				     template OCT4 local_ip,
+				     template uint16_t local_port,
+				     template uint8_t osmux_cid := omit)
+	return template RSL_Message {
+		var template RSL_Message msg := {
+			msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+			msg_type := RSL_MT_IPAC_CRCX_ACK,
+			ies := {
+				tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+				tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
+				tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
+				tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
+				/* Optional: RTP Payload Type 2 IE */
+			}
 		}
+		if (not istemplatekind(osmux_cid, "omit")) {
+			msg.ies[lengthof(msg.ies)] := tr_RSL_IE(RSL_IE_Body:{osmux_cid := f_tr_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
+		}
+		return msg;
 	}
 
 	template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
@@ -2261,20 +2288,28 @@
 		}
 	}
 
-	template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
-						     uint16_t ipa_conn_id,
-						     OCT4 remote_ip, uint16_t remote_port,
-						     uint7_t rtp_pt2) := {
-		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
-		msg_type := RSL_MT_IPAC_MDCX,
-		ies := {
-			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
-			t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
-			t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
-			t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
-			/* optional: RTP Payload Type */
-			t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
+	function ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
+				 uint16_t ipa_conn_id,
+				 OCT4 remote_ip, uint16_t remote_port,
+				 uint7_t rtp_pt2,
+				 template (omit) uint8_t osmux_cid := omit)
+	return template (value) RSL_Message {
+		var template (value) RSL_Message msg := {
+			msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+			msg_type := RSL_MT_IPAC_MDCX,
+			ies := {
+				t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
+				t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
+				t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
+				t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
+				/* optional: RTP Payload Type */
+				t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
+			}
 		}
+		if (not istemplatekind(osmux_cid, "omit")) {
+			msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
+		}
+		return msg;
 	}
 	template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
 					     template uint16_t ipa_conn_id) := {
@@ -2292,41 +2327,49 @@
 				     OCT4 local_ip, uint16_t local_port,
 				     uint7_t rtp_pt2,
 				     template (omit) uint8_t osmux_cid := omit)
-		return template (value) RSL_Message {
-			var template (value) RSL_Message msg := {
-				msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
-				msg_type := RSL_MT_IPAC_MDCX_ACK,
-				ies := {
-					t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
-					/* optional */
-					t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
-					t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
-					t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
-					/* optional: RTP Payload Type */
-					t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
-				}
+	return template (value) RSL_Message {
+		var template (value) RSL_Message msg := {
+			msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+			msg_type := RSL_MT_IPAC_MDCX_ACK,
+			ies := {
+				t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
+				/* optional */
+				t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
+				t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
+				t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
+				/* optional: RTP Payload Type */
+				t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
 			}
-			if (not istemplatekind(osmux_cid, "omit")) {
-				msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
+		}
+		if (not istemplatekind(osmux_cid, "omit")) {
+			msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
+		}
+		return msg;
+	}
+	function tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
+				     template uint16_t ipa_conn_id,
+				     template OCT4 local_ip,
+				     template uint16_t local_port,
+				     template uint7_t rtp_pt2,
+				     template uint8_t osmux_cid := omit)
+	return template RSL_Message {
+		var template RSL_Message msg := {
+			msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+			msg_type := RSL_MT_IPAC_MDCX_ACK,
+			ies := {
+				tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+				/* optional */
+				tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
+				tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
+				tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
+				/* optional: RTP Payload Type */
+				tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
 			}
-			return msg;
 		}
-	template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
-						 template uint16_t ipa_conn_id,
-						 template OCT4 local_ip,
-						 template uint16_t local_port,
-						 template uint7_t rtp_pt2) := {
-		msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
-		msg_type := RSL_MT_IPAC_MDCX_ACK,
-		ies := {
-			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
-			/* optional */
-			tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
-			tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
-			tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
-			/* optional: RTP Payload Type */
-			tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
+		if (not istemplatekind(osmux_cid, "omit")) {
+			msg.ies[lengthof(msg.ies)] := tr_RSL_IE(RSL_IE_Body:{osmux_cid := f_tr_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
 		}
+		return msg;
 	}
 
 	template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,