From cc3894b6127d6aa96e5b4912021524e7592110d6 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 9 Dec 2020 16:50:12 +0100 Subject: [PATCH] gbproxy: Add test for FLOW-CONTROL-MS procedure (TC_fc_ms) Change-Id: Ie087ee8e8adfb963d21f35c60628214d4297250d Closes: SYS#5210 --- gbproxy/GBProxy_Tests.ttcn | 32 +++++++++++ library/Osmocom_Gb_Types.ttcn | 102 ++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+) diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn index 5e81c1311..655e396ca 100644 --- a/gbproxy/GBProxy_Tests.ttcn +++ b/gbproxy/GBProxy_Tests.ttcn @@ -2393,6 +2393,37 @@ testcase TC_fc_bvc() runs on GlobalTest_CT f_cleanup(); } +/*********************************************************************** + * FLOW-CONTROL-MS procedure + ***********************************************************************/ + +private function f_TC_fc_ms(charstring id) runs on BSSGP_ConnHdlr { + var BssgpBvci bvci := g_pars.pcu[0].cfg.bvc[0].bvci; + + var template (value) PDU_BSSGP fc_tx := ts_BVC_FC_MS(g_pars.tlli, 100, 200, '12'O); + /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ + var template (present) PDU_BSSGP fc_rx := tr_BVC_FC_MS(g_pars.tlli, 100, 200, '12'O); + var template (value) PDU_BSSGP ack_tx := ts_BVC_FC_MS_ACK(g_pars.tlli, '12'O); + + f_pcu2sgsn(fc_tx, fc_rx, use_sig := false); + f_sgsn2pcu(ack_tx, ack_tx, use_sig := false); + + setverdict(pass); +} +/* Send a FLOW-CONTROL-MS from BSS side and expect it to show up on SGSN (PTP BVC) */ +testcase TC_fc_ms() runs on test_CT +{ + var BSSGP_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_TC_fc_ms), testcasename(), g_pcu, g_sgsn, 21); + vc_conn.done; + /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */ + + f_cleanup(); +} + + control { execute( TC_BVC_bringup() ); @@ -2456,6 +2487,7 @@ control { execute( TC_flush_ll() ); execute( TC_fc_bvc() ); + execute( TC_fc_ms() ); } diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn index ba05f7db0..c53277205 100644 --- a/library/Osmocom_Gb_Types.ttcn +++ b/library/Osmocom_Gb_Types.ttcn @@ -1262,6 +1262,108 @@ octetstring sdu) := { } } + template (value) PDU_BSSGP ts_BVC_FC_MS(GprsTlli tlli, uint16_t bmax, uint16_t bucket_leak_rate, + OCT1 tag) := { + pDU_BSSGP_FLOW_CONTROL_MS := { + bssgpPduType := '28'O, + tLLI := ts_BSSGP_TLLI(tlli), + tag := { + iEI := '1E'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + unstructured_Value := tag + }, + mS_Bucket_Size := { + iEI := '12'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + bmax := f_oct_or_wc(bmax, 2) + }, + bucket_Leak_Rate := { + iEI := '03'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + r_Value := f_oct_or_wc(bucket_leak_rate, 2) + }, + bucket_Full_Ratio := omit, + flow_Control_Granularity := omit + } + } + template (present) PDU_BSSGP tr_BVC_FC_MS(template (present) GprsTlli tlli := ?, + template (present) uint16_t bmax := ?, + template (present) uint16_t bucket_leak_rate := ?, + template (present) OCT1 tag := ?) := { + pDU_BSSGP_FLOW_CONTROL_MS := { + bssgpPduType := '28'O, + tLLI := ts_BSSGP_TLLI(tlli), + tag := { + iEI := '1E'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + unstructured_Value := tag + }, + mS_Bucket_Size := { + iEI := '12'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + bmax := f_oct_or_wc(bmax, 2) + }, + bucket_Leak_Rate := { + iEI := '03'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + r_Value := f_oct_or_wc(bucket_leak_rate, 2) + }, + bucket_Full_Ratio := *, + flow_Control_Granularity := * + } + } + + template (value) PDU_BSSGP ts_BVC_FC_MS_ACK(template (value) GprsTlli tlli, + template (value) OCT1 tag) := { + + pDU_BSSGP_FLOW_CONTROL_MS_ACK := { + bssgpPduType := '29'O, + tLLI := ts_BSSGP_TLLI(tlli), + tag := { + iEI := '1E'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + unstructured_Value := tag + } + } + } + template (present) PDU_BSSGP tr_BVC_FC_MS_ACK(template (present) GprsTlli tlli, + template (present) OCT1 tag := ?) := { + + pDU_BSSGP_FLOW_CONTROL_MS_ACK := { + bssgpPduType := '29'O, + tLLI := tr_BSSGP_TLLI(tlli), + tag := { + iEI := '1E'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + unstructured_Value := tag + } + } + } + template PDU_BSSGP ts_BSSGP_STATUS(template BssgpBvci bvci, template BssgpCause cause, PDU_BSSGP pdu) := { pDU_BSSGP_STATUS := {