Change in osmo-ttcn3-hacks[master]: SGSN: introduce NS tests

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
Mon Sep 7 04:13:05 UTC 2020


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


Change subject: SGSN: introduce NS tests
......................................................................

SGSN: introduce NS tests

Similiar to the PCU_Tests_NS introduce SGSN_Tests_NS.

Change-Id: Ib2bffbb110961474928f35d212cb492d4b6fdee0
---
M sgsn/SGSN_Tests.ttcn
A sgsn/SGSN_Tests_NS.cfg
A sgsn/SGSN_Tests_NS.ttcn
M sgsn/gen_links.sh
4 files changed, 98 insertions(+), 1 deletion(-)



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

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 0e656a3..de00fa0 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -12,6 +12,7 @@
  */
 
 friend module SGSN_Tests_Iu;
+friend module SGSN_Tests_NS;
 
 import from General_Types all;
 import from Osmocom_Types all;
@@ -255,7 +256,7 @@
 	vc_GTP.start(GTP_Emulation.main(gtp_cfg));
 }
 
-private function f_init_vty() runs on test_CT {
+friend function f_init_vty() runs on test_CT {
 	map(self:SGSNVTY, system:SGSNVTY);
 	f_vty_set_prompts(SGSNVTY);
 	f_vty_transceive(SGSNVTY, "enable");
diff --git a/sgsn/SGSN_Tests_NS.cfg b/sgsn/SGSN_Tests_NS.cfg
new file mode 100644
index 0000000..79ee0b2
--- /dev/null
+++ b/sgsn/SGSN_Tests_NS.cfg
@@ -0,0 +1,34 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+# testsuite specific configuration, not expected to change
+"./SGSN_Tests.default"
+
+# Local configuration below
+
+[LOGGING]
+
+[TESTPORT_PARAMETERS]
+*.SGSNVTY.CTRL_HOSTNAME := "127.0.0.10"
+
+[MODULE_PARAMETERS]
+SGSN_Components.mp_nsconfig := {
+	local_ip := "127.0.0.103",
+	local_udp_port := 22000,
+	remote_ip := "127.0.0.10",
+	remote_udp_port := 23000,
+	nsvci := 1234,
+	nsei := 1234
+}
+SGSN_Tests.mp_ranap_cfg := {
+	{
+		sctp_addr := { 23908, "127.0.0.103", 2905, "127.0.0.200" }
+	}
+}
+SGSN_Tests.mp_hlr_ip := "127.0.0.103"
+SGSN_Tests.mp_ggsn_ip := "127.0.0.103"
+
+[MAIN_CONTROLLER]
+
+[EXECUTE]
+SGSN_Tests_NS.control
diff --git a/sgsn/SGSN_Tests_NS.ttcn b/sgsn/SGSN_Tests_NS.ttcn
new file mode 100644
index 0000000..376245f
--- /dev/null
+++ b/sgsn/SGSN_Tests_NS.ttcn
@@ -0,0 +1,58 @@
+module SGSN_Tests_NS {
+
+/* Osmocom SGSN test suite in TTCN-3
+ * (C) 2020 sysmocom - s.f.m.c. GmbH
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+import from Osmocom_Types all;
+import from Osmocom_Gb_Types all;
+import from Osmocom_VTY_Functions all;
+import from NS_CodecPort all;
+import from NS_Types all;
+import from RAW_NS all;
+import from SGSN_Tests all;
+
+type component RAW_Test_CT extends RAW_NS_CT, test_CT {
+}
+
+testcase TC_NS_connect_reset() runs on RAW_Test_CT {
+	f_init_vty();
+	f_init_ns_codec(guard_secs := 10.0);
+	f_vty_config(SGSNVTY, "ns", "encapsulation udp use-reset-block-unblock enabled");
+
+	/* Send a NS-ALIVE */
+	f_outgoing_ns_reset();
+
+	f_sleep(1.0);
+	f_cleanup();
+}
+
+testcase TC_NS_connect_alive() runs on RAW_Test_CT {
+	f_init_vty();
+	f_init_ns_codec(guard_secs := 10.0);
+	f_vty_config(SGSNVTY, "ns", "encapsulation udp use-reset-block-unblock disabled");
+
+	/* Send a NS-ALIVE */
+	NSCP[0].send(t_NS_Send(g_ns_conn_id[0], t_NS_ALIVE));
+	alt {
+	[] NSCP[0].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK));
+	[] NSCP[0].receive(t_NS_RecvFrom(tr_NS_STATUS(*))) { setverdict(fail); }
+	[] NSCP[0].receive { repeat; }
+	}
+
+	f_sleep(1.0);
+	f_cleanup();
+}
+
+control {
+	execute( TC_NS_connect_alive() );
+	execute( TC_NS_connect_reset() );
+}
+
+}
diff --git a/sgsn/gen_links.sh b/sgsn/gen_links.sh
index bd3a7ea..2a7829b 100755
--- a/sgsn/gen_links.sh
+++ b/sgsn/gen_links.sh
@@ -96,4 +96,8 @@
 GTP_Templates.ttcn IPCP_Types.ttcn "
 gen_links $DIR $FILES
 
+DIR=../pcu
+FILES="RAW_NS.ttcn SGSN_Components.ttcn GPRS_Context.ttcn "
+gen_links $DIR $FILES
+
 ignore_pp_results

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20008
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: Ib2bffbb110961474928f35d212cb492d4b6fdee0
Gerrit-Change-Number: 20008
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/20200907/08114879/attachment.htm>


More information about the gerrit-log mailing list