Change in osmo-ttcn3-hacks[master]: NS_Tests: add testcases for incoming SNS_ADD/DEL procedures

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Tue May 25 15:48:50 UTC 2021


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24402 )


Change subject: NS_Tests: add testcases for incoming SNS_ADD/DEL procedures
......................................................................

NS_Tests: add testcases for incoming SNS_ADD/DEL procedures

Allow to test add and remove a bind via vty.

Change-Id: I98c04c083521ab38b58e8df9f1aee89445ab536d
---
M ns/NS_Tests.sns.cfg
M ns/NS_Tests.ttcn
M ns/osmo-ns.sns.cfg
3 files changed, 69 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/02/24402/1

diff --git a/ns/NS_Tests.sns.cfg b/ns/NS_Tests.sns.cfg
index 23b616b..5ee5e1a 100644
--- a/ns/NS_Tests.sns.cfg
+++ b/ns/NS_Tests.sns.cfg
@@ -21,6 +21,18 @@
 				}
 			},
 			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 f69bbe0..58b2dda 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -44,6 +44,20 @@
 					}
 				},
 				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 @@
 	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 @@
 	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 @@
 		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 58d306e..b342305 100644
--- a/ns/osmo-ns.sns.cfg
+++ b/ns/osmo-ns.sns.cfg
@@ -92,6 +92,10 @@
   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

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24402
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I98c04c083521ab38b58e8df9f1aee89445ab536d
Gerrit-Change-Number: 24402
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210525/8befc1b1/attachment.htm>


More information about the gerrit-log mailing list