diff options
author | Harald Welte <laforge@osmocom.org> | 2020-11-25 17:12:53 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-11-27 19:18:23 +0100 |
commit | 60a8ec7a4f99fbad9a5e75d71babf870686b1a25 (patch) | |
tree | 6d3d74d63638d044beb10ef31942478180a18bff | |
parent | 3c90515272695e82e3de92e9d14b2493b71b9abd (diff) |
gbproxy: Add TC_bvc_reset_ptp_from_{bss,sgsn}
This tests BSS-originated and SGSN-originated BVC-RESET procedure of a PTP BVC.
Change-Id: Ie0a4899b6e793e3d69f117f350c5a2542fc4d402
-rw-r--r-- | gbproxy/GBProxy_Tests.ttcn | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn index 78eb3896..064d1ea4 100644 --- a/gbproxy/GBProxy_Tests.ttcn +++ b/gbproxy/GBProxy_Tests.ttcn @@ -1891,6 +1891,79 @@ testcase TC_bvc_unblock_ptp() runs on test_CT f_cleanup(); } +private altstep as_ignore_status(BSSGP_BVC_MGMT_PT pt) { +[] pt.receive(BssgpStatusIndication:?) { repeat; } +} +private function f_get_sgsn_bvc_ct(integer sgsn_idx, BssgpBvci bvci) runs on test_CT return BSSGP_BVC_CT { + for (var integer i := 0; i < lengthof(g_sgsn[sgsn_idx].cfg.bvc); i := i+1) { + if (g_sgsn[sgsn_idx].cfg.bvc[i].bvci == bvci) { + return g_sgsn[sgsn_idx].vc_BSSGP_BVC[i]; + } + } + return null; +} +private function f_reset_ptp_bvc_from_pcu(integer pcu_idx, integer bvc_idx) runs on test_CT +{ + var BSSGP_BVC_CT pcu_bvc_ct := g_pcu[pcu_idx].vc_BSSGP_BVC[bvc_idx]; + var BssgpBvcConfig bvc_cfg := g_pcu[pcu_idx].cfg.bvc[bvc_idx]; + var Nsei nsei_pcu := g_pcu[pcu_idx].cfg.nsei; + var BSSGP_BVC_CT sgsn_bvc_ct := f_get_sgsn_bvc_ct(0, bvc_cfg.bvci); + var default d; + + SGSN_MGMT.clear; + PCU_MGMT.clear; + + /* block the PTP BVC from the PCU side */ + PCU_MGMT.send(BssgpResetRequest:{cause:=BSSGP_CAUSE_OM_INTERVENTION}) to pcu_bvc_ct; + /* expect state on both PCU and SGSN side to change */ + d := activate(as_ignore_status(SGSN_MGMT)); + interleave { + [] PCU_MGMT.receive(tr_BssgpStsInd(nsei_pcu, bvc_cfg.bvci, BVC_S_BLOCKED)) from pcu_bvc_ct; + [] SGSN_MGMT.receive(BssgpResetIndication:{bvc_cfg.bvci}) from sgsn_bvc_ct; + } + deactivate(d); + setverdict(pass); +} +/* Send a BVC-RESET for a PTP BVC from the BSS side: expect it to propagate */ +testcase TC_bvc_reset_ptp_from_bss() runs on test_CT +{ + f_init(); + f_sleep(3.0); + f_reset_ptp_bvc_from_pcu(0, 0); + f_cleanup(); +} + +private function f_reset_ptp_bvc_from_sgsn(integer pcu_idx, integer bvc_idx) runs on test_CT +{ + var BSSGP_BVC_CT pcu_bvc_ct := g_pcu[pcu_idx].vc_BSSGP_BVC[bvc_idx]; + var BssgpBvcConfig bvc_cfg := g_pcu[pcu_idx].cfg.bvc[bvc_idx]; + var Nsei nsei_pcu := g_pcu[pcu_idx].cfg.nsei; + var BSSGP_BVC_CT sgsn_bvc_ct := f_get_sgsn_bvc_ct(0, bvc_cfg.bvci); + var default d; + + SGSN_MGMT.clear; + PCU_MGMT.clear; + + /* block the PTP BVC from the PCU side */ + SGSN_MGMT.send(BssgpResetRequest:{cause:=BSSGP_CAUSE_OM_INTERVENTION}) to sgsn_bvc_ct; + /* expect state on both PCU and SGSN side to change */ + d := activate(as_ignore_status(PCU_MGMT)); + interleave { + [] SGSN_MGMT.receive(tr_BssgpStsInd(?, bvc_cfg.bvci, BVC_S_BLOCKED)) from sgsn_bvc_ct; + [] PCU_MGMT.receive(BssgpResetIndication:{bvc_cfg.bvci}) from pcu_bvc_ct; + } + deactivate(d); + setverdict(pass); +} +/* Send a BVC-RESET for a PTP BVC from the SGSN side: expect it to propagate */ +testcase TC_bvc_reset_ptp_from_sgsn() runs on test_CT +{ + f_init(); + f_sleep(3.0); + f_reset_ptp_bvc_from_sgsn(0, 0); + f_cleanup(); +} + control { execute( TC_BVC_bringup() ); execute( TC_ul_unitdata() ); @@ -1902,6 +1975,8 @@ control { execute( TC_resume() ); execute( TC_bvc_block_ptp() ); execute( TC_bvc_unblock_ptp() ); + execute( TC_bvc_reset_ptp_from_bss() ); + execute( TC_bvc_reset_ptp_from_sgsn() ); if (false) { /* don't enable this by default, as we don't yet have any automatic test setup for FR with 4 NS-VC */ execute( TC_load_sharing_dl() ); |