From 42bcc441533c0fcd7e9da5deccd7d496baf0b56e Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 7 Feb 2021 21:26:30 +0100 Subject: 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 --- library/M3UA_Templates.ttcn | 212 ++++++++++++++++++++++++++++++++++++++++++++ stp/STP_Tests_M3UA.ttcn | 9 ++ 2 files changed, 221 insertions(+) diff --git a/library/M3UA_Templates.ttcn b/library/M3UA_Templates.ttcn index 1063b501..5881b40d 100644 --- a/library/M3UA_Templates.ttcn +++ b/library/M3UA_Templates.ttcn @@ -379,6 +379,218 @@ template (present) PDU_M3UA tr_M3UA_ASPIA_ACK(template OCT4 rctx) := { } } +/*********************************************************************** + * 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 22272f34..b76d9be7 100644 --- a/stp/STP_Tests_M3UA.ttcn +++ b/stp/STP_Tests_M3UA.ttcn @@ -75,6 +75,14 @@ private altstep as_m3ua_sctp() runs on RAW_M3UA_CT { [] 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 @@ friend function f_init_m3ua() runs on RAW_M3UA_CT { 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); -- cgit v1.2.3