ns: add TC_sns_bss_remove_bind_fail_sns to check SNS fails correct when removing a bind

This TC produces an abort of the ns2 dummy by the memory sanitizer.
Test if SNS fails when removing a bind which has the last valid connection.
The ns2 has 2 binds, ttcn3 1 bind. There are 2 NSVCs.

Bind -- NSVCs -- Bind.

(ns2)      (ttcn3)
1*-----------*1
            /
2*-broken--/

Remove the 1st ns2 bind after the other NSVC has failed.

Change-Id: I8f7daee7a3bcadf64e8ae607619425adbefe3c4b
This commit is contained in:
Alexander Couzens 2021-09-03 23:17:35 +02:00 committed by lynxis lazus
parent 3d174882ba
commit fdfe638cff
1 changed files with 39 additions and 0 deletions

View File

@ -78,6 +78,7 @@ private function f_init_vty() runs on RAW_Test_CT {
f_vty_set_prompts(NSVTY);
f_vty_transceive(NSVTY, "enable");
f_vty_transceive(NSVTY, "nsvc nsei " & int2str(mp_nsconfig.nsei) & " force-unconfigured");
f_vty_config2(NSVTY, {"ns", "nse " & int2str(mp_nsconfig.nsei)}, "ip-sns-bind local");
f_vty_config2(NSVTY, {"ns", "nse " & int2str(mp_nsconfig.nsei)}, "no ip-sns-bind local2");
f_vty_config2(NSVTY, {"ns", "bind udp local"}, "ip-sns signalling-weight 1 data-weight 1");
f_vty_config2(NSVTY, {"ns", "bind udp local2"}, "ip-sns signalling-weight 1 data-weight 1");
@ -686,6 +687,43 @@ testcase TC_sns_bss_all_signalling_nsvcs_failed() runs on RAW_Test_CT {
f_clean_ns_codec();
}
/* Test if SNS fails when removing a bind which has the last valid connection
*
* ns2 has 2 binds, ttcn3 1 bind.
*
* nsvcs:
* ns2 ttcn3
* 1*-----------*1
* /
* 2*-broken--/
*
* remove the 1st ns2 bind.
*/
testcase TC_sns_bss_remove_bind_fail_sns() runs on RAW_Test_CT {
g_handle_rx_alive := true;
f_init_vty();
f_init_ns_codec(mp_nsconfig);
f_init_ns_codec(mp_nsconfig, 1);
f_incoming_sns_size();
f_incoming_sns_config();
f_outgoing_sns_config();
var default d := activate(as_rx_alive_tx_ack());
f_vty_config2(NSVTY, {"ns", "bind udp local2"}, "ip-sns signalling-weight 1 data-weight 1");
f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2");
f_incoming_sns_add(idx_add := 1, w_sig := 1, w_user := 1);
/* 2nd bind won't have a valid connection to the ttcn3 */
NSCP[1].receive(t_NS_ALIVE);
NSCP[1].receive(t_NS_ALIVE);
NSCP[1].receive(t_NS_ALIVE);
NSCP[1].receive(t_NS_ALIVE);
NSCP[1].receive(t_NS_ALIVE);
f_sleep(1.0);
f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "no ip-sns-bind local");
setverdict(pass);
f_clean_ns_codec();
}
testcase TC_idle() runs on RAW_Test_CT {
f_init_vty();
f_init_ns_codec(mp_nsconfig, guard_secs := 30.0);
@ -852,6 +890,7 @@ control {
execute( TC_sns_bss_add_change_del() );
/* execute( TC_sns_bss_all_signalling_nsvcs_failed() ); */
execute( TC_sns_rx_size_force_unconf() );
execute( TC_sns_bss_remove_bind_fail_sns() );
}
if (mp_sns_role == SNS_ROLE_SGSN) {