test initial context setup failure and handover failure

This commit is contained in:
Sukchan Lee 2018-03-15 17:22:45 +09:00
parent 4b32d7f448
commit 463e40d41b
4 changed files with 68 additions and 0 deletions

View File

@ -247,6 +247,13 @@ static void attach_test1(abts_case *tc, void *data)
ABTS_TRUE(tc, memcmp(recvbuf->payload+32, tmp+32, 20) == 0);
pkbuf_free(recvbuf);
#if TEST_INITIAL_CONTEXT_SETUP_FAILURE
/* Send Initial Context Setup Failure */
rv = tests1ap_build_initial_context_setup_failure(&sendbuf, msgindex);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
#endif
core_sleep(time_from_msec(300));
rv = testgtpu_build_slacc_rs(&sendbuf, 0);

View File

@ -637,6 +637,14 @@ static void handover_test2(abts_case *tc, void *data)
ABTS_INT_EQUAL(tc, CORE_OK, rv);
pkbuf_free(recvbuf);
#if TEST_HANDOVER_FAILURE
/* Send Handover Failure */
rv = tests1ap_build_handover_failure(&sendbuf, 0);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock1, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
#endif
/* Send Handover Request Ack */
rv = tests1ap_build_handover_request_ack(&sendbuf, 1, 33554629, 8, 2, 5, 1);
ABTS_INT_EQUAL(tc, CORE_OK, rv);

View File

@ -835,6 +835,31 @@ status_t tests1ap_build_initial_context_setup_response(
return CORE_OK;
}
status_t tests1ap_build_initial_context_setup_failure(pkbuf_t **pkbuf, int i)
{
char *payload[TESTS1AP_MAX_MESSAGE] = {
"4009 0015000003000040 0200020008400200 01000240020000",
"",
"",
};
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
25,
0,
0,
};
char hexbuf[MAX_SDU_LEN];
*pkbuf = pkbuf_alloc(0, MAX_SDU_LEN);
if (!(*pkbuf)) return CORE_ERROR;
(*pkbuf)->len = len[i];
memcpy((*pkbuf)->payload, CORE_HEX(payload[i], strlen(payload[i]), hexbuf),
(*pkbuf)->len);
return CORE_OK;
}
status_t tests1ap_build_attach_complete(pkbuf_t **pkbuf, int i)
{
char *payload[TESTS1AP_MAX_MESSAGE] = {
@ -1949,6 +1974,31 @@ status_t tests1ap_build_handover_required(
return CORE_OK;
}
status_t tests1ap_build_handover_failure(pkbuf_t **pkbuf, int i)
{
char *payload[TESTS1AP_MAX_MESSAGE] = {
"4001 0012000002000040 05c0020000c5 000240020000",
"",
"",
};
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
22,
0,
0,
};
char hexbuf[MAX_SDU_LEN];
*pkbuf = pkbuf_alloc(0, MAX_SDU_LEN);
if (!(*pkbuf)) return CORE_ERROR;
(*pkbuf)->len = len[i];
memcpy((*pkbuf)->payload, CORE_HEX(payload[i], strlen(payload[i]), hexbuf),
(*pkbuf)->len);
return CORE_OK;
}
CORE_DECLARE(status_t) tests1ap_build_handover_request_ack(
pkbuf_t **pkbuf, int target,
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id,

View File

@ -36,6 +36,8 @@ CORE_DECLARE(status_t) tests1ap_build_initial_context_setup_response(
pkbuf_t **pkbuf,
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id,
c_uint8_t ebi, c_uint32_t teid);
CORE_DECLARE(status_t) tests1ap_build_initial_context_setup_failure(
pkbuf_t **pkbuf, int i);
CORE_DECLARE(status_t) tests1ap_build_attach_complete(pkbuf_t **pkbuf, int i);
CORE_DECLARE(status_t) tests1ap_build_emm_status(pkbuf_t **pkbuf, int i);
CORE_DECLARE(status_t) tests1ap_build_detach_request(pkbuf_t **pkbuf, int i);
@ -74,6 +76,7 @@ CORE_DECLARE(status_t) tests1ap_build_path_switch_request(
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id,
int num_of_bearer, c_uint8_t ebi, c_uint32_t teid);
CORE_DECLARE(status_t) tests1ap_build_handover_required(pkbuf_t **pkbuf, int i);
CORE_DECLARE(status_t) tests1ap_build_handover_failure(pkbuf_t **pkbuf, int i);
CORE_DECLARE(status_t) tests1ap_build_handover_request_ack(
pkbuf_t **pkbuf, int target,
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id,