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
This commit is contained in:
Harald Welte 2021-02-08 09:58:28 +01:00 committed by laforge
parent 1c4e984765
commit 27cfb7a230
1 changed files with 137 additions and 2 deletions

View File

@ -233,13 +233,15 @@ friend function f_M3UA_listen(integer i) runs on RAW_M3UA_CT {
}
}
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 @@ friend function f_M3UA_asp_act(integer idx, template (omit) M3UA_Traffic_Mode_Ty
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 @@ testcase TC_clnt_asp_to_sg() runs on RAW_M3UA_CT {
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 @@ control {
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() );
}