aboutsummaryrefslogtreecommitdiffstats
path: root/pcu
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2020-05-06 22:26:17 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2020-05-07 02:43:56 +0700
commit2e213ae0567835e4da2591f7f5dd7ef44f1c0446 (patch)
treef0ed11e475d051119c0b383d630473051ff5261c /pcu
parent91f8a09220ebbef3a02d9713082530192f0d064e (diff)
PCU: refactor f_imm_ass_verify_{ul,dl}_tbf_ass(): call f_shutdown()
This allows us to reduce code duplication. Change-Id: Ib74285177a5d8e3c4a27df1321e7eab3462318bc Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
Diffstat (limited to 'pcu')
-rw-r--r--pcu/PCU_Tests.ttcn113
1 files changed, 38 insertions, 75 deletions
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index ac2aaf3b..0c61595e 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -382,7 +382,7 @@ runs on RAW_PCU_Test_CT return boolean {
}
private function f_imm_ass_verify_ul_tbf_ass(in GsmRrMessage rr_imm_ass, out PacketUlAssign ul_tbf_ass)
-runs on RAW_PCU_Test_CT return boolean {
+runs on RAW_PCU_Test_CT {
/* Make sure we received an UL TBF Assignment */
if (match(rr_imm_ass, tr_IMM_TBF_ASS(dl := false, rest := tr_IaRestOctets_ULAss(?)))) {
@@ -391,20 +391,18 @@ runs on RAW_PCU_Test_CT return boolean {
setverdict(pass);
} else {
setverdict(fail, "Failed to match UL TBF Assignment");
- return false;
+ f_shutdown(__BFILE__, __LINE__);
}
/* Make sure we have got a TBF with Dynamic Block Allocation */
if (ul_tbf_ass.dynamic == omit) {
setverdict(fail, "Single Block Allocation is not handled by ", testcasename());
- return false;
+ f_shutdown(__BFILE__, __LINE__);
}
-
- return true;
}
private function f_imm_ass_verify_dl_tbf_ass(in GsmRrMessage rr_imm_ass, out PacketDlAssign dl_tbf_ass)
-runs on RAW_PCU_Test_CT return boolean {
+runs on RAW_PCU_Test_CT {
/* Make sure we received a DL TBF Assignment */
if (match(rr_imm_ass, tr_IMM_TBF_ASS(dl := true, rest := tr_IaRestOctets_DLAss(?)))) {
@@ -413,10 +411,8 @@ runs on RAW_PCU_Test_CT return boolean {
setverdict(pass);
} else {
setverdict(fail, "Failed to match DL TBF Assignment");
- return false;
+ f_shutdown(__BFILE__, __LINE__);
}
-
- return true;
}
/* Enqueue DATA.ind (both TDMA frame and block numbers to be patched) */
@@ -1051,11 +1047,8 @@ testcase TC_cs_lqual_ul_tbf() runs on RAW_PCU_Test_CT {
f_shutdown(__BFILE__, __LINE__);
}
- ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not an Uplink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+ /* Make sure we've got an Uplink TBF assignment */
+ f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
var template (value) RlcmacUlBlock ul_data := t_RLCMAC_UL_DATA(
tfi := ul_tbf_ass.dynamic.tfi_assignment,
@@ -1140,11 +1133,8 @@ testcase TC_cs_initial_ul() runs on RAW_PCU_Test_CT {
f_shutdown(__BFILE__, __LINE__);
}
- ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not an Uplink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+ /* Make sure we've got an Uplink TBF assignment */
+ f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
var template (value) RlcmacUlBlock ul_data := t_RLCMAC_UL_DATA(
tfi := ul_tbf_ass.dynamic.tfi_assignment,
@@ -1222,11 +1212,8 @@ testcase TC_cs_max_ul() runs on RAW_PCU_Test_CT {
f_shutdown(__BFILE__, __LINE__);
}
- ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not an Uplink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+ /* Make sure we've got an Uplink TBF assignment */
+ f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
var template (value) RlcmacUlBlock ul_data := t_RLCMAC_UL_DATA(
tfi := ul_tbf_ass.dynamic.tfi_assignment,
@@ -1292,11 +1279,8 @@ testcase TC_t3169() runs on RAW_PCU_Test_CT {
f_shutdown(__BFILE__, __LINE__);
}
- ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not an Uplink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+ /* Make sure we've got an Uplink TBF assignment */
+ f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
/* Send one UL block and make sure it is ACKED fine */
f_tx_rlcmac_ul_n_blocks(ul_tbf_ass, 1);
@@ -1340,11 +1324,10 @@ testcase TC_t3193() runs on RAW_PCU_Test_CT {
/* SGSN sends some DL data, PCU will page on CCCH (PCH) */
BSSGP[0].send(ts_BSSGP_DL_UD(tlli, data));
f_pcuif_rx_pch_imm_tbf_ass(rr_imm_ass);
- ok := f_imm_ass_verify_dl_tbf_ass(rr_imm_ass, dl_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not a Downlink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+
+ /* Make sure we've got a Downlink TBF assignment */
+ f_imm_ass_verify_dl_tbf_ass(rr_imm_ass, dl_tbf_ass);
+
/* Wait timer X2002 and DL block is available after CCCH IMM ASS: */
f_sleep(X2002);
f_rx_rlcmac_dl_block_exp_data(dl_block, sched_fn, data, 0);
@@ -1401,11 +1384,9 @@ private function f_TC_mo_ping_pong(template (omit) MSRadioAccessCapabilityV ms_r
setverdict(fail, "Failed to establish TBF");
f_shutdown(__BFILE__, __LINE__);
}
- ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not an Uplink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+
+ /* Make sure we've got an Uplink TBF assignment */
+ f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
if (not istemplatekind(ms_racap, "omit")) {
/* Send PACKET RESOURCE REQUEST to upgrade to EGPRS
@@ -1432,11 +1413,8 @@ private function f_TC_mo_ping_pong(template (omit) MSRadioAccessCapabilityV ms_r
BSSGP[0].send(ts_BSSGP_DL_UD(tlli, data));
f_pcuif_rx_pch_imm_tbf_ass(rr_imm_ass);
- ok := f_imm_ass_verify_dl_tbf_ass(rr_imm_ass, dl_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not a Downlink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+ /* Make sure we've got a Downlink TBF assignment */
+ f_imm_ass_verify_dl_tbf_ass(rr_imm_ass, dl_tbf_ass);
/* Wait timer X2002 and DL block is available after CCCH IMM ASS: */
f_sleep(X2002);
@@ -1498,11 +1476,8 @@ private function f_TC_mt_ping_pong(template (omit) MSRadioAccessCapabilityV_BSSG
BSSGP[0].send(ts_BSSGP_DL_UD(tlli, data, ms_racap));
f_pcuif_rx_pch_imm_tbf_ass(rr_imm_ass);
- ok := f_imm_ass_verify_dl_tbf_ass(rr_imm_ass, dl_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not a Downlink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+ /* Make sure we've got a Downlink TBF assignment */
+ f_imm_ass_verify_dl_tbf_ass(rr_imm_ass, dl_tbf_ass);
/* Wait timer X2002 and DL block is available after CCCH IMM ASS: */
f_sleep(X2002);
@@ -1518,11 +1493,9 @@ private function f_TC_mt_ping_pong(template (omit) MSRadioAccessCapabilityV_BSSG
setverdict(fail, "Failed to establish TBF");
f_shutdown(__BFILE__, __LINE__);
}
- ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not an Uplink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+
+ /* Make sure we've got an Uplink TBF assignment */
+ f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
/* Send one UL block and make sure it is ACKED fine */
f_tx_rlcmac_ul_n_blocks(ul_tbf_ass, 1);
@@ -1579,11 +1552,9 @@ testcase TC_imm_ass_dl_block_retrans() runs on RAW_PCU_Test_CT {
/* SGSN sends some DL data, PCU will page on CCCH (PCH) */
BSSGP[0].send(ts_BSSGP_DL_UD(tlli, data));
f_pcuif_rx_pch_imm_tbf_ass(rr_imm_ass);
- ok := f_imm_ass_verify_dl_tbf_ass(rr_imm_ass, dl_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not a Downlink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+
+ /* Make sure we've got a Downlink TBF assignment */
+ f_imm_ass_verify_dl_tbf_ass(rr_imm_ass, dl_tbf_ass);
/* Wait timer X2002 and DL block is available after CCCH IMM ASS: */
f_sleep(X2002);
@@ -1593,11 +1564,10 @@ testcase TC_imm_ass_dl_block_retrans() runs on RAW_PCU_Test_CT {
* or GPRS DL, or DL ACK was lost for some reason). As a result, PCU
* should retrigger IMM ASS + GPRS DL procedure after poll timeout. */
f_pcuif_rx_pch_imm_tbf_ass(rr_imm_ass);
- ok := f_imm_ass_verify_dl_tbf_ass(rr_imm_ass, dl_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not a Downlink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+
+ /* Make sure we've got a Downlink TBF assignment */
+ f_imm_ass_verify_dl_tbf_ass(rr_imm_ass, dl_tbf_ass);
+
/* Wait timer X2002 and DL block is available after CCCH IMM ASS: */
f_sleep(X2002);
f_rx_rlcmac_dl_block_exp_data(dl_block, sched_fn, data, 0);
@@ -1677,12 +1647,8 @@ testcase TC_paging_cs_from_bts() runs on RAW_PCU_Test_CT {
f_shutdown(__BFILE__, __LINE__);
}
- ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not an Uplink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
-
+ /* Make sure we've got an Uplink TBF assignment */
+ f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
/* build mobile Identity */
mi := valueof(ts_MI_IMSI_LV(imsi));
@@ -1729,11 +1695,8 @@ runs on RAW_PCU_Test_CT {
f_shutdown(__BFILE__, __LINE__);
}
- ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
- if (not ok) {
- setverdict(fail, "Immediate Assignment not an Uplink TBF");
- f_shutdown(__BFILE__, __LINE__);
- }
+ /* Make sure we've got an Uplink TBF assignment */
+ f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
/* Send paging request with or without TMSI */
if (use_ptmsi) {