Change in osmo-ttcn3-hacks[master]: stp: Introduce M3UA SSNM 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:24:27 UTC 2021


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

Change subject: stp: Introduce M3UA SSNM tests
......................................................................

stp: Introduce M3UA SSNM tests

Tests for M3UA SSNM behavior.  This is just being introduced in
osmo-stp, so all tests will fail on 'latest', and some will still fail
until SSNM processing inside osmo-stp is becoming more complete.

Change-Id: I5074dccde9940956439235e8d02e6a722b8da5f5
Related: OS#2623
---
M stp/STP_Tests_M3UA.ttcn
1 file changed, 137 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 1bc5ad5..66a3f6f 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -233,13 +233,15 @@
 	}
 }
 
-friend function f_init_m3ua() runs on RAW_M3UA_CT {
+friend function f_init_m3ua(boolean ignore_ssnm := true) runs on RAW_M3UA_CT {
 	var integer i;
 
 	f_init_common();
 
 	activate(as_m3ua_sctp());
-	activate(as_m3ua_ssnm_ignore());
+	if (ignore_ssnm) {
+		activate(as_m3ua_ssnm_ignore());
+	}
 
 	for (i := 0; i < NR_M3UA; i:=i+1) {
 		map(self:M3UA[i], system:M3UA_CODEC_PT);
@@ -304,6 +306,12 @@
 	f_M3UA_exp(idx, tr_M3UA_ASPAC_ACK(tmt, rctx));
 }
 
+/* perform an outbound ASP-INACTIVATE procedure */
+friend function f_M3UA_asp_inact(integer idx, template (omit) OCT4 rctx := omit) runs on RAW_M3UA_CT {
+	f_M3UA_send(idx, ts_M3UA_ASPIA(rctx));
+	f_M3UA_exp(idx, tr_M3UA_ASPIA_ACK(rctx));
+}
+
 /* perform outbound ASP-UP and ASP-ACT, optionally expect interemittent NOTIFY */
 friend function f_M3UA_asp_up_act(integer idx, template (omit) M3UA_Traffic_Mode_Type tmt := omit,
 				   template (omit) OCT4 rctx := omit,
@@ -742,6 +750,126 @@
 	f_clear_m3ua();
 }
 
+/* Test if ASPAC / ASPIA of one ASP generates DAVA / DUNA on other ASP */
+testcase TC_ssnm_aspac_dava_aspia_duna() runs on RAW_M3UA_CT {
+	var OCT4 rctx0 := int2oct(mp_m3ua_configs[0].routing_ctx, 4);
+
+	f_init_m3ua(ignore_ssnm := false);
+	/* activate the first ASP */
+	f_M3UA_asp_up_act(0);
+
+	/* activate the second ASP */
+	f_M3UA_asp_up_act(1, c_M3UA_TMT_override, omit);
+	/* expect DAVA for PC of second ASP on first ASP */
+	f_M3UA_exp(0, tr_M3UA_DAVA({ts_M3UA_PC(mp_m3ua_configs[1].point_code, 0)}, rctx0));
+	/* TODO: expect no DAVA on second ASP */
+
+	/* deactivate the second ASP */
+	f_M3UA_asp_inact(1);
+	/* expect DUNA for PC of second ASP on first ASP */
+	f_M3UA_exp(0, tr_M3UA_DUNA({ts_M3UA_PC(mp_m3ua_configs[1].point_code, 0)}, rctx0));
+	/* TODO: expect no DUNA on second ASP */
+
+	f_clear_m3ua();
+}
+
+/* Test if DAVA/DUNA sent from SG to ASP-role STP gets forwarded to other ASP */
+testcase TC_ssnm_distribution_dava_duna() runs on RAW_M3UA_CT {
+	var OCT4 rctx0 := int2oct(mp_m3ua_configs[0].routing_ctx, 4);
+	var OCT4 rctxS0 := int2oct(mp_m3ua_configs[M3UA_SRV(0)].routing_ctx, 4);
+	/* some random point code whose availability we advertise */
+	var template (value) M3UA_Point_Code adv_pc := ts_M3UA_PC(1234, 0);
+
+	f_init_m3ua(ignore_ssnm := false);
+
+	/* activate the first ASP */
+	f_M3UA_asp_up_act(0);
+
+	/* activate SG-role ASP (ASP on STP) */
+	f_init_m3ua_srv();
+	f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := int2oct(mp_m3ua_configs[M3UA_SRV(0)].routing_ctx, 4));
+
+	/* transmit a DAVA to the remote ASP */
+	f_M3UA_send(M3UA_SRV(0), ts_M3UA_DAVA({adv_pc}, rctxS0));
+	/* expect that to show up on other ASP */
+	f_M3UA_exp(0, tr_M3UA_DAVA({adv_pc}, rctx0));
+
+	/* transmit a DUNA to the remote ASP */
+	f_M3UA_send(M3UA_SRV(0), ts_M3UA_DUNA({adv_pc}, rctxS0));
+	/* expect that to show up on other ASP */
+	f_M3UA_exp(0, tr_M3UA_DUNA({adv_pc}, rctx0));
+}
+
+/* Test if DAVA/DUNA sent from SG to ASP-role STP gets forwarded to other ASP */
+testcase TC_ssnm_distribution_dava_duna_multipc() runs on RAW_M3UA_CT {
+	var OCT4 rctx0 := int2oct(mp_m3ua_configs[0].routing_ctx, 4);
+	var OCT4 rctxS0 := int2oct(mp_m3ua_configs[M3UA_SRV(0)].routing_ctx, 4);
+	/* some random point code whose availability we advertise */
+	var template (value) M3UA_Point_Codes adv_pcs := { ts_M3UA_PC(1234, 0), ts_M3UA_PC(5678, 0) };
+
+	f_init_m3ua(ignore_ssnm := false);
+
+	/* activate the first ASP */
+	f_M3UA_asp_up_act(0);
+
+	/* activate SG-role ASP (ASP on STP) */
+	f_init_m3ua_srv();
+	f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := int2oct(mp_m3ua_configs[M3UA_SRV(0)].routing_ctx, 4));
+
+	/* transmit a DAVA to the remote ASP */
+	f_M3UA_send(M3UA_SRV(0), ts_M3UA_DAVA(adv_pcs, rctxS0));
+	/* expect that to show up on other ASP */
+	f_M3UA_exp(0, tr_M3UA_DAVA(adv_pcs, rctx0));
+
+	/* transmit a DUNA to the remote ASP */
+	f_M3UA_send(M3UA_SRV(0), ts_M3UA_DUNA(adv_pcs, rctxS0));
+	/* expect that to show up on other ASP */
+	f_M3UA_exp(0, tr_M3UA_DUNA(adv_pcs, rctx0));
+}
+
+/* Test if DUPU sent from SG to ASP-role STP gets forwarded to other ASP */
+testcase TC_ssnm_distribution_dupu() runs on RAW_M3UA_CT {
+	var OCT4 rctx0 := int2oct(mp_m3ua_configs[0].routing_ctx, 4);
+	var OCT4 rctxS0 := int2oct(mp_m3ua_configs[M3UA_SRV(0)].routing_ctx, 4);
+	/* some random point code whose availability we advertise */
+	var template (value) M3UA_Point_Code adv_pc := ts_M3UA_PC(1234, 0);
+
+	f_init_m3ua(ignore_ssnm := false);
+
+	/* activate the first ASP */
+	f_M3UA_asp_up_act(0);
+
+	/* activate SG-role ASP (ASP on STP) */
+	f_init_m3ua_srv();
+	f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := int2oct(mp_m3ua_configs[M3UA_SRV(0)].routing_ctx, 4));
+
+	/* transmit a DUPU to the remote ASP */
+	f_M3UA_send(M3UA_SRV(0), ts_M3UA_DUPU({adv_pc}, '0102'O, 'ABCD'O, rctxS0));
+	/* expect that to show up on other ASP */
+	f_M3UA_exp(0, tr_M3UA_DUPU({adv_pc}, '0102'O, 'ABCD'O, rctx0));
+}
+
+/* Test if SCON sent from SG to ASP-role STP gets forwarded to other ASP */
+testcase TC_ssnm_distribution_scon() runs on RAW_M3UA_CT {
+	var OCT4 rctx0 := int2oct(mp_m3ua_configs[0].routing_ctx, 4);
+	var OCT4 rctxS0 := int2oct(mp_m3ua_configs[M3UA_SRV(0)].routing_ctx, 4);
+	/* some random point code whose availability we advertise */
+	var template (value) M3UA_Point_Code adv_pc := ts_M3UA_PC(1234, 0);
+
+	f_init_m3ua(ignore_ssnm := false);
+
+	/* activate the first ASP */
+	f_M3UA_asp_up_act(0);
+
+	/* activate SG-role ASP (ASP on STP) */
+	f_init_m3ua_srv();
+	f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := int2oct(mp_m3ua_configs[M3UA_SRV(0)].routing_ctx, 4));
+
+	/* transmit a SCON to the remote ASP */
+	f_M3UA_send(M3UA_SRV(0), ts_M3UA_SCON({adv_pc}, rctxS0));
+	/* expect that to show up on other ASP */
+	f_M3UA_exp(0, tr_M3UA_SCON({adv_pc}, rctx0));
+}
 
 
 control {
@@ -776,6 +904,13 @@
 	execute( TC_clnt_sg_to_asp() );
 	execute( TC_clnt_asp_to_sg() );
 
+	/* M3UA SSNM tests */
+	execute( TC_ssnm_aspac_dava_aspia_duna() );
+	execute( TC_ssnm_distribution_dava_duna() );
+	execute( TC_ssnm_distribution_dava_duna_multipc() );
+	execute( TC_ssnm_distribution_dupu() );
+	execute( TC_ssnm_distribution_scon() );
+
 	/* put this one last as it changes the stp side config */
 	execute( TC_clnt_asp_act_tmt_loadshare() );
 }

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


More information about the gerrit-log mailing list