add simulation code for testing LTE disconnect during Voice Call

This commit is contained in:
Sukchan Lee 2018-01-17 17:17:22 +09:00
parent d8f23bed1a
commit 3662ad423e
3 changed files with 97 additions and 84 deletions

View File

@ -771,8 +771,9 @@ status_t tests1ap_build_detach_request(pkbuf_t **pkbuf, int i)
"000c404900000600 080003000200001a 001615172ba435db 040745090bf600f1"
"10000201020003e6 004300060000f110 2b67006440080000 f1109d67aa500086"
"4001300060000600 40020003e6",
"",
"000c404900000600 080003000100001a 00161517ba258500 040745090bf600f1"
"10000201020003e6 004300060000f110 2b67006440080000 f1109d67aa500086"
"4001300060000600 40020003e6",
"",
""
@ -786,7 +787,7 @@ status_t tests1ap_build_detach_request(pkbuf_t **pkbuf, int i)
};
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
77,
0,
77,
0,
0,
@ -856,11 +857,8 @@ status_t tests1ap_build_ue_context_release_complete(pkbuf_t **pkbuf, int i)
{
char *payload[TESTS1AP_MAX_MESSAGE] = {
"2017001300000200 004005c00100009e 00084003400002",
"",
"2017"
"0012000002000040 05c00100009f0008 40020003",
"2017001300000200 004005c000000001 00084003400001",
"2017001200000200 004005c00100009f 000840020003",
"",
"",
@ -884,8 +882,8 @@ status_t tests1ap_build_ue_context_release_complete(pkbuf_t **pkbuf, int i)
};
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
23,
0,
23,
22,
0,
0,
@ -1013,7 +1011,7 @@ status_t tests1ap_build_pdn_disconnectivity_request(
"0500000005c08000 0108000800030001 00001a000b0a2732 423c53040206d206"
"006440080055f501 0019d01000434006 0055f5011022",
"000d40380000"
"0500000005c08000 0108000800030001 00001a000b0a271a 776620040206d206"
"0500000005c08000 0108000800030001 00001a000b0a2732 423c53040206d206"
"006440080055f501 0019d01000434006 0055f5011022",
"",
@ -1353,7 +1351,7 @@ status_t tests1ap_build_deactivate_bearer_accept(
"0500000005c00000 0001000800030001 00001a000a0927a9 a1b2bd057200ce00"
"6440080055f50100 19d0100043400600 55f5011022",
"000d40370000"
"0500000005c00000 0001000800030001 00001a000a09275a af43d9056200ce00"
"0500000005c00000 0001000800030001 00001a000a09274c b2ebbd056200ce00"
"6440080055f50100 19d0100043400600 55f5011022",
"",

View File

@ -314,49 +314,26 @@ static void volte_test1(abts_case *tc, void *data)
core_sleep(time_from_msec(300));
/* Send PDN disconnectivity request */
rv = tests1ap_build_pdn_disconnectivity_request(&sendbuf, msgindex+1);
/* Send Detach Request */
rv = tests1ap_build_detach_request(&sendbuf, msgindex+1);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
/* Receive E-RAB Release Command +
* Deactivate EPS bearer context request */
/* Receive UE Context Release Command */
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
rv = tests1ap_enb_read(sock, recvbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
pkbuf_free(recvbuf);
/* Send E-RAB Release Response */
rv = tests1ap_build_e_rab_release_response(&sendbuf, msgindex);
/* Send UE Context Release Complete */
rv = tests1ap_build_ue_context_release_complete(&sendbuf, msgindex+1);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
core_sleep(time_from_msec(300));
/* Send Deactivate EPS bearer context accept */
rv = tests1ap_build_deactivate_bearer_accept(&sendbuf, msgindex+2);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
core_sleep(time_from_msec(300));
#if 0
/* Send INVALID PDN Connectivity Request */
rv = tests1ap_build_pdn_connectivity_request(&sendbuf, msgindex+1);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
/* Receive PDN Connectivity Reject */
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
rv = tests1ap_enb_read(sock, recvbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
pkbuf_free(recvbuf);
#endif
/********** Remove Subscriber in Database */
doc = BCON_NEW("imsi", BCON_UTF8("001010123456819"));
ABTS_PTR_NOTNULL(tc, doc);
@ -382,6 +359,7 @@ static void volte_test2(abts_case *tc, void *data)
s1ap_message_t message;
int i;
int msgindex = 0;
c_int8_t *rx_sid = NULL;
mongoc_collection_t *collection = NULL;
bson_t *doc = NULL;
@ -392,7 +370,7 @@ static void volte_test2(abts_case *tc, void *data)
"\"_id\" : { \"$oid\" : \"599eb929c850caabcbfdcd2b\" },"
"\"imsi\" : \"001010123456819\","
"\"pdn\" : ["
"{ \"apn\" : \"internet.ng2.mnet\","
"{ \"apn\" : \"internet\","
"\"_id\" : { \"$oid\" : \"599eb929c850caabcbfdcd32\" },"
"\"qos\" : {"
"\"qci\" : 9,"
@ -401,7 +379,7 @@ static void volte_test2(abts_case *tc, void *data)
"\"pre_emption_vulnerability\" : 1,"
"\"pre_emption_capability\" : 1 } },"
"\"type\" : 2 },"
"{ \"apn\" : \"internet\","
"{ \"apn\" : \"internet.ng2.mnet\","
"\"_id\" : { \"$oid\" : \"599eb929c850caabcbfdcd2c\" },"
"\"pcc_rule\" : ["
"{ \"_id\" : { \"$oid\" : \"599eb929c850caabcbfdcd2d\" },"
@ -416,20 +394,7 @@ static void volte_test2(abts_case *tc, void *data)
"\"arp\" : {"
"\"priority_level\" : 3,"
"\"pre_emption_vulnerability\" : 0,"
"\"pre_emption_capability\" : 0 } },"
"\"flow\" : ["
"{ \"direction\" : 2,"
"\"description\" : \"permit out udp from any 1-65535 to 10.200.136.98/32 23454\","
"\"_id\" : { \"$oid\" : \"599eb929c850caabcbfdcd31\" } },"
"{ \"direction\" : 1,"
"\"description\" : \"permit out ip from 45.45.0.1 to any\","
"\"_id\" : { \"$oid\" : \"599eb929c850caabcbfdcd30\" } },"
"{ \"direction\" : 2,"
"\"description\" : \"permit out udp from any 1-65535 to 10.200.136.98/24 23455\","
"\"_id\" : { \"$oid\" : \"599eb929c850caabcbfdcd2f\" } },"
"{ \"direction\" : 1,"
"\"description\" : \"permit out ip from cafe::1 to any\","
"\"_id\" : { \"$oid\" : \"599eb929c850caabcbfdcd2e\" } } ]"
"\"pre_emption_capability\" : 0 } }"
"} ],"
"\"ambr\" : {"
"\"downlink\" : { \"$numberLong\" : \"35840\" },"
@ -559,8 +524,7 @@ static void volte_test2(abts_case *tc, void *data)
core_sleep(time_from_msec(300));
/* Send Initial Context Setup Response */
rv = tests1ap_build_initial_context_setup_response(&sendbuf,
16777373, 1, 5, 1);
rv = tests1ap_build_initial_context_setup_response(&sendbuf, 1, 1, 5, 1);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
@ -577,7 +541,41 @@ static void volte_test2(abts_case *tc, void *data)
ABTS_INT_EQUAL(tc, CORE_OK, rv);
pkbuf_free(recvbuf);
/* Receive E-RAB Setup Request +
/* Send PDN Connectivity Request */
rv = tests1ap_build_pdn_connectivity_request(&sendbuf, msgindex);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
core_sleep(time_from_msec(300));
/* Receive E-RAB Setup Request +
* Activate default EPS bearer context request */
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
rv = tests1ap_enb_read(sock, recvbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
pkbuf_free(recvbuf);
/* Send E-RAB Setup Response */
rv = tests1ap_build_e_rab_setup_response(&sendbuf, 1, 1, 6, 2);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
core_sleep(time_from_msec(300));
/* Send Activate default EPS bearer context accept */
rv = tests1ap_build_activate_default_bearer_accept(&sendbuf, msgindex);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
core_sleep(time_from_msec(300));
/* Send AA-Request */
pcscf_rx_send_aar(&rx_sid, "45.45.0.5", 1, 1);
/* Receive E-RAB Setup Request +
* Activate dedicated EPS bearer context request */
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
rv = tests1ap_enb_read(sock, recvbuf);
@ -585,7 +583,7 @@ static void volte_test2(abts_case *tc, void *data)
pkbuf_free(recvbuf);
/* Send E-RAB Setup Response */
rv = tests1ap_build_e_rab_setup_response(&sendbuf, 33554492, 1, 6, 2);
rv = tests1ap_build_e_rab_setup_response(&sendbuf, 1, 1, 7, 3);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
@ -593,24 +591,41 @@ static void volte_test2(abts_case *tc, void *data)
core_sleep(time_from_msec(300));
/* Send Activate dedicated EPS bearer context accept */
rv = tests1ap_build_activate_dedicated_bearer_accept(&sendbuf, msgindex+1);
rv = tests1ap_build_activate_dedicated_bearer_accept(&sendbuf, msgindex);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
#if 0 /* TFT Rule Tester */
core_sleep(time_from_msec(300));
/* Send GTP-U ICMP Packet */
#if 1
rv = testgtpu_build_ping(&sendbuf, "45.45.0.2", "45.45.0.1");
#else
rv = testgtpu_build_ping(&sendbuf, "cafe::2", "cafe::1");
#endif
rv = testgtpu_enb_send(sendbuf);
/* Send PDN disconnectivity request */
rv = tests1ap_build_pdn_disconnectivity_request(&sendbuf, msgindex+1);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
/* Receive E-RAB Release Command +
* Deactivate EPS bearer context request */
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
rv = tests1ap_enb_read(sock, recvbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
pkbuf_free(recvbuf);
/* Send E-RAB Release Response */
rv = tests1ap_build_e_rab_release_response(&sendbuf, msgindex);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
core_sleep(time_from_msec(300));
/* Send Deactivate EPS bearer context accept */
rv = tests1ap_build_deactivate_bearer_accept(&sendbuf, msgindex+2);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
core_sleep(time_from_msec(300));
#endif
/********** Remove Subscriber in Database */
doc = BCON_NEW("imsi", BCON_UTF8("001010123456819"));
@ -633,9 +648,7 @@ abts_suite *test_volte(abts_suite *suite)
suite = ADD_SUITE(suite)
abts_run_test(suite, volte_test1, NULL);
#if 0
abts_run_test(suite, volte_test2, NULL);
#endif
return suite;
}

View File

@ -771,8 +771,9 @@ status_t tests1ap_build_detach_request(pkbuf_t **pkbuf, int i)
"000c404900000600 080003000200001a 001615172ba435db 040745090bf600f1"
"10000201020003e6 004300060000f110 2b67006440080000 f1109d67aa500086"
"4001300060000600 40020003e6",
"",
"000c404900000600 080003000100001a 00161517ba258500 040745090bf600f1"
"10000201020003e6 004300060000f110 2b67006440080000 f1109d67aa500086"
"4001300060000600 40020003e6",
"",
""
@ -786,7 +787,7 @@ status_t tests1ap_build_detach_request(pkbuf_t **pkbuf, int i)
};
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
77,
0,
77,
0,
0,
@ -856,11 +857,8 @@ status_t tests1ap_build_ue_context_release_complete(pkbuf_t **pkbuf, int i)
{
char *payload[TESTS1AP_MAX_MESSAGE] = {
"2017001300000200 004005c00100009e 00084003400002",
"",
"2017"
"0012000002000040 05c00100009f0008 40020003",
"2017001300000200 004005c000000001 00084003400001",
"2017001200000200 004005c00100009f 000840020003",
"",
"",
@ -884,8 +882,8 @@ status_t tests1ap_build_ue_context_release_complete(pkbuf_t **pkbuf, int i)
};
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
23,
0,
23,
22,
0,
0,
@ -1012,7 +1010,9 @@ status_t tests1ap_build_pdn_disconnectivity_request(
"000d40380000"
"0500000005c08000 0108000800030001 00001a000b0a2732 423c53040206d206"
"006440080055f501 0019d01000434006 0055f5011022",
"",
"000d40380000"
"0500000005c08000 0108000800030001 00001a000b0a2732 423c53040206d206"
"006440080055f501 0019d01000434006 0055f5011022",
"",
"",
@ -1026,7 +1026,7 @@ status_t tests1ap_build_pdn_disconnectivity_request(
};
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
60,
0,
60,
0,
0,
@ -1350,7 +1350,9 @@ status_t tests1ap_build_deactivate_bearer_accept(
"000d40370000"
"0500000005c00000 0001000800030001 00001a000a0927a9 a1b2bd057200ce00"
"6440080055f50100 19d0100043400600 55f5011022",
"",
"000d40370000"
"0500000005c00000 0001000800030001 00001a000a09274c b2ebbd056200ce00"
"6440080055f50100 19d0100043400600 55f5011022",
"",
"",
@ -1364,7 +1366,7 @@ status_t tests1ap_build_deactivate_bearer_accept(
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
59,
59,
0,
59,
0,
0,