NS_Tests: add testcases for incoming SNS_ADD/DEL procedures

Allow to test add and remove a bind via vty.

Related: OS#5036
Change-Id: I98c04c083521ab38b58e8df9f1aee89445ab536d
This commit is contained in:
Alexander Couzens 2021-05-25 13:43:57 +02:00
parent 9041c3b8b2
commit 6f17ecc877
3 changed files with 69 additions and 0 deletions

View File

@ -21,6 +21,18 @@ NS_Tests.mp_nsconfig := {
} }
}, },
nsvci := 1234 nsvci := 1234
},
{
provider := {
ip := {
address_family := AF_INET,
local_ip := "127.0.0.1",
local_udp_port := 22000,
remote_ip := "127.0.0.1",
remote_udp_port := 23001
}
},
nsvci := 1235
} }
} }
} }

View File

@ -44,6 +44,20 @@ modulepar {
} }
}, },
nsvci := 97 nsvci := 97
},
{
provider := {
ip := {
address_family := AF_INET,
local_udp_port := 21000,
local_ip := "127.0.0.1",
remote_udp_port := 23001,
remote_ip := "127.0.0.1",
data_weight := 1,
signalling_weight := 1
}
},
nsvci := 98
} }
} }
}; };
@ -58,6 +72,7 @@ private function f_init_vty() runs on RAW_Test_CT {
f_vty_set_prompts(NSVTY); f_vty_set_prompts(NSVTY);
f_vty_transceive(NSVTY, "enable"); f_vty_transceive(NSVTY, "enable");
f_vty_transceive(NSVTY, "nsvc nsei " & int2str(mp_nsconfig.nsei) & " force-unconfigured"); f_vty_transceive(NSVTY, "nsvc nsei " & int2str(mp_nsconfig.nsei) & " force-unconfigured");
f_vty_config2(NSVTY, {"ns", "nse " & int2str(mp_nsconfig.nsei)}, "no ip-sns-bind local2");
} }
/* ensure no matching message is received within 'tout' */ /* ensure no matching message is received within 'tout' */
@ -527,6 +542,42 @@ testcase TC_sns_bss_change_weight_timeout() runs on RAW_Test_CT {
f_clean_ns_codec(); f_clean_ns_codec();
} }
testcase TC_sns_bss_add() 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();
activate(as_rx_alive_tx_ack());
f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2");
f_incoming_sns_add(idx_add := 1);
as_rx_alive_tx_ack(oneshot := true, idx := 1);
setverdict(pass);
f_clean_ns_codec();
}
testcase TC_sns_bss_del() 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();
activate(as_rx_alive_tx_ack());
f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2");
f_incoming_sns_add(idx_add := 1);
as_rx_alive_tx_ack(oneshot := true, idx := 1);
/* delete the endpoint */
f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "no ip-sns-bind local2");
f_incoming_sns_del(idx_del := 1);
setverdict(pass);
f_clean_ns_codec();
}
control { control {
if (mp_dialect == NS2_DIALECT_STATIC_RESETBLOCK or mp_dialect == NS2_DIALECT_IPACCESS) { if (mp_dialect == NS2_DIALECT_STATIC_RESETBLOCK or mp_dialect == NS2_DIALECT_IPACCESS) {
execute( TC_tx_reset() ); execute( TC_tx_reset() );
@ -574,6 +625,8 @@ control {
execute( TC_sns_config_success() ); execute( TC_sns_config_success() );
execute( TC_sns_bss_change_weight() ); execute( TC_sns_bss_change_weight() );
execute( TC_sns_bss_change_weight_timeout() ); execute( TC_sns_bss_change_weight_timeout() );
execute( TC_sns_bss_add() );
execute( TC_sns_bss_del() );
} }
} }

View File

@ -92,6 +92,10 @@ ns
listen 127.0.0.1 23000 listen 127.0.0.1 23000
ip-sns signalling-weight 2 data-weight 2 ip-sns signalling-weight 2 data-weight 2
accept-ipaccess accept-ipaccess
bind udp local2
listen 127.0.0.1 23001
ip-sns signalling-weight 1 data-weight 1
accept-ipaccess
nse 1234 nse 1234
ip-sns-remote 127.0.0.1 22000 ip-sns-remote 127.0.0.1 22000
ip-sns-bind local ip-sns-bind local