Change in osmo-ttcn3-hacks[master]: stp: Ignore M3UA SSNM messages in tests

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
Mon Feb 8 17:15:15 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22783 )

Change subject: stp: Ignore M3UA SSNM messages in tests
......................................................................

stp: Ignore M3UA SSNM messages in tests

The tests were written without considering the arrival of such messages;
however, it is well within the M3UA spec that such messages appear at
any time indicating remote point code availability etc.

In libosmo-sccp.git Id92be4691b0fd77598a6edb642c028bbd8c5b623 we start
generating those messages in osmo-stp.

Let's ignore them in the tests to avoid unexpected failures.

Later on, we likely will introduce / adapt tests to actually expect
those messages whenever appropriate.

Change-Id: I85ce8fd4f26db184833cf348293f0255bb5eaac3
Related: OS#2623
---
M library/M3UA_Templates.ttcn
M stp/STP_Tests_M3UA.ttcn
2 files changed, 221 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/M3UA_Templates.ttcn b/library/M3UA_Templates.ttcn
index 1063b50..5881b40 100644
--- a/library/M3UA_Templates.ttcn
+++ b/library/M3UA_Templates.ttcn
@@ -379,6 +379,218 @@
 	}
 }
 
+/***********************************************************************
+ * SSNM Class
+ ***********************************************************************/
+
+template (value) M3UA_Point_Code ts_M3UA_PC(uint24_t pc, uint8_t mask := 0) := {
+	mask := int2oct(mask, 1),
+	affected_Point_Code := int2oct(pc, 3)
+}
+
+template (value) M3UA_Affected_Point_Codes ts_M3UA_AffPc(template (value) M3UA_Point_Codes pcs) := {
+	tag := '0012'O,
+	lengthInd := 0,
+	pointCodes := pcs
+}
+template (present) M3UA_Affected_Point_Codes tr_M3UA_AffPc(template (present) M3UA_Point_Codes pcs) := {
+	tag := '0012'O,
+	lengthInd := ?,
+	pointCodes := pcs
+}
+
+template (value) M3UA_User_Cause ts_M3UA_UserCause(template (value) OCT2 cause,
+						   template (value) OCT2 user) := {
+	tag := '0204'O,
+	lengthInd := 0,
+	cause := cause,
+	user := user
+}
+template (present) M3UA_User_Cause tr_M3UA_UserCause(template (present) OCT2 cause,
+						     template (present) OCT2 user) := {
+	tag := '0204'O,
+	lengthInd := ?,
+	cause := cause,
+	user := user
+}
+
+template (value) PDU_M3UA ts_M3UA_DUNA(template (value) M3UA_Point_Codes affected_pcs,
+				       template (omit) OCT4 rctx := omit) := {
+	m3UA_DUNA := {
+		version := c_M3UA_VERSION,
+		reserved := '00'O,
+		messageClassAndType := '0201'O,
+		messageLength := 0,
+		messageParameters := {
+			network_Appearance := omit,
+			routing_Context := ts_M3UA_routing_ctx(rctx),
+			affected_Point_Codes := ts_M3UA_AffPc(affected_pcs),
+			info_String := omit
+		}
+	}
+}
+template (present) PDU_M3UA tr_M3UA_DUNA(template (present) M3UA_Point_Codes affected_pcs := ?,
+					 template OCT4 rctx := *):= {
+	m3UA_DUNA := {
+		version := c_M3UA_VERSION,
+		reserved := '00'O,
+		messageClassAndType := '0201'O,
+		messageLength := ?,
+		messageParameters := {
+			network_Appearance := *,
+			routing_Context := tr_M3UA_routing_ctx(rctx),
+			affected_Point_Codes := tr_M3UA_AffPc(affected_pcs),
+			info_String := *
+		}
+	}
+}
+
+template (value) PDU_M3UA ts_M3UA_DAVA(template (value) M3UA_Point_Codes affected_pcs,
+				       template (omit) OCT4 rctx := omit) := {
+	m3UA_DAVA := {
+		version := c_M3UA_VERSION,
+		reserved := '00'O,
+		messageClassAndType := '0202'O,
+		messageLength := 0,
+		messageParameters := {
+			network_Appearance := omit,
+			routing_Context := ts_M3UA_routing_ctx(rctx),
+			affected_Point_Codes := ts_M3UA_AffPc(affected_pcs),
+			info_String := omit
+		}
+	}
+}
+template (present) PDU_M3UA tr_M3UA_DAVA(template (present) M3UA_Point_Codes affected_pcs := ?,
+					 template OCT4 rctx := *):= {
+	m3UA_DAVA := {
+		version := c_M3UA_VERSION,
+		reserved := '00'O,
+		messageClassAndType := '0202'O,
+		messageLength := ?,
+		messageParameters := {
+			network_Appearance := *,
+			routing_Context := tr_M3UA_routing_ctx(rctx),
+			affected_Point_Codes := tr_M3UA_AffPc(affected_pcs),
+			info_String := *
+		}
+	}
+}
+
+template (value) PDU_M3UA ts_M3UA_DAUD(template (value) M3UA_Point_Codes affected_pcs,
+				       template (omit) OCT4 rctx := omit) := {
+	m3UA_DAUD := {
+		version := c_M3UA_VERSION,
+		reserved := '00'O,
+		messageClassAndType := '0203'O,
+		messageLength := 0,
+		messageParameters := {
+			network_Appearance := omit,
+			routing_Context := ts_M3UA_routing_ctx(rctx),
+			affected_Point_Codes := ts_M3UA_AffPc(affected_pcs),
+			info_String := omit
+		}
+	}
+}
+template (present) PDU_M3UA tr_M3UA_DAUD(template (present) M3UA_Point_Codes affected_pcs := ?,
+					 template OCT4 rctx := *):= {
+	m3UA_DAUD := {
+		version := c_M3UA_VERSION,
+		reserved := '00'O,
+		messageClassAndType := '0203'O,
+		messageLength := ?,
+		messageParameters := {
+			network_Appearance := *,
+			routing_Context := tr_M3UA_routing_ctx(rctx),
+			affected_Point_Codes := tr_M3UA_AffPc(affected_pcs),
+			info_String := *
+		}
+	}
+}
+
+template (value) PDU_M3UA ts_M3UA_SCON(template (value) M3UA_Point_Codes affected_pcs,
+				       template (omit) OCT4 rctx := omit) := {
+	m3UA_SCON := {
+		version := c_M3UA_VERSION,
+		reserved := '00'O,
+		messageClassAndType := '0204'O,
+		messageLength := 0,
+		messageParameters := {
+			network_Appearance := omit,
+			routing_Context := ts_M3UA_routing_ctx(rctx),
+			affected_Point_Codes := ts_M3UA_AffPc(affected_pcs),
+			concerned_Destination := omit,
+			congestion_Indicators := omit,
+			info_String := omit
+		}
+	}
+}
+template (present) PDU_M3UA tr_M3UA_SCON(template (present) M3UA_Point_Codes affected_pcs := ?,
+					 template OCT4 rctx := *):= {
+	m3UA_SCON := {
+		version := c_M3UA_VERSION,
+		reserved := '00'O,
+		messageClassAndType := '0204'O,
+		messageLength := ?,
+		messageParameters := {
+			network_Appearance := *,
+			routing_Context := tr_M3UA_routing_ctx(rctx),
+			affected_Point_Codes := tr_M3UA_AffPc(affected_pcs),
+			concerned_Destination := *,
+			congestion_Indicators := *,
+			info_String := *
+		}
+	}
+}
+
+template (value) PDU_M3UA ts_M3UA_DUPU(template (value) M3UA_Point_Codes affected_pcs,
+					template (value) OCT2 cause,
+					template (value) OCT2 user,
+					template (omit) OCT4 rctx := omit) := {
+	m3UA_DUPU := {
+		version := c_M3UA_VERSION,
+		reserved := '00'O,
+		messageClassAndType := '0205'O,
+		messageLength := 0,
+		messageParameters := {
+			network_Appearance := omit,
+			routing_Context := ts_M3UA_routing_ctx(rctx),
+			affected_Point_Codes := ts_M3UA_AffPc(affected_pcs),
+			user_Cause := ts_M3UA_UserCause(cause, user),
+			info_String := omit
+		}
+	}
+}
+template (present) PDU_M3UA tr_M3UA_DUPU(template (present) M3UA_Point_Codes affected_pcs := ?,
+					 template (present) OCT2 cause := ?,
+					 template (present) OCT2 user := ?,
+					 template OCT4 rctx := *):= {
+	m3UA_DUPU := {
+		version := c_M3UA_VERSION,
+		reserved := '00'O,
+		messageClassAndType := '0205'O,
+		messageLength := ?,
+		messageParameters := {
+			network_Appearance := *,
+			routing_Context := tr_M3UA_routing_ctx(rctx),
+			affected_Point_Codes := tr_M3UA_AffPc(affected_pcs),
+			user_Cause := tr_M3UA_UserCause(cause, user),
+			info_String := *
+		}
+	}
+}
+
+template (present) PDU_M3UA tr_M3UA_DRST := {
+	m3UA_DRST := {
+		version := c_M3UA_VERSION,
+		reserved := '00'O,
+		messageClassAndType := '0206'O,
+		messageLength := ?,
+		messageParameters := ?
+	}
+}
+
+template (present) PDU_M3UA tr_M3UA_SSNM := (tr_M3UA_DUNA, tr_M3UA_DAVA, tr_M3UA_DAUD,
+					     tr_M3UA_SCON, tr_M3UA_DUPU, tr_M3UA_DRST);
 
 /***********************************************************************
  * MGMT Class
diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 22272f3..b76d9be 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -75,6 +75,14 @@
 	[] any from M3UA.receive(tr_SctpPeerAddrChange) { repeat; }
 }
 
+private altstep as_m3ua_ssnm_ignore() runs on RAW_M3UA_CT {
+	var M3UA_RecvFrom rx;
+	[] any from M3UA.receive(t_M3UA_RecvFrom(tr_M3UA_SSNM)) -> value rx {
+		log("Ignoring M3UA SSNM", rx);
+		repeat;
+		}
+}
+
 friend function f_M3UA_send(integer idx, template (present) PDU_M3UA msg, template integer stream := 0)
 runs on RAW_M3UA_CT {
 	M3UA[idx].send(t_M3UA_Send(g_m3ua_conn_id[idx], msg, stream));
@@ -183,6 +191,7 @@
 	f_init_common();
 
 	activate(as_m3ua_sctp());
+	activate(as_m3ua_ssnm_ignore());
 
 	for (i := 0; i < NR_M3UA; i:=i+1) {
 		map(self:M3UA[i], system:M3UA_CODEC_PT);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22783
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: I85ce8fd4f26db184833cf348293f0255bb5eaac3
Gerrit-Change-Number: 22783
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210208/829b7986/attachment.htm>


More information about the gerrit-log mailing list