aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ms
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-21 16:58:22 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-27 13:30:01 +0200
commit0e50ce614569b9ae7bcc6e7becc4aeec46e8369d (patch)
tree71ce7ecfc92c291cd2362036b0d2df343ffb448b /tests/ms
parent767193e20b4172dfb0e76ec63444115dc5ae8806 (diff)
tbf: Always call set_tlli/confirm_tlli in update_ms
Currently the m_tlli member in GprsMs is set by the constructor, circumventing the TLLI confirmation mechanism. This commit replaces the get_or_create_ms() method by a create_ms() method which takes the TLLI and the direction (UL or DL) as parameters to select either set_tlli() or confirm_tlli(). The MS object is instantiated with TLLI = 0, and therefore GprsMs::tlli() is extended to return the DL TLLI if both of the other TLLI are not set. Note that create_ms() will not check whether an MS object with a matching TLLI is already stored in the list, so it should only be called after a corresponding get_ms() in general. Sponsored-by: On-Waves ehf
Diffstat (limited to 'tests/ms')
-rw-r--r--tests/ms/MsTest.cpp16
-rw-r--r--tests/ms/MsTest.err6
2 files changed, 13 insertions, 9 deletions
diff --git a/tests/ms/MsTest.cpp b/tests/ms/MsTest.cpp
index 01f26423..75328f48 100644
--- a/tests/ms/MsTest.cpp
+++ b/tests/ms/MsTest.cpp
@@ -329,7 +329,7 @@ static void test_ms_storage()
{
uint32_t tlli = 0xffeeddbb;
gprs_rlcmac_ul_tbf *ul_tbf;
- GprsMs *ms;
+ GprsMs *ms, *ms_tmp;
GprsMsStorage store;
printf("=== start %s ===\n", __func__);
@@ -340,18 +340,20 @@ static void test_ms_storage()
ms = store.get_ms(tlli + 0);
OSMO_ASSERT(ms == NULL);
- ms = store.get_or_create_ms(tlli + 0);
+ ms = store.create_ms(tlli + 0, GPRS_RLCMAC_UL_TBF);
+ OSMO_ASSERT(ms != NULL);
OSMO_ASSERT(ms->tlli() == tlli + 0);
- ms = store.get_ms(tlli + 0);
- OSMO_ASSERT(ms != NULL);
+ ms_tmp = store.get_ms(tlli + 0);
+ OSMO_ASSERT(ms == ms_tmp);
OSMO_ASSERT(ms->tlli() == tlli + 0);
- ms = store.get_or_create_ms(tlli + 1);
+ ms = store.create_ms(tlli + 1, GPRS_RLCMAC_UL_TBF);
+ OSMO_ASSERT(ms != NULL);
OSMO_ASSERT(ms->tlli() == tlli + 1);
- ms = store.get_ms(tlli + 1);
- OSMO_ASSERT(ms != NULL);
+ ms_tmp = store.get_ms(tlli + 1);
+ OSMO_ASSERT(ms == ms_tmp);
OSMO_ASSERT(ms->tlli() == tlli + 1);
/* delete ms */
diff --git a/tests/ms/MsTest.err b/tests/ms/MsTest.err
index bec98b98..4f704cbc 100644
--- a/tests/ms/MsTest.err
+++ b/tests/ms/MsTest.err
@@ -35,8 +35,10 @@ Modifying MS object, TLLI: 0xaa000000 confirmed
The MS object cannot fully confirm an unexpected TLLI: 0xff001111, partly confirmed
Modifying MS object, TLLI: 0xaa000000 -> 0xff001111, already confirmed partly
Destroying MS object, TLLI = 0xff001111
-Creating MS object, TLLI = 0xffeeddbb
-Creating MS object, TLLI = 0xffeeddbc
+Creating MS object, TLLI = 0x00000000
+Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddbb, not yet confirmed
+Creating MS object, TLLI = 0x00000000
+Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddbc, not yet confirmed
Attaching TBF to MS object, TLLI = 0xffeeddbb, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL)
Detaching TBF from MS object, TLLI = 0xffeeddbb, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL)
Destroying MS object, TLLI = 0xffeeddbb