diff options
author | Aravind Sirsikar <arvind.sirsikar@radisys.com> | 2016-09-06 18:15:45 +0530 |
---|---|---|
committer | arvind.sirsikar <arvind.sirsikar@radisys.com> | 2016-09-14 11:55:32 +0000 |
commit | e26ee01d56b4c4c2da6abc6b649cb765d5787b98 (patch) | |
tree | 4affeaa5724cc2e7dd842b21c2bcc0f48707ee81 /tests | |
parent | 024152683646f1b68c85de74f783b81db51d16b5 (diff) |
DL TS allocation: add test case to show TS allocation bug for 2nd DL TBF
This patch adds a test case test_2_consecutive_dl_tbfs which
expects a current bug with TS allocation for 2nd DL TBF.
The test's expectation is corrected along with the bug fix in a
subsequent commit
Related: OS#1792
Change-Id: I890e4fbb2b64037e051433e70082a197e2a929a6
Diffstat (limited to 'tests')
-rw-r--r-- | tests/alloc/AllocTest.cpp | 51 | ||||
-rw-r--r-- | tests/alloc/AllocTest.ok | 3 |
2 files changed, 54 insertions, 0 deletions
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index b636b6e4..f7794f7c 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -792,6 +792,56 @@ static void test_many_connections() test_many_connections(alloc_algorithm_dynamic, 160, "algorithm dynamic"); } +static void test_2_consecutive_dl_tbfs() +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + uint8_t ms_class = 11; + uint8_t egprs_ms_class = 11; + gprs_rlcmac_tbf *dl_tbf1, *dl_tbf2; + uint8_t numTs1 = 0, numTs2 = 0; + + printf("Testing DL TS allocation for Multi UEs\n"); + + bts = the_bts.bts_data(); + bts->alloc_algorithm = alloc_algorithm_b; + + trx = &bts->trx[0]; + trx->pdch[4].enable(); + trx->pdch[5].enable(); + trx->pdch[6].enable(); + trx->pdch[7].enable(); + + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + OSMO_ASSERT(dl_tbf1); + + for (int i = 0; i < 8; i++) { + if (dl_tbf1->pdch[i]) + numTs1++; + } + OSMO_ASSERT(numTs1 == 4); + printf("TBF1: numTs(%d)\n", numTs1); + + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + OSMO_ASSERT(dl_tbf2); + + for (int i = 0; i < 8; i++) { + if (dl_tbf2->pdch[i]) + numTs2++; + } + + /* + * TODO: currently 2nd DL TBF gets 3 TS + * This behaviour will be fixed in subsequent patch + */ + printf("TBF2: numTs(%d)\n", numTs2); + OSMO_ASSERT(numTs2 == 3); + + tbf_free(dl_tbf1); + tbf_free(dl_tbf2); +} + int main(int argc, char **argv) { tall_pcu_ctx = talloc_named_const(NULL, 1, "moiji-mobile AllocTest context"); @@ -809,6 +859,7 @@ int main(int argc, char **argv) test_alloc_b(); test_successive_allocation(); test_many_connections(); + test_2_consecutive_dl_tbfs(); return EXIT_SUCCESS; } diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok index 9f88186a..cbb65aaa 100644 --- a/tests/alloc/AllocTest.ok +++ b/tests/alloc/AllocTest.ok @@ -10793,3 +10793,6 @@ Going to test assignment with many connections, algorithm dynamic TBF[31] class 14 reserves ......C. TBF[31] class 15 reserves .......C Successfully allocated 160 TBFs +Testing DL TS allocation for Multi UEs +TBF1: numTs(4) +TBF2: numTs(3) |