pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40992?usp=email )
Change subject: sgsn: TC_stat_bsc_sctp_disconnected: validate using StatsD ...................................................................... sgsn: TC_stat_bsc_sctp_disconnected: validate using StatsD Similar to what we alreay do in counterpart MSC_Tests_iu.TC_stat_bsc_sctp_disconnected. Related: OS#3403 Depends: osmo-sgsn.git Change-Id I51b5227d92027f1251dc4debbbf59737e7c1a9ba Change-Id: I1ff8c51a73556357c5a5e97bc2a0edec30f1cf03 --- M sgsn/SGSN_Tests.ttcn M sgsn/SGSN_Tests_Iu.ttcn 2 files changed, 32 insertions(+), 2 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified lynxis lazus: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 1b339cf..7364dc4 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -566,6 +566,11 @@ return vc_conn; } +friend function f_sgsn_stats_prefix() return charstring +{ + return mp_statsd_prefix & "sgsn.0."; +} + /* TODO: * Detach without Attach * SM procedures without attach / RAU diff --git a/sgsn/SGSN_Tests_Iu.ttcn b/sgsn/SGSN_Tests_Iu.ttcn index 6e8b5b6..71c20ef 100644 --- a/sgsn/SGSN_Tests_Iu.ttcn +++ b/sgsn/SGSN_Tests_Iu.ttcn @@ -4,6 +4,11 @@ import from Osmocom_VTY_Functions all; import from Misc_Helpers all; +import from StatsD_Types all; +import from StatsD_CodecPort all; +import from StatsD_CodecPort_CtrlFunct all; +import from StatsD_Checker all; + import from SGSN_Tests all; import from BSSGP_Emulation all; @@ -432,12 +437,28 @@ */ testcase TC_stat_rnc_sctp_disconnected() runs on test_CT { var BSSGP_ConnHdlr vc_conn; + var charstring sgsn_stats_prefix := f_sgsn_stats_prefix(); + var StatsDExpects expect_connected := { + {name := sgsn_stats_prefix & "iu_peers.total", mtype := "g", min := 1, max := 1}, + {name := sgsn_stats_prefix & "iu_peers.active", mtype := "g", min := 1, max := 1} + }; + var StatsDExpects expect_disconnected := { + {name := sgsn_stats_prefix & "iu_peers.total", mtype := "g", min := 1, max := 1}, + {name := sgsn_stats_prefix & "iu_peers.active", mtype := "g", min := 0, max := 0} + }; + + g_statd_timeout := 15.0; f_init(); f_init_vty_stp(); f_sleep(1.0); f_vty_config(SGSNVTY, "sgsn", "encryption uea 0"); + connect(self:STATSD_PROC, vc_STATSD:STATSD_PROC); + f_statsd_reset(); + f_statsd_expect(expect_connected, wait_converge := true); + disconnect(self:STATSD_PROC, vc_STATSD:STATSD_PROC); + vc_conn := f_start_handler(refers(f_TC_iu_attach), testcasename(), g_gb, 1008); vc_conn.done; @@ -445,12 +466,16 @@ f_vty_stp_sgsn_asp_cmd("shutdown"); /* Wait for AS PENDING->INACTIVE transition (T(r) timeout after 2000msec): */ - f_sleep(3.0); + connect(self:STATSD_PROC, vc_STATSD:STATSD_PROC); + f_statsd_expect(expect_disconnected, wait_converge := true); + disconnect(self:STATSD_PROC, vc_STATSD:STATSD_PROC); f_logp(SGSNVTY, "Restarting SGSN ASP in STP"); f_vty_stp_sgsn_asp_cmd("no shutdown"); - f_sleep(15.0); + connect(self:STATSD_PROC, vc_STATSD:STATSD_PROC); + f_statsd_expect(expect_connected, wait_converge := true); + disconnect(self:STATSD_PROC, vc_STATSD:STATSD_PROC); vc_conn := f_start_handler(refers(f_TC_iu_attach), testcasename(), g_gb, 1009); vc_conn.done; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40992?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: I1ff8c51a73556357c5a5e97bc2a0edec30f1cf03 Gerrit-Change-Number: 40992 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pes...@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de> Gerrit-Reviewer: lynxis lazus <lyn...@fe80.eu> Gerrit-Reviewer: osmith <osm...@sysmocom.de> Gerrit-Reviewer: pespin <pes...@sysmocom.de>