gbproxy: Test for SGSN-INVOKE-TRACE

Change-Id: I1e46e5c403712eb7972c57e6b6f6eb0850b96ae3
This commit is contained in:
Harald Welte 2020-11-27 22:37:23 +01:00
parent 16786e9364
commit f8e5c5dfc7
3 changed files with 96 additions and 2 deletions

View File

@ -1841,6 +1841,46 @@ testcase TC_flush_ll() runs on test_CT
f_cleanup();
}
private altstep as_bssgp_g_pcu_count(integer pcu_idx, template (present) PDU_BSSGP exp_rx, inout ro_integer roi)
runs on GlobalTest_CT {
[] G_PCU[pcu_idx].receive(exp_rx) from g_pcu[pcu_idx].vc_BSSGP {
if (ro_integer_contains(roi, pcu_idx)) {
setverdict(fail, "Received multiple on same SIG BVC");
}
roi := roi & { pcu_idx };
repeat;
}
}
/* send a INVOKE-TRACE from SGSN and expect to receive a copy on each NSE */
testcase TC_trace() runs on GlobalTest_CT
{
var BSSGP_ConnHdlr vc_conn;
f_init();
f_global_init();
var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_INVOKE_TRACE('23'O, '4321'O);
var template (present) PDU_BSSGP exp_rx := ts_BSSGP_INVOKE_TRACE('23'O, '4321'O);
var ro_default defaults := {};
for (var integer i := 0; i < lengthof(g_pcu); i := i+1) {
activate(as_bssgp_g_pcu_count(i, exp_rx, g_roi));
}
G_SGSN[0].send(pdu_tx);
f_sleep(2.0);
for (var integer i := 0; i < lengthof(defaults); i := i+1) {
deactivate(defaults[i]);
}
for (var integer i := 0; i < lengthof(g_pcu); i := i+1) {
if (not ro_integer_contains(g_roi, i)) {
setverdict(fail, "Failed to receive TRACE on PCU index ", i);
}
}
setverdict(pass);
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];
@ -2072,6 +2112,7 @@ control {
execute( TC_radio_status() );
execute( TC_suspend() );
execute( TC_resume() );
execute( TC_trace() );
execute( TC_bvc_block_ptp() );
execute( TC_bvc_unblock_ptp() );
execute( TC_bvc_reset_ptp_from_bss() );

View File

@ -301,7 +301,8 @@ altstep as_sig_wait_reset() runs on BSSGP_CT {
private template PDU_BSSGP tr_GLOBAL := (
{pDU_BSSGP_SUSPEND:=?}, {pDU_BSSGP_SUSPEND_ACK:=?}, {pDU_BSSGP_SUSPEND_NACK:=?},
{pDU_BSSGP_RESUME:=?}, {pDU_BSSGP_RESUME_ACK:=?}, {pDU_BSSGP_RESUME_NACK:=?}
{pDU_BSSGP_RESUME:=?}, {pDU_BSSGP_RESUME_ACK:=?}, {pDU_BSSGP_RESUME_NACK:=?},
{pDU_BSSGP_SGSN_INVOKE_TRACE:=?}
);
/* We are in BVC_S_UNBLOCKED state */

View File

@ -2023,7 +2023,59 @@ octetstring sdu) := {
}
}
/* 10.4.15 */
template (value) PDU_BSSGP
ts_BSSGP_INVOKE_TRACE(OCT1 eq_trace, OCT2 ref) := {
pDU_BSSGP_SGSN_INVOKE_TRACE := {
bssgpPduType := '40'O,
traceType := {
iEI := '22'O,
ext := '1'B,
lengthIndicator := {
length1 := 1
},
equipment_Trace := eq_trace
},
traceReference := {
iEI := '21'O,
ext := '1'B,
lengthIndicator := {
length1 := 2
},
trace_Reference := ref
},
triggerId := omit,
mobileId := omit,
omcId := omit,
transactionId := omit
}
}
template (present) PDU_BSSGP
tr_BSSGP_INVOKE_TRACE(template (present) OCT1 eq_trace, template (present) OCT2 ref) := {
pDU_BSSGP_SGSN_INVOKE_TRACE := {
bssgpPduType := '40'O,
traceType := {
iEI := '22'O,
ext := '1'B,
lengthIndicator := {
length1 := 1
},
equipment_Trace := eq_trace
},
traceReference := {
iEI := '21'O,
ext := '1'B,
lengthIndicator := {
length1 := 2
},
trace_Reference := ref
},
triggerId := *,
mobileId := *,
omcId := *,
transactionId := *
}
}
/* PDU permitted on PTP BVC only (TS 48.018 Section 5.4.1) */
template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP_ONLY := (