pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40644?usp=email )
Change subject: sgsn: Introduce test TC_stat_rnc_sctp_disconnected
......................................................................
sgsn: Introduce test TC_stat_rnc_sctp_disconnected
The commit doesn't validate everything it should, because passing the
indication from osmo-iuh's iu_client to app (osmo-sgsn) is not
supported in current API, and hence the statsd metrics are not yet
implemented in osmo-sgsn.
Still, this test already validates that osmo-sgsn is capable of
surviving an sctp link down event in IuPS, and continue to work
afterwards. IT also allows easily debugging this scenario by inspecting
pcap files, logs, etc.
Related: OS#5917
Change-Id: I35888630ea9e9005e1252677c5d42f66f84e177b
---
M sgsn/SGSN_Tests.default
M sgsn/SGSN_Tests.ttcn
M sgsn/SGSN_Tests_Iu.ttcn
M sgsn/expected-results.xml
4 files changed, 78 insertions(+), 1 deletion(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/sgsn/SGSN_Tests.default b/sgsn/SGSN_Tests.default
index e44e234..f8d3e46 100644
--- a/sgsn/SGSN_Tests.default
+++ b/sgsn/SGSN_Tests.default
@@ -17,6 +17,15 @@
*.SGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes"
*.SGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes"
*.SGSNVTY.PROMPT1 := "OsmoSGSN> "
+*.STPVTY.CTRL_MODE := "client"
+*.STPVTY.CTRL_HOSTNAME := "127.0.0.1"
+*.STPVTY.CTRL_PORTNUM := "4239"
+*.STPVTY.CTRL_LOGIN_SKIPPED := "yes"
+*.STPVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes"
+*.STPVTY.CTRL_READMODE := "buffered"
+*.STPVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes"
+*.STPVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes"
+*.STPVTY.PROMPT1 := "OsmoSTP> "
[MODULE_PARAMETERS]
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index b2d9731..d5f98ce 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -192,6 +192,7 @@
var GTP_Emulation_CT vc_GGSN_GTP;
port TELNETasp_PT SGSNVTY;
+ port TELNETasp_PT STPVTY;
var boolean g_initialized := false;
var boolean g_use_echo := false;
@@ -311,6 +312,26 @@
f_vty_config(SGSNVTY, "sgsn", "auth-policy remote");
}
+friend function f_init_vty_stp() runs on test_CT {
+ if (STPVTY.checkstate("Mapped")) {
+ /* skip initialization if already executed once */
+ return;
+ }
+ map(self:STPVTY, system:STPVTY);
+ f_vty_set_prompts(STPVTY, prompt_prefix := "OsmoSTP");
+ f_vty_transceive(STPVTY, "enable");
+}
+
+friend function f_vty_stp_sgsn_asp_cmd(charstring cmd) runs on test_CT
+{
+ var charstring asp_name := "sgsn0-0";
+ var charstring loc_port := int2str(1905);
+ var charstring rem_port := int2str(2905);
+ var charstring asp_proto := "m3ua";
+ var charstring asp_node := "asp " & asp_name & " " & loc_port & " " & rem_port & " " & asp_proto;
+ f_vty_config2(STPVTY, {"cs7 instance 0", asp_node}, cmd);
+}
+
private function f_vty_enable_echo_interval(boolean enable) runs on test_CT {
if (enable) {
f_vty_config(SGSNVTY, "sgsn", "ggsn 0 echo-interval " & int2str(mp_echo_interval));
diff --git a/sgsn/SGSN_Tests_Iu.ttcn b/sgsn/SGSN_Tests_Iu.ttcn
index 53a1080..3de89b6 100644
--- a/sgsn/SGSN_Tests_Iu.ttcn
+++ b/sgsn/SGSN_Tests_Iu.ttcn
@@ -416,6 +416,45 @@
f_cleanup();
}
+/* When the last local IPA/SCTP link/ASP is terminated, last AS goes inactive
+ * and a SCCP N-PCSTATE.ind (unavailable) should arrive to upper layers.
+ * As a result, osmo-sgsn should immediately mark the RNC as unusable.
+ * In AoIP, the SCCP N-PCSTATE is triggered by instructing the STP to
+ * shutdown the ASP serving the SGSN, which will close the SCTP assoc between
+ * itself and IUT (SGSN), which should then generate an N-PCSTATE.ind.
+ */
+/* TODO: OS#5917: Once we get rid of iu_client layer and handle SCCP SAP
+ * directly in osmo-sgsn, we'll be able to track IuPS status (eg RESET FSM) like
+ * we do in osmo-msc. Once that's in place we can add stats metrics to figure
+ * out connection status and use them here.
+ * See as a reference for improvement: MSC_Tests.TC_stat_rnc_sctp_disconnected
+ */
+testcase TC_stat_rnc_sctp_disconnected() runs on test_CT {
+ var BSSGP_ConnHdlr vc_conn;
+
+ f_init();
+ f_init_vty_stp();
+ f_sleep(1.0);
+ f_vty_config(SGSNVTY, "sgsn", "encryption uea 0");
+
+ vc_conn := f_start_handler(refers(f_TC_iu_attach), testcasename(), g_gb, 1008);
+ vc_conn.done;
+
+ f_logp(SGSNVTY, "Shutting down SGSN ASP in STP");
+ f_vty_stp_sgsn_asp_cmd("shutdown");
+
+ /* Wait for AS PENDING->INACTIVE transition (T(r) timeout after 2000msec): */
+ f_sleep(3.0);
+
+ f_logp(SGSNVTY, "Restarting SGSN ASP in STP");
+ f_vty_stp_sgsn_asp_cmd("no shutdown");
+
+ f_sleep(15.0);
+
+ vc_conn := f_start_handler(refers(f_TC_iu_attach), testcasename(), g_gb, 1009);
+ vc_conn.done;
+ f_cleanup();
+}
control {
execute( TC_iu_attach() );
execute( TC_iu_attach_encr() );
@@ -429,6 +468,13 @@
execute( TC_attach_pdp_act_pmm_idle() );
execute( TC_pmm_idle_rx_mt_data() );
execute( TC_update_ctx_err_ind_from_ggsn() );
+
+ /* This "nightly" if can be removed once libosmo-sigtran (osmo-stp) > 2.1.0 is released.
+ * Currently released osmo-stp 2.1.0 ends up in in broken AS-ACTIVE+ASP-DOWN state when
+ * restarting the ASP after exiting the related asp node through VTY: */
+ if (Misc_Helpers.f_osmo_repo_is("nightly")) {
+ execute( TC_stat_rnc_sctp_disconnected() );
+ }
}
diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml
index bdd0f29..e2e099b 100644
--- a/sgsn/expected-results.xml
+++ b/sgsn/expected-results.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<testsuite name='Titan' tests='74' failures='4' errors='0' skipped='0' inconc='0' time='MASKED'>
+<testsuite name='Titan' tests='75' failures='4' errors='0' skipped='0' inconc='0' time='MASKED'>
<testcase classname='SGSN_Tests' name='TC_attach' time='MASKED'/>
<testcase classname='SGSN_Tests' name='TC_attach_mnc3' time='MASKED'/>
<testcase classname='SGSN_Tests' name='TC_attach_umts_aka_umts_res' time='MASKED'/>
@@ -101,6 +101,7 @@
<testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_pmm_idle_lost_pdp_status' time='MASKED'/>
<testcase classname='SGSN_Tests_Iu' name='TC_pmm_idle_rx_mt_data' time='MASKED'/>
<testcase classname='SGSN_Tests_Iu' name='TC_update_ctx_err_ind_from_ggsn' time='MASKED'/>
+ <testcase classname='SGSN_Tests_Iu' name='TC_stat_rnc_sctp_disconnected' time='MASKED'/>
<!-- SGSN_Tests_NS (handle_sns == true) testcases start here -->
<testcase classname='SGSN_Tests_NS' name='TC_SNS_size' time='MASKED'/>
<testcase classname='SGSN_Tests_NS' name='TC_SNS_size_too_big' time='MASKED'/>
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40644?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I35888630ea9e9005e1252677c5d42f66f84e177b
Gerrit-Change-Number: 40644
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: lynxis lazus <lynxis(a)fe80.eu>
Attention is currently required from: fixeria, laforge, neels.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-msc/+/40632?usp=email )
Change subject: ran_peer: Add specific API to free object
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
I still think the code is better after this patch, but since it seem to cause controversy and I don't plan to touch more this code soon, I'm simply abandoning this patch to avoid spending time in discussions.
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/40632?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I721de21a68a4e336ae508a995e3cfcca05d57efe
Gerrit-Change-Number: 40632
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 14 Jul 2025 16:59:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: fixeria, laforge, neels.
Hello Jenkins Builder, fixeria, laforge, neels,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-msc/+/40633?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Code-Review+2 by fixeria, Code-Review-1 by neels, Verified+1 by Jenkins Builder
The change is no longer submittable: Code-Review and Verified are unsatisfied now.
Change subject: ran_peer: Introduce stats msc.ran_peers.{total,active}
......................................................................
ran_peer: Introduce stats msc.ran_peers.{total,active}
Change-Id: I36e40510c9a95f0c9cf5f32d2a7baab840aa8660
---
M include/osmocom/msc/gsm_data.h
M src/libmsc/ran_peer.c
2 files changed, 34 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/33/40633/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/40633?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I36e40510c9a95f0c9cf5f32d2a7baab840aa8660
Gerrit-Change-Number: 40633
Gerrit-PatchSet: 5
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria, laforge, neels, osmith, pespin.
Hello Jenkins Builder, fixeria, neels, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-msc/+/40630?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Code-Review+1 by fixeria, Code-Review+1 by neels, Code-Review+2 by pespin, Verified+1 by Jenkins Builder
The change is no longer submittable: Code-Review and Verified are unsatisfied now.
Change subject: msc: Initial implementation of N-PCSTATE.ind
......................................................................
msc: Initial implementation of N-PCSTATE.ind
Related: OS#5917
Change-Id: Ice1b2c163b1b0d134fcaa1c8bf543038a35fabdf
---
M include/osmocom/msc/ran_peer.h
M src/libmsc/ran_peer.c
M src/libmsc/sccp_ran.c
3 files changed, 158 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/30/40630/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/40630?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ice1b2c163b1b0d134fcaa1c8bf543038a35fabdf
Gerrit-Change-Number: 40630
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria, laforge, neels.
Hello Jenkins Builder, fixeria, laforge, neels,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-msc/+/40631?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Code-Review-1 by neels, Verified+1 by Jenkins Builder
Change subject: ran_peer: Avoid paging attempt if not ready
......................................................................
ran_peer: Avoid paging attempt if not ready
If the link is not ready it will fail to transmit the msg anyway,
so there's no use in trying to submit a page over it.
Change-Id: Ia858291f4454e4caf293e1aaf60ea04d2d4a64e9
---
M src/libmsc/ran_peer.c
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/31/40631/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/40631?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ia858291f4454e4caf293e1aaf60ea04d2d4a64e9
Gerrit-Change-Number: 40631
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>