Change in osmo-ttcn3-hacks[master]: fix SCCPlite BSC tests: send IPA ID ACK, not GET

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Aug 24 21:47:29 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10599 )

Change subject: fix SCCPlite BSC tests: send IPA ID ACK, not GET
......................................................................

fix SCCPlite BSC tests: send IPA ID ACK, not GET

>From libosmo-sccp.git Icffda98579e676ab6ca63c9c22cf5d151c4fe95f on, we expect
an IPA ID ACK upon first connecting, not an IPA ID GET. This might be specific
to the one MSC tested so far, but it's the status quo.

Make the IPA server in IPA_Emulation configurable, to conform and send the IPA
ID ACK upon connecting.  This fixes the ttcn3-bsc-tests,SCCPlite suite, broken
by above libosmo-sccp commit.

For other IPA clients, it is so far required to send the IPA ID GET, so only
configure the SCCPlite server in BSSAP_Adapter.ttcn to send IPA ID ACK, and
leave the others unchanged.

Related: OS#3500 OS#3498
Related: Icffda98579e676ab6ca63c9c22cf5d151c4fe95f (libosmo-sccp)
Change-Id: I34b6296a1a408729802a9659c6524c0f67a2f4fe
---
M library/BSSAP_Adapter.ttcn
M library/IPA_Emulation.ttcnpp
2 files changed, 20 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/library/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn
index ada66d2..cebdffe 100644
--- a/library/BSSAP_Adapter.ttcn
+++ b/library/BSSAP_Adapter.ttcn
@@ -107,7 +107,8 @@
 		connect(ba.vc_IPA:IPA_SP_PORT, ba.vc_WAIT:IPA_SP_PORT);
 		ba.vc_WAIT.start(IPA_Emulation.waiter_main());
 		ba.vc_IPA.start(IPA_Emulation.main_server(cfg.sctp_addr.local_ip_addr,
-							cfg.sctp_addr.local_sctp_port));
+							cfg.sctp_addr.local_sctp_port,
+							true, IPA_INIT_SEND_IPA_ID_ACK));
 		/* wait until we received an IPA CCM ID_ACK */
 		ba.vc_WAIT.done;
 		disconnect(ba.vc_IPA:IPA_SP_PORT, ba.vc_WAIT:IPA_SP_PORT);
diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp
index b10a983..5c385e6 100644
--- a/library/IPA_Emulation.ttcnpp
+++ b/library/IPA_Emulation.ttcnpp
@@ -51,6 +51,11 @@
 	IPA_MODE_SERVER
 }
 
+type enumerated IpaInitBehavior {
+	IPA_INIT_SEND_IPA_ID_GET,
+	IPA_INIT_SEND_IPA_ID_ACK
+}
+
 type record ASP_IPA_Unitdata {
 	IpaStreamId	streamId,
 	IpaExtStreamId	streamIdExt optional,
@@ -165,6 +170,7 @@
 
 	var IpaMode g_mode;
 	var boolean g_ccm_enabled;
+	var IpaInitBehavior g_init_behavior;
 	var IPA_CCM_Parameters	g_ccm_pars := c_IPA_default_ccm_pars;
 }
 
@@ -425,9 +431,12 @@
 
 /* main function to use for a server-side IPA implementation */
 function main_server(charstring local_host, IPL4asp_Types.PortNumber local_port,
-		     boolean ccm_enabled := true) runs on IPA_Emulation_CT {
+		     boolean ccm_enabled := true,
+		     IpaInitBehavior init_behavior := IPA_INIT_SEND_IPA_ID_GET)
+runs on IPA_Emulation_CT {
 	g_mode := IPA_MODE_SERVER;
 	g_ccm_enabled := ccm_enabled;
+	g_init_behavior := init_behavior;
 	f_bind(local_host, local_port);
 	ScanEvents();
 }
@@ -566,7 +575,14 @@
 			g_ipa_conn_id := asp_evt.connOpened.connId;
 			f_send_IPA_EVT(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP));
 			if (g_mode == IPA_MODE_SERVER and g_ccm_enabled) {
-				f_ccm_tx(valueof(ts_IPA_ID_GET));
+				select (g_init_behavior) {
+					case (IPA_INIT_SEND_IPA_ID_GET) {
+						f_ccm_tx(valueof(ts_IPA_ID_GET));
+					}
+					case (IPA_INIT_SEND_IPA_ID_ACK) {
+						f_ccm_tx(valueof(ts_IPA_ACK));
+					}
+				}
 			}
 		}
 

-- 
To view, visit https://gerrit.osmocom.org/10599
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I34b6296a1a408729802a9659c6524c0f67a2f4fe
Gerrit-Change-Number: 10599
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180824/3fdbb843/attachment.htm>


More information about the gerrit-log mailing list