gbproxy: Test routing if an SGSN in a pool is down

If an SGSN in a pool is down we expect the messages to instead be sent
to a different SGSN in the pool. That SGSN will not necessarily know
what to do with those messages, but it should )implicitly) detach that
UE so that it can reattach at the new SGSN. Otherwise UEs on a failed
SGSN would simply stop working as the messages would never be forwarded

This test also adjusts the NS timers so the failed NSVCs are detected

Change-Id: I46a6b8082441843f428a7681566228e5de375bcb
Related: OS#4952
This commit is contained in:
Daniel Willmann 2021-05-28 15:05:41 +02:00
parent 48483ce335
commit 8d9fcf4461
2 changed files with 53 additions and 3 deletions

View File

@ -337,6 +337,8 @@ type component test_CT extends CTRL_Adapter_CT {
var GbInstances g_pcu;
var GbInstances g_sgsn;
@ -1130,6 +1132,53 @@ testcase TC_ul_unitdata() runs on test_CT
/* send uplink-unitdata of a variety of different sizes; expect it to show up on the only connected SGSN */
private function f_TC_ul_unitdata_pool_failure(charstring id) runs on BSSGP_ConnHdlr {
var integer ran_idx := 0;
var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0];
var integer i;
/* All data should arrive at the one SGSN that is still up */
g_pars.sgsn_idx := 0;
for (i := 0; i < max_fr_info_size-4; i := i+4) {
var octetstring payload := f_rnd_octstring(i);
var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload);
/* we cannot use pdu_tx as there are some subtle differences in the length field :/ */
var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload);
log("UL-UNITDATA(payload_size=", i);
f_pcu2sgsn(pdu_tx, pdu_rx);
testcase TC_ul_unitdata_pool_failure() runs on test_CT
var integer i;
var integer j;
for (i := 1; i < lengthof(mp_nsconfig_sgsn); i := i+1) {
connect(self:NS_CTRL, g_sgsn[i].vc_NS:NS_CTRL);
for (j := 0; j < lengthof(mp_nsconfig_sgsn[i].nsvc); j := j+1) {
var uint16_t nsvci := mp_nsconfig_sgsn[i].nsvc[j].nsvci;
var NsDisableVcRequest tx_disar;
tx_disar.nsvci := nsvci;
disconnect(self:NS_CTRL, g_sgsn[i].vc_NS:NS_CTRL);
/* Wait until gbproxy notices that the NSVCs are down */
f_start_handlers(refers(f_TC_ul_unitdata_pool_failure), testcasename(), 1);
/* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */
/* send downlink-unitdata of a variety of different sizes; expect it to show up on PCU */
private function f_TC_dl_unitdata(charstring id) runs on BSSGP_ConnHdlr {
var integer i;
@ -3461,6 +3510,7 @@ testcase TC_status_ptp_dl_bvci() runs on GlobalTest_CT
control {
execute( TC_BVC_bringup() );
execute( TC_ul_unitdata() );
execute( TC_ul_unitdata_pool_failure() );
execute( TC_dl_unitdata() );
execute( TC_ra_capability() );
execute( TC_ra_capability_upd() );

View File

@ -42,6 +42,6 @@ ns
timer tns-block-retries 3
timer tns-reset 3
timer tns-reset-retries 3
timer tns-test 30
timer tns-alive 3
timer tns-alive-retries 10
timer tns-test 5
timer tns-alive 2
timer tns-alive-retries 3