PCU: Add test for SNS Change Weight procedure

Change-Id: Ia63865139f63969ccde010b01ddb8fb073209f3a
This commit is contained in:
Harald Welte 2019-02-23 15:09:22 +01:00
parent 630d0e6523
commit 72099557a5
2 changed files with 46 additions and 0 deletions

View File

@ -613,6 +613,29 @@ octetstring sdu) := {
}
}
template (value) PDU_NS ts_SNS_CHG_WEIGHT(Nsei nsei, uint8_t trans_id,
template (omit) IP4_Elements v4,
template (omit) IP6_Elements v6 := omit) := {
pDU_SNS_ChangeWeight := {
nsPduType := '0E'O,
nSEI_NS := ts_NS_IE_NSEI(nsei),
transactionID := trans_id,
listofIP4Elements := ts_SNS_IE_ListIP4(v4),
listofIP6Elements := ts_SNS_IE_ListIP6(v6)
}
}
template PDU_NS tr_SNS_CHG_WEIGHT(template Nsei nsei, template uint8_t trans_id,
template IP4_Elements v4,
template IP6_Elements v6 := omit) := {
pDU_SNS_ChangeWeight := {
nsPduType := '0E'O,
nSEI_NS := tr_NS_IE_NSEI(nsei),
transactionID := trans_id,
listofIP4Elements := tr_SNS_IE_ListIP4(v4),
listofIP6Elements := tr_SNS_IE_ListIP6(v6)
}
}
template (value) PDU_NS ts_SNS_ACK(Nsei nsei, uint8_t trans_id,
template (omit) NsCause cause := omit,

View File

@ -89,6 +89,19 @@ runs on RAW_NS_CT {
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 24, omit, v4));
}
function f_outgoing_sns_chg_weight(integer idx_chg, uint8_t w_sig, uint8_t w_user, integer idx := 0)
runs on RAW_NS_CT {
log("f_outgoing_sns_chg_weight(idx_chg=", idx_chg, ")");
var PDU_NS rx;
var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx_chg].local_ip,
g_nsconfig[idx_chg].local_udp_port,
w_sig, w_user) };
NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CHG_WEIGHT(g_nsconfig[idx].nsei, 25, v4)));
rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 25, omit, v4));
}
/* PCU-originated SNS-SIZE: successful case */
@ -225,6 +238,15 @@ testcase TC_sns_del() runs on RAW_NS_CT {
setverdict(pass);
}
/* Test changing weights at runtime */
testcase TC_sns_chg_weight() runs on RAW_NS_CT {
f_sns_bringup_1c1u();
/* change w_user from 1 to 200 */
f_outgoing_sns_chg_weight(idx_chg := 1, w_sig := 0, w_user := 200, idx := 0);
setverdict(pass);
}
control {
@ -236,6 +258,7 @@ control {
execute( TC_sns_1c1u() );
execute( TC_sns_add() );
execute( TC_sns_del() );
execute( TC_sns_chg_weight() );
}
}