From 6eb4d25ba01103e713594727f3bc80137667e26f Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 15 Nov 2021 11:53:40 +0100 Subject: [PATCH] pcu: Introduce test TC_ratectr_all_available_allocated Related: SYS#4878 Change-Id: Ide1254954b5cf02a19e190b19d06c7aaeedb6ede --- pcu/PCU_Tests.ttcn | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn index 5bc295927..a191cc5b5 100644 --- a/pcu/PCU_Tests.ttcn +++ b/pcu/PCU_Tests.ttcn @@ -6504,6 +6504,54 @@ testcase TC_stat_pdch_avail_occ_ms_not_known_egprs() runs on RAW_PCU_Test_CT { f_tc_stat_pdch_avail_occ_ms_not_known(true); } +/* Make sure that bts.0.pdch.all_allocated is set when we allocate all resources */ +testcase TC_ratectr_all_available_allocated() runs on RAW_PCU_Test_CT { + var PCUIF_info_ind info_ind; + var template IARRestOctets rest; + var BIT11 ra11; + + info_ind := valueof(ts_PCUIF_INFO_default); + info_ind.t3142 := 3; + + /* Only the first TRX is enabled. */ + f_PCUIF_PDCHMask_set(info_ind, '00000000'B, (1 .. 7)); + f_PCUIF_PDCHMask_set(info_ind, '00000001'B, 0); + + /* Initialize the PCU interface abstraction */ + f_init_raw(testcasename(), info_ind); + f_statsd_reset(); + + var EGPRSPktChRequest req := { + one_phase := { + tag := '0'B, + multislot_class := '10101'B, + priority := '01'B, + random_bits := '101'B + } + }; + + /* We send 7 requests, the IUT gives us all available USFs (0..6) */ + for (var integer i := 0; i < 7; i := i + 1) { + req.one_phase.random_bits := int2bit(f_rnd_int(8), 3); + f_TC_egprs_pkt_chan_req(req, tr_IMM_TBF_ASS); + } + + ra11 := enc_EGPRSPktChRequest2bits(req); + rest := tr_IARRestOctets({ *, tr_ExtRAOpt(substr(ra11, 6, 5)), * }); + + /* At this point, the IUT should run out of free USFs */ + f_TC_egprs_pkt_chan_req_reject(ra11, 1870, rest, wi := info_ind.t3142); + + /* bts.0.pdch.all_allocated is updated once per second, wait some time to make sure it was updated. */ + f_sleep(2.0); + var StatsDExpects expect := { + { name := "TTCN3.bts.0.pdch.all_allocated", mtype := "c", min := 1, max := 1 } + }; + f_statsd_expect(expect); + + f_shutdown(__BFILE__, __LINE__, final := true); +} + control { execute( TC_pcuif_suspend() ); execute( TC_pcuif_suspend_active_tbf() ); @@ -6618,6 +6666,7 @@ control { execute( TC_stat_pdch_avail_occ() ); execute( TC_stat_pdch_avail_occ_ms_not_known_gprs() ); execute( TC_stat_pdch_avail_occ_ms_not_known_egprs() ); + execute( TC_ratectr_all_available_allocated() ); } }