Introduce test TC_force_two_phase_access

Change-Id: Icce25b5d113eb5b37ec1e5b6c6c14aacdb01cd8d
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 81ff8be..044d368 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -137,6 +137,7 @@
 	var uint8_t g_mcs_max_ul := 9;
 
 	var boolean g_egprs_only := false;
+	var boolean g_force_two_phase_access := false;
 
 	/* Guard timeout */
 	timer g_T_guard := 60.0;
@@ -190,6 +191,12 @@
 	} else {
 		f_vty_config2(PCUVTY, {"pcu"}, "no egprs");
 	}
+
+	if (g_force_two_phase_access) {
+		f_vty_config2(PCUVTY, {"pcu"}, "two-phase-access");
+	} else {
+		f_vty_config2(PCUVTY, {"pcu"}, "no two-phase-access");
+	}
 }
 
 function f_init_raw(charstring id, template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default)
@@ -1497,6 +1504,12 @@
 	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);
+	if (g_force_two_phase_access) {
+		/* If 2phase access is enforced by the network, then let's
+		   request a One phase packet access, we'll receive a single block
+		   anyway */
+		   ra := bit2int(chan_req_def);
+	}
 
 	/* Initialize NS/BSSGP side */
 	f_init_bssgp();
@@ -1592,6 +1605,21 @@
 	f_TC_mo_ping_pong_2phase_access(ms_racap, exp_ul_cs_mcs, exp_dl_cs_mcs);
 }
 
+testcase TC_force_two_phase_access() runs on RAW_PCU_Test_CT {
+	/* Configure PCU to force two phase access */
+	g_force_two_phase_access := true;
+
+	var MultislotCap_GPRS mscap_gprs := {
+		gprsmultislotclass := '00011'B,
+		gprsextendeddynalloccap := '0'B
+	};
+	var MSRadioAccessCapabilityV ms_racap := { valueof(ts_RaCapRec('0001'B /* E-GSM */, mscap_gprs, omit)) };
+	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_ul_cs_mcs, exp_dl_cs_mcs);
+}
+
 /* Test scenario where SGSN wants to send some data against MS and it is
  * answered by the MS on PDCH, so TBFs for downlink and later for uplink are created.
  */
@@ -2135,6 +2163,7 @@
 	execute( TC_t3193() );
 	execute( TC_mo_ping_pong() );
 	execute( TC_mo_ping_pong_with_ul_racap() );
+	execute( TC_force_two_phase_access() );
 	execute( TC_mt_ping_pong() );
 	execute( TC_mt_ping_pong_with_dl_racap() );
 	execute( TC_imm_ass_dl_block_retrans() );