aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-08-27 22:13:18 +0200
committerHarald Welte <laforge@gnumonks.org>2015-09-22 16:39:04 +0200
commita313bb0a476aca8570abea3592dbe7593d11ecc9 (patch)
tree9e2761b245b896524f8d692f837a1b63d64d19bf /tests
parent923e324abc6d529aea884ca7082220ba66906054 (diff)
l1sap: Port code to new ciphering handling
... introduced in 2cc37035d73191b71b9ba9c0d559a0da6a5f35e5
Diffstat (limited to 'tests')
-rw-r--r--tests/sysmobts/sysmobts_test.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/sysmobts/sysmobts_test.c b/tests/sysmobts/sysmobts_test.c
index 7db12485..47c351c0 100644
--- a/tests/sysmobts/sysmobts_test.c
+++ b/tests/sysmobts/sysmobts_test.c
@@ -18,6 +18,7 @@
*/
#include <osmo-bts/bts.h>
+#include <osmo-bts/l1sap.h>
#include "femtobts.h"
#include "l1_if.h"
@@ -169,14 +170,17 @@ static void test_sysmobts_cipher(void)
/* Handle message sent before ciphering was received */
memcpy(&unit.u8Buffer[0], too_early_classmark, ARRAY_SIZE(too_early_classmark));
unit.u8Size = ARRAY_SIZE(too_early_classmark);
- bts_check_for_first_ciphrd(&fl1h, &unit, &lchan);
+ rc = bts_check_for_first_ciphrd(&lchan, unit.u8Buffer, unit.u8Size);
+ OSMO_ASSERT(rc == 0);
OSMO_ASSERT(lchan.ciph_state == LCHAN_CIPH_RX_CONF);
/* Now send the first ciphered message */
memcpy(&unit.u8Buffer[0], first_ciphered_cipher_cmpl, ARRAY_SIZE(first_ciphered_cipher_cmpl));
unit.u8Size = ARRAY_SIZE(first_ciphered_cipher_cmpl);
- bts_check_for_first_ciphrd(&fl1h, &unit, &lchan);
- OSMO_ASSERT(lchan.ciph_state == LCHAN_CIPH_TXRX_REQ);
+ rc = bts_check_for_first_ciphrd(&lchan, unit.u8Buffer, unit.u8Size);
+ OSMO_ASSERT(rc == 1);
+ /* we cannot test for lchan.ciph_state == * LCHAN_CIPH_RX_CONF_TX_REQ, as
+ * this happens asynchronously on the other side of the l1sap queue */
}
static void test_sysmobts_loop(void)