aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-05-25 13:43:57 +0200
committerAlexander Couzens <lynxis@fe80.eu>2021-06-07 01:11:05 +0200
commit6f17ecc877112f11f5e6216b423484cb4718888c (patch)
tree872b8856c007407a5231dc2f0c063783de891ffe
parent9041c3b8b2cd664f83c6c3db79bb80d0a3ca4daa (diff)
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
-rw-r--r--ns/NS_Tests.sns.cfg12
-rw-r--r--ns/NS_Tests.ttcn53
-rw-r--r--ns/osmo-ns.sns.cfg4
3 files changed, 69 insertions, 0 deletions
diff --git a/ns/NS_Tests.sns.cfg b/ns/NS_Tests.sns.cfg
index 23b616b2..5ee5e1a0 100644
--- a/ns/NS_Tests.sns.cfg
+++ b/ns/NS_Tests.sns.cfg
@@ -21,6 +21,18 @@ NS_Tests.mp_nsconfig := {
}
},
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
}
}
}
diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index f69bbe09..58b2dda9 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -44,6 +44,20 @@ modulepar {
}
},
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_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)}, "no ip-sns-bind local2");
}
/* 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();
}
+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 {
if (mp_dialect == NS2_DIALECT_STATIC_RESETBLOCK or mp_dialect == NS2_DIALECT_IPACCESS) {
execute( TC_tx_reset() );
@@ -574,6 +625,8 @@ control {
execute( TC_sns_config_success() );
execute( TC_sns_bss_change_weight() );
execute( TC_sns_bss_change_weight_timeout() );
+ execute( TC_sns_bss_add() );
+ execute( TC_sns_bss_del() );
}
}
diff --git a/ns/osmo-ns.sns.cfg b/ns/osmo-ns.sns.cfg
index 58d306e1..b342305d 100644
--- a/ns/osmo-ns.sns.cfg
+++ b/ns/osmo-ns.sns.cfg
@@ -92,6 +92,10 @@ ns
listen 127.0.0.1 23000
ip-sns signalling-weight 2 data-weight 2
accept-ipaccess
+ bind udp local2
+ listen 127.0.0.1 23001
+ ip-sns signalling-weight 1 data-weight 1
+ accept-ipaccess
nse 1234
ip-sns-remote 127.0.0.1 22000
ip-sns-bind local