aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-07-07 11:31:28 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-07-07 11:51:07 +0200
commit14376a73a5916a3dfa5bb65a2487d364a933e4c8 (patch)
tree89ac0e40ef940dbcefba883b639d0d71d630b40e /tests
parent506f156f7a4aebb52dace00a760f86b2b4f5e19a (diff)
alloc/test: Delete first TBF after the second is allocated
Currently when using the test modes TEST_MODE_DL_AFTER_UL or TEST_MODE_UL_AFTER_DL, the first TBF is deleted before the second is allocated. The far more interesting case were to keep the first TBF a little bit longer until the second TBF has been created and delete then. This comes closer the the situation observed with real MS, where the first TBF takes some time (timeout or waiting for Ack) before it gets deleted and thus detached from the MS object. This commit delays the call to tbf_free accordingly. The effect can be observed in the results of the algo A tests, where the uniform distribution of the allocated PDCH is lost. Sponsored-by: On-Waves ehf
Diffstat (limited to 'tests')
-rw-r--r--tests/alloc/AllocTest.cpp34
-rw-r--r--tests/alloc/AllocTest.err2
-rw-r--r--tests/alloc/AllocTest.ok141
3 files changed, 77 insertions, 100 deletions
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index 874f907..bf93f57 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -461,34 +461,36 @@ static GprsMs *alloc_tbfs(BTS *the_bts, GprsMs *ms, unsigned ms_class,
GprsMs::Guard guard(ms);
- /* Optionally delete the TBF */
- switch (mode) {
- case TEST_MODE_DL_AFTER_UL:
- case TEST_MODE_UL_AFTER_DL:
- tbf_free(tbf);
- break;
-
- default:
- break;
- }
-
/* Continue with what is needed next */
switch (mode) {
case TEST_MODE_UL_ONLY:
case TEST_MODE_DL_ONLY:
/* We are done */
- return ms;
+ break;
case TEST_MODE_DL_AFTER_UL:
case TEST_MODE_UL_AND_DL:
- return alloc_tbfs(the_bts, ms, ms_class, TEST_MODE_DL_ONLY);
+ ms = alloc_tbfs(the_bts, ms, ms_class, TEST_MODE_DL_ONLY);
+ break;
case TEST_MODE_UL_AFTER_DL:
case TEST_MODE_DL_AND_UL:
- return alloc_tbfs(the_bts, ms, ms_class, TEST_MODE_UL_ONLY);
+ ms = alloc_tbfs(the_bts, ms, ms_class, TEST_MODE_UL_ONLY);
+ break;
+ }
+
+ /* Optionally delete the TBF */
+ switch (mode) {
+ case TEST_MODE_DL_AFTER_UL:
+ case TEST_MODE_UL_AFTER_DL:
+ tbf_free(tbf);
+ break;
+
+ default:
+ break;
}
- return NULL;
+ return ms;
}
static void test_successive_allocation(algo_t algo, unsigned min_class,
@@ -584,7 +586,7 @@ static void test_successive_allocation()
32, "algorithm B class 10 (DL after UL)");
test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AFTER_DL,
- 32, "algorithm A (UL after DL)");
+ 7, "algorithm A (UL after DL)");
test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AFTER_DL,
32, "algorithm B class 10 (UL after DL)");
diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err
index af9b134..7bb2995 100644
--- a/tests/alloc/AllocTest.err
+++ b/tests/alloc/AllocTest.err
@@ -11,7 +11,7 @@ No TFI available.
No TFI available.
No TFI available.
No TFI available.
-No TFI available.
+- Failed to allocate a TS, no USF available
No TFI available.
No TFI available.
No TFI available.
diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok
index cfd0441..231b42f 100644
--- a/tests/alloc/AllocTest.ok
+++ b/tests/alloc/AllocTest.ok
@@ -8828,37 +8828,37 @@ Going to test assignment with many TBF, algorithm B class 10 (DL and UL)
Successfully allocated 32 UL TBFs
Going to test assignment with many TBF, algorithm A (DL after UL)
TBF[0] class 1 reserves ...C....
- TBF[1] class 1 reserves ....C...
- TBF[2] class 1 reserves .....C..
- TBF[3] class 1 reserves ......C.
- TBF[4] class 1 reserves .......C
+ TBF[1] class 1 reserves ...C....
+ TBF[2] class 1 reserves ...C....
+ TBF[3] class 1 reserves ...C....
+ TBF[4] class 1 reserves ...C....
TBF[5] class 1 reserves ...C....
- TBF[6] class 1 reserves ....C...
- TBF[7] class 1 reserves .....C..
- TBF[8] class 1 reserves ......C.
- TBF[9] class 1 reserves .......C
+ TBF[6] class 1 reserves ...C....
+ TBF[7] class 1 reserves ...C....
+ TBF[8] class 1 reserves ...C....
+ TBF[9] class 1 reserves ...C....
TBF[10] class 1 reserves ...C....
- TBF[11] class 1 reserves ....C...
- TBF[12] class 1 reserves .....C..
- TBF[13] class 1 reserves ......C.
- TBF[14] class 1 reserves .......C
+ TBF[11] class 1 reserves ...C....
+ TBF[12] class 1 reserves ...C....
+ TBF[13] class 1 reserves ...C....
+ TBF[14] class 1 reserves ...C....
TBF[15] class 1 reserves ...C....
- TBF[16] class 1 reserves ....C...
- TBF[17] class 1 reserves .....C..
- TBF[18] class 1 reserves ......C.
- TBF[19] class 1 reserves .......C
+ TBF[16] class 1 reserves ...C....
+ TBF[17] class 1 reserves ...C....
+ TBF[18] class 1 reserves ...C....
+ TBF[19] class 1 reserves ...C....
TBF[20] class 1 reserves ...C....
- TBF[21] class 1 reserves ....C...
- TBF[22] class 1 reserves .....C..
- TBF[23] class 1 reserves ......C.
- TBF[24] class 1 reserves .......C
+ TBF[21] class 1 reserves ...C....
+ TBF[22] class 1 reserves ...C....
+ TBF[23] class 1 reserves ...C....
+ TBF[24] class 1 reserves ...C....
TBF[25] class 1 reserves ...C....
- TBF[26] class 1 reserves ....C...
- TBF[27] class 1 reserves .....C..
- TBF[28] class 1 reserves ......C.
- TBF[29] class 1 reserves .......C
+ TBF[26] class 1 reserves ...C....
+ TBF[27] class 1 reserves ...C....
+ TBF[28] class 1 reserves ...C....
+ TBF[29] class 1 reserves ...C....
TBF[30] class 1 reserves ...C....
- TBF[31] class 1 reserves ....C...
+ TBF[31] class 1 reserves ...C....
Successfully allocated 32 UL TBFs
Going to test assignment with many TBF, algorithm B class 10 (DL after UL)
TBF[0] class 10 reserves ...DDCD.
@@ -8883,83 +8883,58 @@ Going to test assignment with many TBF, algorithm B class 10 (DL after UL)
TBF[19] class 10 reserves .....DCD
TBF[20] class 10 reserves ...DCD..
TBF[21] class 10 reserves .....DCD
- TBF[22] class 10 reserves ...CD...
+ TBF[22] class 10 reserves ...DCD..
TBF[23] class 10 reserves .....DCD
- TBF[24] class 10 reserves ...CD...
- TBF[25] class 10 reserves ...CD...
- TBF[26] class 10 reserves .....DCD
- TBF[27] class 10 reserves ...CD...
- TBF[28] class 10 reserves ....DCD.
+ TBF[24] class 10 reserves ...DCD..
+ TBF[25] class 10 reserves .....DCD
+ TBF[26] class 10 reserves ...DCD..
+ TBF[27] class 10 reserves .....DCD
+ TBF[28] class 10 reserves ...DCD..
TBF[29] class 10 reserves .....DCD
- TBF[30] class 10 reserves ...CD...
- TBF[31] class 10 reserves ...CD...
+ TBF[30] class 10 reserves ...DCD..
+ TBF[31] class 10 reserves .....DCD
Successfully allocated 32 UL TBFs
Going to test assignment with many TBF, algorithm A (UL after DL)
TBF[0] class 1 reserves ...U....
- TBF[1] class 1 reserves ....U...
- TBF[2] class 1 reserves .....U..
- TBF[3] class 1 reserves ......U.
- TBF[4] class 1 reserves .......U
+ TBF[1] class 1 reserves ...U....
+ TBF[2] class 1 reserves ...U....
+ TBF[3] class 1 reserves ...U....
+ TBF[4] class 1 reserves ...U....
TBF[5] class 1 reserves ...U....
- TBF[6] class 1 reserves ....U...
- TBF[7] class 1 reserves .....U..
- TBF[8] class 1 reserves ......U.
- TBF[9] class 1 reserves .......U
- TBF[10] class 1 reserves ...U....
- TBF[11] class 1 reserves ....U...
- TBF[12] class 1 reserves .....U..
- TBF[13] class 1 reserves ......U.
- TBF[14] class 1 reserves .......U
- TBF[15] class 1 reserves ...U....
- TBF[16] class 1 reserves ....U...
- TBF[17] class 1 reserves .....U..
- TBF[18] class 1 reserves ......U.
- TBF[19] class 1 reserves .......U
- TBF[20] class 1 reserves ...U....
- TBF[21] class 1 reserves ....U...
- TBF[22] class 1 reserves .....U..
- TBF[23] class 1 reserves ......U.
- TBF[24] class 1 reserves .......U
- TBF[25] class 1 reserves ...U....
- TBF[26] class 1 reserves ....U...
- TBF[27] class 1 reserves .....U..
- TBF[28] class 1 reserves ......U.
- TBF[29] class 1 reserves .......U
- TBF[30] class 1 reserves ...U....
- TBF[31] class 1 reserves ....U...
- Successfully allocated 32 UL TBFs
+ TBF[6] class 1 reserves ...U....
+ Successfully allocated 7 UL TBFs
Going to test assignment with many TBF, algorithm B class 10 (UL after DL)
TBF[0] class 10 reserves .....U..
TBF[1] class 10 reserves ......U.
TBF[2] class 10 reserves ....U...
- TBF[3] class 10 reserves .......U
+ TBF[3] class 10 reserves ......U.
TBF[4] class 10 reserves ....U...
TBF[5] class 10 reserves ......U.
- TBF[6] class 10 reserves .....U..
- TBF[7] class 10 reserves .......U
+ TBF[6] class 10 reserves ....U...
+ TBF[7] class 10 reserves ......U.
TBF[8] class 10 reserves ....U...
TBF[9] class 10 reserves ......U.
- TBF[10] class 10 reserves .....U..
- TBF[11] class 10 reserves .......U
+ TBF[10] class 10 reserves ....U...
+ TBF[11] class 10 reserves ......U.
TBF[12] class 10 reserves ....U...
TBF[13] class 10 reserves ......U.
- TBF[14] class 10 reserves .....U..
- TBF[15] class 10 reserves .......U
- TBF[16] class 10 reserves ....U...
- TBF[17] class 10 reserves ......U.
+ TBF[14] class 10 reserves ....U...
+ TBF[15] class 10 reserves .....U..
+ TBF[16] class 10 reserves .....U..
+ TBF[17] class 10 reserves .....U..
TBF[18] class 10 reserves .....U..
- TBF[19] class 10 reserves .......U
- TBF[20] class 10 reserves ....U...
- TBF[21] class 10 reserves ......U.
- TBF[22] class 10 reserves .....U..
+ TBF[19] class 10 reserves .....U..
+ TBF[20] class 10 reserves .....U..
+ TBF[21] class 10 reserves .......U
+ TBF[22] class 10 reserves .......U
TBF[23] class 10 reserves .......U
- TBF[24] class 10 reserves ....U...
- TBF[25] class 10 reserves ......U.
- TBF[26] class 10 reserves .....U..
- TBF[27] class 10 reserves ...U....
- TBF[28] class 10 reserves .......U
+ TBF[24] class 10 reserves .......U
+ TBF[25] class 10 reserves .......U
+ TBF[26] class 10 reserves ...U....
+ TBF[27] class 10 reserves .......U
+ TBF[28] class 10 reserves ...U....
TBF[29] class 10 reserves ...U....
- TBF[30] class 10 reserves ...U....
+ TBF[30] class 10 reserves .......U
TBF[31] class 10 reserves ...U....
Successfully allocated 32 UL TBFs
Going to test assignment with many TBF, algorithm A (UL only)