gbproxy: Fix pooling expectations of TC_bvc_reset_*_from_bss

With pooling enabled these tests now need to verify that the reset/block
is propagated to all SGSNs in the pool.

Change-Id: I34ed4bffce564dbaf08f9388bd5247351dd0725e
Fixes: OS#4964
This commit is contained in:
Daniel Willmann 2021-01-21 18:11:12 +01:00
parent 388057da54
commit c38c85d474
1 changed files with 61 additions and 16 deletions

View File

@ -342,6 +342,7 @@ type component test_CT {
var boolean g_use_echo := false;
var ro_integer g_roi := {};
var roro_integer g_roroi := {};
timer g_Tguard;
};
@ -2464,7 +2465,14 @@ testcase TC_bvc_unblock_ptp() runs on test_CT
/***********************************************************************
* BVC-RESET procedure
***********************************************************************/
private altstep as_count_bvc_reset(integer sgsn_idx, BssgpBvci bvci, inout roro_integer roroi)
runs on test_CT {
var BSSGP_BVC_CT sgsn_bvc_ct := f_get_sgsn_bvc_ct(sgsn_idx, bvci);
[] SGSN_MGMT.receive(BssgpResetIndication:{bvci}) from sgsn_bvc_ct {
roroi[sgsn_idx] := roroi[sgsn_idx] & { bvci };
repeat;
}
}
private altstep as_ignore_status(BSSGP_BVC_MGMT_PT pt) {
[] pt.receive(BssgpStatusIndication:?) { repeat; }
}
@ -2481,22 +2489,51 @@ private function f_reset_ptp_bvc_from_pcu(integer pcu_idx, integer bvc_idx) runs
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;
var ro_default defaults;
var integer i;
SGSN_MGMT.clear;
PCU_MGMT.clear;
for (i := 0; i < lengthof(mp_nsconfig_sgsn); i := i+1) {
g_roroi[i] := {};
}
/* 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;
defaults := { activate(as_ignore_status(SGSN_MGMT)) };
/* Activate altsteps: One for each SGSN */
for (i := 0; i < lengthof(g_sgsn); i := i+1) {
var default d := activate(as_count_bvc_reset(i, bvc_cfg.bvci, g_roroi));
defaults := defaults & { d };
}
deactivate(d);
timer T := 3.0;
T.start;
alt {
[] PCU_MGMT.receive(tr_BssgpStsInd(nsei_pcu, bvc_cfg.bvci, BVC_S_BLOCKED)) from pcu_bvc_ct {
g_roi := g_roi & { bvc_cfg.bvci };
repeat;
}
[] T.timeout;
}
for (i := 0; i < lengthof(defaults); i := i+1) {
deactivate(defaults[i]);
}
/* Check if BVC-RESET was received at all SGSNs */
for (i := 0; i < lengthof(g_sgsn); i := i+1) {
if (not ro_integer_contains(g_roroi[i], bvc_cfg.bvci)) {
setverdict(fail, "Missing SGSN[", i, "] BVC-BLOCK of BVCI=", bvc_cfg.bvci);
}
}
setverdict(pass);
f_cleanup();
}
/* 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
@ -2507,11 +2544,11 @@ testcase TC_bvc_reset_ptp_from_bss() runs on test_CT
f_cleanup();
}
private altstep as_count_bvc_block(integer sgsn_idx, BssgpBvci bvci, inout ro_integer roi)
private altstep as_count_bvc_block(integer sgsn_idx, BssgpBvci bvci, inout roro_integer roroi)
runs on test_CT {
var BSSGP_BVC_CT sgsn_bvc_ct := f_get_sgsn_bvc_ct(sgsn_idx, bvci);
[] SGSN_MGMT.receive(tr_BssgpStsInd(?, bvci, BVC_S_BLOCKED)) from sgsn_bvc_ct {
roi := roi & { bvci };
roroi[sgsn_idx] := roroi[sgsn_idx] & { bvci };
repeat;
}
}
@ -2521,15 +2558,21 @@ testcase TC_bvc_reset_sig_from_bss() runs on test_CT {
f_init();
f_sleep(3.0);
for (var integer i := 0; i < lengthof(mp_nsconfig_sgsn); i := i+1) {
g_roroi[i] := {};
}
/* Start BVC-RESET procedure for BVCI=0 */
PCU_MGMT.send(BssgpResetRequest:{cause:=BSSGP_CAUSE_OM_INTERVENTION}) to g_pcu[0].vc_BSSGP;
/* Activate altsteps: One for each PTP BVC within that PCUs NSE */
/* Activate altsteps: One for each PTP BVC and SGSN within that PCUs NSE */
var ro_default defaults := {};
for (var integer i := 0; i < lengthof(g_pcu[0].cfg.bvc); i := i+1) {
var BssgpBvcConfig bvcc := g_pcu[0].cfg.bvc[i];
var default d := activate(as_count_bvc_block(0, bvcc.bvci, g_roi));
defaults := defaults & { d };
for (var integer j := 0; j < lengthof(g_sgsn); j := j+1) {
var default d := activate(as_count_bvc_block(j, bvcc.bvci, g_roroi));
defaults := defaults & { d };
}
}
timer T := 3.0;
@ -2545,11 +2588,13 @@ testcase TC_bvc_reset_sig_from_bss() runs on test_CT {
deactivate(defaults[i]);
}
/* check if BVC-block was received on all expected BVC */
/* check if BVC-block was received on all expected BVC/SGSN */
for (var integer i := 0; i < lengthof(g_pcu[0].cfg.bvc); i := i+1) {
var BssgpBvcConfig bvcc := g_pcu[0].cfg.bvc[i];
if (not ro_integer_contains(g_roi, bvcc.bvci)) {
setverdict(fail, "Missing SGSN-side BVC-BLOCK of BVCI=", bvcc.bvci);
for (var integer j := 0; j < lengthof(g_sgsn); j := j+1) {
if (not ro_integer_contains(g_roroi[j], bvcc.bvci)) {
setverdict(fail, "Missing SGSN[", j, "] BVC-BLOCK of BVCI=", bvcc.bvci);
}
}
}