aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tbf/TbfTest.cpp
diff options
context:
space:
mode:
authoraravind sirsikar <arvind.sirsikar@radisys.com>2016-11-09 16:27:00 +0530
committeraravind sirsikar <arvind.sirsikar@radisys.com>2016-11-09 16:27:00 +0530
commitc0c3afd0794c217e6fc33b18eb9366c8cfe8b020 (patch)
treebc4f133a852deb15453eff0969be95d4be95ed8a /tests/tbf/TbfTest.cpp
parentae4838101a58feb512e88325efcae79f46af8e32 (diff)
Handle Immediate assignment reject
When RACH is received, PCU will generate the Immediate assignment reject message if no resources are present. The encoding is done based on section 9.1.20 of 44.018 version 11.7.0 Release 11. This patch also includes the test case to validate the generated Immediate assignment reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b
Diffstat (limited to 'tests/tbf/TbfTest.cpp')
-rw-r--r--tests/tbf/TbfTest.cpp83
1 files changed, 83 insertions, 0 deletions
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index cc48392..339390b 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -1372,6 +1372,88 @@ static void test_tbf_single_phase()
printf("=== end %s ===\n", __func__);
}
+/*
+ * Trigger rach for single block
+ */
+static void test_immediate_assign_rej_single_block()
+{
+ BTS the_bts;
+ uint32_t fn = 2654218;
+ uint16_t qta = 31;
+ int ts_no = 7;
+
+ printf("=== start %s ===\n", __func__);
+
+ setup_bts(&the_bts, ts_no, 4);
+
+ the_bts.bts_data()->trx[0].pdch[ts_no].disable();
+
+ uint32_t rach_fn = fn - 51;
+
+ int rc = 0;
+
+ /*
+ * simulate RACH, sends an Immediate Assignment
+ * Uplink reject on the AGCH
+ */
+ rc = the_bts.rcv_rach(0x70, rach_fn, qta, 0,
+ GSM_L1_BURST_TYPE_ACCESS_0);
+
+ OSMO_ASSERT(rc == -EINVAL);
+
+ printf("=== end %s ===\n", __func__);
+}
+
+/*
+ * Trigger rach till resources(USF) exhaust
+ */
+static void test_immediate_assign_rej_multi_block()
+{
+ BTS the_bts;
+ uint32_t fn = 2654218;
+ uint16_t qta = 31;
+ int ts_no = 7;
+
+ printf("=== start %s ===\n", __func__);
+
+ setup_bts(&the_bts, ts_no, 4);
+
+ uint32_t rach_fn = fn - 51;
+
+ int rc = 0;
+
+ /*
+ * simulate RACH, sends an Immediate Assignment Uplink
+ * reject on the AGCH
+ */
+ rc = the_bts.rcv_rach(0x78, rach_fn, qta, 0,
+ GSM_L1_BURST_TYPE_ACCESS_0);
+ rc = the_bts.rcv_rach(0x79, rach_fn, qta, 0,
+ GSM_L1_BURST_TYPE_ACCESS_0);
+ rc = the_bts.rcv_rach(0x7a, rach_fn, qta, 0,
+ GSM_L1_BURST_TYPE_ACCESS_0);
+ rc = the_bts.rcv_rach(0x7b, rach_fn, qta, 0,
+ GSM_L1_BURST_TYPE_ACCESS_0);
+ rc = the_bts.rcv_rach(0x7c, rach_fn, qta, 0,
+ GSM_L1_BURST_TYPE_ACCESS_0);
+ rc = the_bts.rcv_rach(0x7d, rach_fn, qta, 0,
+ GSM_L1_BURST_TYPE_ACCESS_0);
+ rc = the_bts.rcv_rach(0x7e, rach_fn, qta, 0,
+ GSM_L1_BURST_TYPE_ACCESS_0);
+ rc = the_bts.rcv_rach(0x7f, rach_fn, qta, 0,
+ GSM_L1_BURST_TYPE_ACCESS_0);
+
+ OSMO_ASSERT(rc == -EBUSY);
+
+ printf("=== end %s ===\n", __func__);
+}
+
+static void test_immediate_assign_rej()
+{
+ test_immediate_assign_rej_multi_block();
+ test_immediate_assign_rej_single_block();
+}
+
static void test_tbf_two_phase()
{
BTS the_bts;
@@ -2791,6 +2873,7 @@ int main(int argc, char **argv)
test_tbf_update_ws();
test_tbf_li_decoding();
test_tbf_epdan_out_of_rx_window();
+ test_immediate_assign_rej();
if (getenv("TALLOC_REPORT_FULL"))
talloc_report_full(tall_pcu_ctx, stderr);