ns2: add TC_sns_sgsn_add_change_del similiar to the bss side

1. do SNS configuration
2. add a bind
3. receive the SNS_ADD
4. before answering the SNS_ADD, change the weight via vty and remove the bind

Change-Id: I1a3d2273279f3def0d225ba78d400fb52a958c64
This commit is contained in:
Alexander Couzens 2021-08-12 04:04:20 +02:00
parent 8a682d6d0c
commit 3921fb5b43
1 changed files with 47 additions and 0 deletions

View File

@ -752,6 +752,52 @@ testcase TC_sns_sgsn_del() runs on RAW_Test_CT {
f_clean_ns_codec();
}
/* 1. do SNS configuration
* 2. add a bind
* 3. receive the SNS_ADD
* 4. before answering the SNS_ADD, change the weight via vty and remove the bind
*/
testcase TC_sns_sgsn_add_change_del() runs on RAW_Test_CT {
var PDU_NS rx;
var NSVCConfiguration nsvc_cfg;
g_handle_rx_alive := true;
f_init_vty();
f_init_ns_codec(mp_nsconfig);
f_init_ns_codec(mp_nsconfig, 1);
f_outgoing_sns_size(max_nsvcs := 4, num_ip := 4);
f_outgoing_sns_config();
f_incoming_sns_config();
activate(as_rx_alive_tx_ack());
f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2");
/* rx SNS ADD */
nsvc_cfg := g_nsconfig.nsvc[1];
if (nsvc_cfg.provider.ip.address_family == AF_INET) {
var template (omit) IP4_Elements v4_elem := { ts_SNS_IPv4(nsvc_cfg.provider.ip.remote_ip,
nsvc_cfg.provider.ip.remote_udp_port,
1, 1) };
rx := f_ns_exp(tr_SNS_ADD(g_nsconfig.nsei, ?, v4 := v4_elem), 0);
} else {
var template (omit) IP6_Elements v6_elem := { ts_SNS_IPv6(nsvc_cfg.provider.ip.remote_ip,
nsvc_cfg.provider.ip.remote_udp_port,
1, 1) };
rx := f_ns_exp(tr_SNS_ADD(g_nsconfig.nsei, ?, omit, v6_elem), 0);
}
/* delete the endpoint */
f_vty_config2(NSVTY, {"ns", "bind udp local2"}, "ip-sns signalling-weight 99 data-weight 99");
f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "no ip-sns-bind local2");
/* accept the SNS_ADD */
NSCP[0].send(ts_SNS_ACK(g_nsconfig.nsei, rx.pDU_SNS_Add.transactionID));
f_incoming_sns_chg_weight(idx_chg := 1);
f_incoming_sns_del(idx_del := 1, w_sig := 99, w_user := 99);
setverdict(pass);
f_clean_ns_codec();
}
control {
if (mp_dialect == NS2_DIALECT_STATIC_RESETBLOCK or mp_dialect == NS2_DIALECT_IPACCESS) {
execute( TC_tx_reset() );
@ -812,6 +858,7 @@ control {
execute( TC_sns_sgsn_config_success() );
execute( TC_sns_sgsn_add() );
execute( TC_sns_sgsn_del() );
execute( TC_sns_sgsn_add_change_del() );
}
}
}