Change in osmo-ttcn3-hacks[master]: DIAMETER_Emulation: Notify user of CapabilityExchange

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/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Apr 26 20:08:43 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17951 )


Change subject: DIAMETER_Emulation: Notify user of CapabilityExchange
......................................................................

DIAMETER_Emulation: Notify user of CapabilityExchange

During start of the test case, we must wait until the IUT has
established a DIAMETER/SCTP connection to the testsuite.  Implement
this by means of a message on the DIAMETER_UNIT port and an associated
helper function.

Change-Id: I95434307efc67025ee6d373561f6d22398f959c5
---
M library/DIAMETER_Emulation.ttcn
M mme/MME_Tests.ttcn
2 files changed, 30 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/51/17951/1

diff --git a/library/DIAMETER_Emulation.ttcn b/library/DIAMETER_Emulation.ttcn
index cff4d63..f7a0f88 100644
--- a/library/DIAMETER_Emulation.ttcn
+++ b/library/DIAMETER_Emulation.ttcn
@@ -37,6 +37,12 @@
 
 type hexstring IMSI;
 
+/* notify the recipient that a Capability Exchange happened */
+type record DiameterCapabilityExchgInd {
+	PDU_DIAMETER rx,
+	PDU_DIAMETER tx
+};
+
 type component DIAMETER_ConnHdlr {
 	port DIAMETER_Conn_PT DIAMETER;
 	/* procedure based port to register for incoming connections */
@@ -50,7 +56,7 @@
 
 /* global test port e.g. for non-imsi/conn specific messages */
 type port DIAMETER_PT message {
-	inout PDU_DIAMETER;
+	inout PDU_DIAMETER, DiameterCapabilityExchgInd;
 } with { extension "internal" };
 
 
@@ -319,6 +325,8 @@
 			resp := ts_DIA_CEA(mrf.msg.hop_by_hop_id, mrf.msg.end_to_end_id, p.origin_host,
 					   p.origin_realm, f_inet_addr(p.local_ip), p.vendor_app_id);
 			DIAMETER.send(t_DIAMETER_Send(g_diameter_conn_id, resp));
+			/* notify our user that the CER->CEA exchange has happened */
+			DIAMETER_UNIT.send(DiameterCapabilityExchgInd:{rx:=mrf.msg, tx:=valueof(resp)});
 			}
 
 		/* DIAMETER from remote peer */
@@ -434,4 +442,23 @@
 }
 
 
+function f_diameter_wait_capability(DIAMETER_PT pt)
+{
+	/* Wait for the Capability Exchange with the DUT */
+	timer T := 10.0;
+	T.start;
+	alt {
+	[] pt.receive(DiameterCapabilityExchgInd:?) {}
+	[] pt.receive {
+		setverdict(fail, "Unexpected receive waiting for DiameterCapabilityExchgInd");
+		mtc.stop;
+		}
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for DiameterCapabilityExchgInd");
+		mtc.stop;
+		}
+	}
+}
+
+
 }
diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn
index 0516809..f9bcf6d 100644
--- a/mme/MME_Tests.ttcn
+++ b/mme/MME_Tests.ttcn
@@ -229,6 +229,8 @@
 	connect(vc_DIAMETER:DIAMETER_UNIT, self:DIAMETER_UNIT);
 	connect(vc_DIAMETER:DIAMETER_PROC, self:DIAMETER_PROC);
 	vc_DIAMETER.start(DIAMETER_Emulation.main(ops, pars, id));
+
+	f_diameter_wait_capability(DIAMETER_UNIT);
 }
 
 friend template (value) TAI ts_enb_S1AP_TAI(EnbParams enb) := {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17951
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I95434307efc67025ee6d373561f6d22398f959c5
Gerrit-Change-Number: 17951
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200426/e9103324/attachment.htm>


More information about the gerrit-log mailing list