enb s1 setup request/response test
This commit is contained in:
parent
ee34fcbb35
commit
c94b80e097
|
@ -145,6 +145,14 @@ static int s1ap_decode_successfull_outcome(s1ap_message *message,
|
|||
message->procedureCode = successfullOutcome_p->procedureCode;
|
||||
switch (successfullOutcome_p->procedureCode)
|
||||
{
|
||||
case S1ap_ProcedureCode_id_S1Setup:
|
||||
ret = s1ap_decode_s1ap_s1setupresponseies(
|
||||
&message->msg.s1ap_S1SetupResponseIEs,
|
||||
&successfullOutcome_p->value);
|
||||
s1ap_decode_xer_print_message(
|
||||
s1ap_xer_print_s1ap_s1setupresponse,
|
||||
s1ap_xer__print2sp, message);
|
||||
break;
|
||||
case S1ap_ProcedureCode_id_InitialContextSetup:
|
||||
ret = s1ap_decode_s1ap_initialcontextsetupresponseies(
|
||||
&message->msg.s1ap_InitialContextSetupResponseIEs,
|
||||
|
|
|
@ -5,7 +5,8 @@ bin_PROGRAMS = testcellwire
|
|||
testcellwire_SOURCES = \
|
||||
abts.h abts_tests.h testutil.h \
|
||||
abts.c testutil.c \
|
||||
s1ap_test.c
|
||||
s1ap_enb_message.c \
|
||||
s1ap_test.c enb_setup_test.c
|
||||
|
||||
testcellwire_LDADD = \
|
||||
$(top_srcdir)/lib/core/src/libcore.la \
|
||||
|
|
|
@ -24,6 +24,7 @@ const struct testlist {
|
|||
abts_suite *(*func)(abts_suite *suite);
|
||||
} alltests[] = {
|
||||
{test_s1ap},
|
||||
{test_enb_setup},
|
||||
};
|
||||
|
||||
#endif /* APR_TEST_INCLUDES */
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "testutil.h"
|
||||
|
||||
#include "s1ap_message.h"
|
||||
#include "s1ap_enb_message.h"
|
||||
#include "s1ap_conv.h"
|
||||
|
||||
static void s1ap_test1(abts_case *tc, void *data)
|
||||
|
@ -95,42 +96,15 @@ static void s1ap_test4(abts_case *tc, void *data)
|
|||
|
||||
static void s1ap_test5(abts_case *tc, void *data)
|
||||
{
|
||||
int erval = -1;
|
||||
status_t rv;
|
||||
pkbuf_t *pkbuf;
|
||||
|
||||
s1ap_message message;
|
||||
S1ap_S1SetupRequestIEs_t *ies;
|
||||
S1ap_PLMNidentity_t *plmnIdentity;
|
||||
S1ap_SupportedTAs_Item_t *supportedTA;
|
||||
rv = s1ap_build_setup_req(&pkbuf);
|
||||
|
||||
memset(&message, 0, sizeof(s1ap_message));
|
||||
|
||||
ies = &message.msg.s1ap_S1SetupRequestIEs;
|
||||
|
||||
ies->global_ENB_ID.eNB_ID.present = S1ap_ENB_ID_PR_macroENB_ID;
|
||||
s1ap_conv_macro_enb_id_to_bit_string(0x5f123,
|
||||
&ies->global_ENB_ID.eNB_ID.choice.macroENB_ID);
|
||||
s1ap_conv_plmn_id_to_tbcd_string(
|
||||
&mme_self()->plmn_id, &ies->global_ENB_ID.pLMNidentity);
|
||||
|
||||
supportedTA = (S1ap_SupportedTAs_Item_t *)
|
||||
core_calloc(1, sizeof(S1ap_SupportedTAs_Item_t));
|
||||
s1ap_conv_uint16_to_octet_string(mme_self()->tac, &supportedTA->tAC);
|
||||
plmnIdentity = (S1ap_PLMNidentity_t *)
|
||||
core_calloc(1, sizeof(S1ap_PLMNidentity_t));
|
||||
s1ap_conv_plmn_id_to_tbcd_string(
|
||||
&mme_self()->plmn_id, plmnIdentity);
|
||||
ASN_SEQUENCE_ADD(&supportedTA->broadcastPLMNs, plmnIdentity);
|
||||
|
||||
ASN_SEQUENCE_ADD(&ies->supportedTAs, supportedTA);
|
||||
|
||||
message.direction = S1AP_PDU_PR_initiatingMessage;
|
||||
message.procedureCode = S1ap_ProcedureCode_id_S1Setup;
|
||||
|
||||
erval = s1ap_encode_pdu(&pkbuf, &message);
|
||||
ABTS_INT_EQUAL(tc, 280, erval);
|
||||
|
||||
s1ap_free_pdu(&message);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
ABTS_PTR_NOTNULL(tc, pkbuf);
|
||||
ABTS_PTR_NOTNULL(tc, pkbuf->payload);
|
||||
ABTS_INT_EQUAL(tc, 280, pkbuf->len);
|
||||
|
||||
pkbuf_free(pkbuf);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "core.h"
|
||||
#include "cellwire.h"
|
||||
#include "context.h"
|
||||
#include "abts.h"
|
||||
#include "testutil.h"
|
||||
|
||||
|
@ -36,6 +37,8 @@ void core_assert_ok(abts_case* tc, const char* context, status_t rv,
|
|||
|
||||
void test_terminate(void)
|
||||
{
|
||||
threads_stop();
|
||||
|
||||
core_terminate();
|
||||
cellwire_terminate();
|
||||
}
|
||||
|
@ -44,6 +47,11 @@ void test_initialize(void)
|
|||
{
|
||||
core_initialize();
|
||||
cellwire_initialize(NULL);
|
||||
|
||||
threads_start();
|
||||
|
||||
inet_pton(AF_INET, "127.0.0.1", &mme_self()->enb_local_addr);
|
||||
|
||||
atexit(test_terminate);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,5 +58,6 @@ void core_assert_ok(abts_case* tc, const char *context,
|
|||
void test_initialize(void);
|
||||
|
||||
abts_suite *test_s1ap(abts_suite *suite);
|
||||
abts_suite *test_enb_setup(abts_suite *suite);
|
||||
|
||||
#endif /* CORE_TEST_INCLUDES */
|
||||
|
|
Loading…
Reference in New Issue