bts/oml: Repurpose test TC_ipa_rsl_connect_nack

The old test was not really correct, since it is fine for the BTS to ACK
the RSL CONNECT despite later on failing to connect the RSL link.
RSL_CONNECT is really just setting the attributes (it could even be
replaced by SETATTR in the future), and connect happens later on.
This can still be found out by the BSC because the BBTRANSC will never
transition to a Enabled state until the RSL link becomes up.

This patch repurposes the existent test to do some more meaningful check
in a case the RSL CONNECT can be answered with a NACK. This scenario was
actually failing to be properly checked in osmo-bts until recently, so
it is expected that it will fail (and even crash) older versions of
osmo-bts.

Depends: osmo-bts.git Change-Id If27639ae1727fc5232e1a964a1b29f50c8805d80
Related: OS#5964
Change-Id: I10df611f0086d34a5482f7c8a79703938313ab3d
diff --git a/bts/BTS_Tests_OML.ttcn b/bts/BTS_Tests_OML.ttcn
index cf88931..980643a 100644
--- a/bts/BTS_Tests_OML.ttcn
+++ b/bts/BTS_Tests_OML.ttcn
@@ -675,14 +675,15 @@
 	f_shutdown_helper();
 }
 
-/* Make sure that the IUT sends RSL Connect NACK when the remote is not reachable. */
+/* Make sure that the IUT sends RSL Connect NACK when configuring unexistent TRX NR */
 testcase TC_ipa_rsl_connect_nack() runs on BSC_OML_CT {
 	timer T := 2.0;
+	/* Unconfigured TRX: */
+	template (value) OML_FOM_ObjectInstance obj_inst := ts_OML_ObjectInstance(0, 200, 255);
 
 	f_init_oml(testcasename());
 
-	/* Most likely, nobody is listening to this port */
-	OML.send(ts_OML_IPA_RslConnect(0, 65535));
+	OML.send(ts_OML_IPA_RslConnect(obj_inst, 0, 65535));
 
 	T.start;
 	alt {
@@ -811,9 +812,11 @@
 	execute( TC_ts_opstart() );
 	execute( TC_ts_opstart_noattr() );
 	execute( TC_initial_state_reports() );
-	execute( TC_ipa_rsl_connect_nack() );
 
 	execute( TC_ipa_osmo_pcu_anr_fwd() );
+
+	/* This one makes osmo-bts <= 1.6.0 crash, keep it at the end: */
+	execute( TC_ipa_rsl_connect_nack() );
 }
 
 /* BTS:
diff --git a/library/AbisOML_Types.ttcn b/library/AbisOML_Types.ttcn
index ae39671..99ad252 100644
--- a/library/AbisOML_Types.ttcn
+++ b/library/AbisOML_Types.ttcn
@@ -1249,13 +1249,17 @@
 
 
 
-template (value) OML_PDU ts_OML_IPA_RslConnect(uint8_t stream_id, uint16_t port_nr) :=
-	ts_OML_IPA_MsgType(NM_MT_IPACC_RSL_CONNECT, NM_OC_BASEB_TRANSC, ts_OML_ObjectInstance(0,0,255), {
+template (value) OML_PDU ts_OML_IPA_RslConnect(template (value) OML_FOM_ObjectInstance obj_inst,
+					       template (value) uint8_t stream_id,
+					       template (value) uint16_t port_nr) :=
+	ts_OML_IPA_MsgType(NM_MT_IPACC_RSL_CONNECT, NM_OC_BASEB_TRANSC, obj_inst, {
 			   ts_OML_IE(NM_ATT_IPACC_STREAM_ID, OML_FOM_IE_Body:{stream_id := stream_id}),
 			   ts_OML_IE(NM_ATT_IPACC_DST_IP_PORT, OML_FOM_IE_Body:{portnr := port_nr})
 			   });
-template OML_PDU tr_OML_IPA_RslConnect(template uint8_t stream_id, template uint16_t port_nr) :=
-	tr_OML_IPA_MsgType(NM_MT_IPACC_RSL_CONNECT, NM_OC_BASEB_TRANSC, tr_OML_ObjectInstance(0,0,255), {
+template OML_PDU tr_OML_IPA_RslConnect(template (present) OML_FOM_ObjectInstance obj_inst,
+				       template (present) uint8_t stream_id,
+				       template (present) uint16_t port_nr) :=
+	tr_OML_IPA_MsgType(NM_MT_IPACC_RSL_CONNECT, NM_OC_BASEB_TRANSC, obj_inst, {
 			   tr_OML_IE(NM_ATT_IPACC_STREAM_ID, OML_FOM_IE_Body:{stream_id := stream_id}),
 			   tr_OML_IE(NM_ATT_IPACC_DST_IP_PORT, OML_FOM_IE_Body:{portnr := port_nr})
 			   });