summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-05-14 15:18:38 +0200
committerlaforge <laforge@osmocom.org>2020-05-17 07:26:34 +0000
commit42acafc9b83232dcdf008856899b2cbc5a329a81 (patch)
tree00c3834f0ae246851f3bbe027180f317ea186db1
parent4c2a1eaea25c7e06eeea8fab281e5525a7ce9272 (diff)
pcu: Introduce TC_mo_ping_pong_with_ul_racap_egprs_only
-rw-r--r--library/RLCMAC_Templates.ttcn40
-rw-r--r--pcu/PCU_Tests.ttcn55
2 files changed, 90 insertions, 5 deletions
diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn
index be751d7..1774197 100644
--- a/library/RLCMAC_Templates.ttcn
+++ b/library/RLCMAC_Templates.ttcn
@@ -93,6 +93,46 @@ module RLCMAC_Templates {
return CS_1;
}
+ function f_rlcmac_block_ChCodingCommand2cs_mcs(ChCodingCommand chcc) return CodingScheme {
+ select (chcc) {
+ case (CH_CODING_CS1) { return CS_1; }
+ case (CH_CODING_CS2) { return CS_2; }
+ case (CH_CODING_CS3) { return CS_3; }
+ case (CH_CODING_CS4) { return CS_4; }
+ }
+ return CS_1;
+ }
+
+ function f_rlcmac_block_EgprsChCodingCommand2cs_mcs(EgprsChCodingCommand echcc) return CodingScheme {
+ select (echcc) {
+ case (CH_CODING_MCS1) { return MCS_1; }
+ case (CH_CODING_MCS2) { return MCS_2; }
+ case (CH_CODING_MCS3) { return MCS_3; }
+ case (CH_CODING_MCS4) { return MCS_4; }
+ case (CH_CODING_MCS5) { return MCS_5; }
+ case (CH_CODING_MCS6) { return MCS_6; }
+ case (CH_CODING_MCS7) { return MCS_7; }
+ case (CH_CODING_MCS8) { return MCS_8; }
+ case (CH_CODING_MCS9) { return MCS_9; }
+ /* CH_CODING_MCS5_7 */
+ /* CH_CODING_MCS6_9 */
+ }
+ return MCS_1;
+ }
+
+ /* 1 -> CS_1 / MCS_1, 2 -> CS_2 / MCS_2, etc. */
+ function f_rlcmac_block_int2cs_mcs(integer n, boolean is_mcs) return CodingScheme {
+ var CodingScheme cs_mcs;
+ if (not is_mcs) {
+ int2enum(n - 1, cs_mcs);
+ return cs_mcs;
+ } else {
+ cs_mcs := MCS_0;
+ int2enum(enum2int(cs_mcs) + n, cs_mcs);
+ return cs_mcs;
+ }
+ }
+
/* Coding and Puncturing Scheme indicator field for Header type 1 in EGPRS TBF or EC TBF or downlink EGPRS2 TBF */
function f_rlcmac_cps_htype1_to_mcs(uint3_t cps) return CodingScheme {
var CodingSchemeArray egprs_Header_type1_coding_puncturing_scheme_to_mcs := {
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 18189fa..81ff8be 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -262,6 +262,20 @@ runs on RAW_PCU_Test_CT return uint5_t {
return 0; /* make compiler happy */
}
+/* Get the Chan coding command from a dl block containing PACCH UL Assignment */
+private function f_rlcmac_dl_block_get_assigned_ul_cs_mcs(RlcmacDlBlock dl_block)
+runs on RAW_PCU_Test_CT return CodingScheme {
+ if (match(dl_block, tr_RLCMAC_UL_PACKET_ASS_GPRS(?, tr_PktUlAssGprsDynamic(?)))) {
+ return f_rlcmac_block_ChCodingCommand2cs_mcs(dl_block.ctrl.payload.u.ul_assignment.gprs.ch_coding_cmd);
+ }
+ if (match(dl_block, tr_RLCMAC_UL_PACKET_ASS_EGPRS(?, tr_PktUlAssEgprsDynamic(?)))) {
+ return f_rlcmac_block_EgprsChCodingCommand2cs_mcs(dl_block.ctrl.payload.u.ul_assignment.egprs.chan_coding_cmd);
+ }
+ setverdict(fail, "DlBlock doesn't contain CS_MCS information:", dl_block);
+ f_shutdown(__BFILE__, __LINE__);
+ return CS_1; /* make compiler happy */
+}
+
/* TS 44.060 sec 12.3 Ack/Nack Description */
private function f_acknackdesc_ack_block(inout AckNackDescription desc, RlcmacDlBlock dl_block, BIT1 final_ack := '0'B)
{
@@ -1465,7 +1479,10 @@ testcase TC_mo_ping_pong() runs on RAW_PCU_Test_CT {
/* Test scenario where MS wants to send some data on PDCH against SGSN and it is
* answered, so TBFs for uplink and later for downlink are created.
*/
-private function f_TC_mo_ping_pong_2phase_access(template (value) MSRadioAccessCapabilityV ms_racap, template (present) CodingScheme exp_cs_mcs := ?) runs on RAW_PCU_Test_CT {
+private function f_TC_mo_ping_pong_2phase_access(template (value) MSRadioAccessCapabilityV ms_racap,
+ template (present) CodingScheme exp_ul_cs_mcs := ?,
+ template (present) CodingScheme exp_dl_cs_mcs := ?)
+runs on RAW_PCU_Test_CT {
var GsmRrMessage rr_imm_ass;
var PacketUlAssign ul_tbf_ass;
var PacketDlAssign dl_tbf_ass;
@@ -1477,6 +1494,7 @@ private function f_TC_mo_ping_pong_2phase_access(template (value) MSRadioAccessC
var uint32_t dl_fn;
var OCT4 tlli := '00000001'O;
var AckNackDescription ack_nack_desc := valueof(t_AckNackDescription_init);
+ var CodingScheme cs_mcs;
/* 0111 0xxx: Single block packet access; one block period on a PDCH is needed for two phase packet access or other RR signalling purpose. */
var uint16_t ra := oct2int('70'O);
@@ -1509,10 +1527,15 @@ private function f_TC_mo_ping_pong_2phase_access(template (value) MSRadioAccessC
setverdict(fail, "Wrong TLLI ", dl_block.ctrl.payload.u.ul_assignment.identity.tlli, " received vs exp ", tlli);
f_shutdown(__BFILE__, __LINE__);
}
+ cs_mcs := f_rlcmac_dl_block_get_assigned_ul_cs_mcs(dl_block);
+ if (not match(cs_mcs, exp_ul_cs_mcs)) {
+ setverdict(fail, "Wrong CS_MCS ", cs_mcs, " received vs exp ", exp_ul_cs_mcs);
+ f_shutdown(__BFILE__, __LINE__);
+ }
/* Send one UL block (without TLLI since we are in Second-Phase Access)
and make sure it is ACKED fine */
- f_tx_rlcmac_ul_n_blocks(f_rlcmac_dl_block_get_tfi(dl_block), 1);
+ f_tx_rlcmac_ul_n_blocks(f_rlcmac_dl_block_get_tfi(dl_block), 1); /* TODO: send using cs_mcs */
//f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn);
/* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */
@@ -1528,7 +1551,7 @@ private function f_TC_mo_ping_pong_2phase_access(template (value) MSRadioAccessC
f_tx_rlcmac_ul_block(ts_RLCMAC_CTRL_ACK(tlli), 0, sched_fn);
/* After acking the dl assignment, dl tbf goes into FLOW state and PCU will provide DL data when BTS asks for it */
- f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0, exp_cs_mcs);
+ f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0, exp_dl_cs_mcs);
/* ACK the DL block */
f_acknackdesc_ack_block(ack_nack_desc, dl_block, '1'B);
@@ -1544,9 +1567,29 @@ testcase TC_mo_ping_pong_with_ul_racap() runs on RAW_PCU_Test_CT {
gprsextendeddynalloccap := '0'B
};
var MSRadioAccessCapabilityV ms_racap := { valueof(ts_RaCapRec('0001'B /* E-GSM */, mscap_gprs, omit)) };
- var CodingScheme exp_cs_mcs := CS_2;
+ var CodingScheme exp_ul_cs_mcs := f_rlcmac_block_int2cs_mcs(g_mcs_initial_ul, false);
+ var CodingScheme exp_dl_cs_mcs := CS_2;
- f_TC_mo_ping_pong_2phase_access(ms_racap, exp_cs_mcs);
+ f_TC_mo_ping_pong_2phase_access(ms_racap, exp_ul_cs_mcs, exp_dl_cs_mcs);
+}
+
+testcase TC_mo_ping_pong_with_ul_racap_egprs_only() runs on RAW_PCU_Test_CT {
+ /* Initialize the PCU interface abstraction with EGPRS-only */
+ g_egprs_only := true;
+
+ var MultislotCap_GPRS mscap_gprs := {
+ gprsmultislotclass := '00011'B,
+ gprsextendeddynalloccap := '0'B
+ };
+ var MultislotCap_EGPRS mscap_egprs := {
+ egprsmultislotclass := '00011'B,
+ egprsextendeddynalloccap := '0'B
+ };
+ var MSRadioAccessCapabilityV ms_racap := { valueof(ts_RaCapRec('0001'B /* E-GSM */, mscap_gprs, mscap_egprs)) };
+ var CodingScheme exp_ul_cs_mcs := f_rlcmac_block_int2cs_mcs(g_mcs_initial_ul, true);
+ var CodingScheme exp_dl_cs_mcs := MCS_1;
+
+ f_TC_mo_ping_pong_2phase_access(ms_racap, exp_ul_cs_mcs, exp_dl_cs_mcs);
}
/* Test scenario where SGSN wants to send some data against MS and it is
@@ -2108,6 +2151,8 @@ control {
execute( TC_egprs_pkt_chan_req_signalling() );
execute( TC_egprs_pkt_chan_req_one_phase() );
execute( TC_egprs_pkt_chan_req_two_phase() );
+
+ execute( TC_mo_ping_pong_with_ul_racap_egprs_only() );
}