gbproxy: Add TC_bvc_{block,unblock}_ptp()

Test the blocking and unblocking procedure, indirectly via the BSSGP
emulation sending us the related primitives on both PCU and SGSN side.

Change-Id: Ia2fe867435678cbde44cac2addcaddd174507446
This commit is contained in:
Harald Welte 2020-11-24 23:14:20 +01:00
parent ddfc6676d5
commit 239aa50e8c
1 changed files with 56 additions and 0 deletions

View File

@ -1834,6 +1834,60 @@ testcase TC_flush_ll() runs on test_CT
f_cleanup(); f_cleanup();
} }
private function f_block_ptp_bvc_from_pcu(integer pcu_idx, integer bvc_idx) runs on test_CT
{
var BSSGP_BVC_CT 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;
SGSN_MGMT.clear;
PCU_MGMT.clear;
/* block the PTP BVC from the PCU side */
PCU_MGMT.send(BssgpBlockRequest:{cause:=BSSGP_CAUSE_OM_INTERVENTION}) to bvc_ct;
/* expect state on both PCU and SGSN side to change */
interleave {
[] PCU_MGMT.receive(tr_BssgpStsInd(nsei_pcu, bvc_cfg.bvci, BVC_S_BLOCKED)) from bvc_ct;
[] SGSN_MGMT.receive(tr_BssgpStsInd(*, bvc_cfg.bvci, BVC_S_BLOCKED));
}
setverdict(pass);
}
testcase TC_bvc_block_ptp() runs on test_CT
{
f_init();
f_sleep(1.0);
f_block_ptp_bvc_from_pcu(0, 0);
f_cleanup();
}
private function f_unblock_ptp_bvc_from_pcu(integer pcu_idx, integer bvc_idx) runs on test_CT
{
var BSSGP_BVC_CT 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;
SGSN_MGMT.clear;
PCU_MGMT.clear;
/* block the PTP BVC from the PCU side */
PCU_MGMT.send(BssgpUnblockRequest:{}) to bvc_ct;
/* expect state on both PCU and SGSN side to change */
interleave {
[] PCU_MGMT.receive(tr_BssgpStsInd(nsei_pcu, bvc_cfg.bvci, BVC_S_UNBLOCKED)) from bvc_ct;
[] SGSN_MGMT.receive(tr_BssgpStsInd(*, bvc_cfg.bvci, BVC_S_UNBLOCKED));
}
setverdict(pass);
}
testcase TC_bvc_unblock_ptp() runs on test_CT
{
f_init();
f_sleep(1.0);
f_block_ptp_bvc_from_pcu(0, 0);
f_sleep(1.0);
f_unblock_ptp_bvc_from_pcu(0, 0);
f_cleanup();
}
control { control {
execute( TC_BVC_bringup() ); execute( TC_BVC_bringup() );
execute( TC_ul_unitdata() ); execute( TC_ul_unitdata() );
@ -1843,6 +1897,8 @@ control {
execute( TC_radio_status() ); execute( TC_radio_status() );
execute( TC_suspend() ); execute( TC_suspend() );
execute( TC_resume() ); execute( TC_resume() );
execute( TC_bvc_block_ptp() );
execute( TC_bvc_unblock_ptp() );
if (false) { if (false) {
/* don't enable this by default, as we don't yet have any automatic test setup for FR with 4 NS-VC */ /* 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() ); execute( TC_load_sharing_dl() );