diff options
Diffstat (limited to 'openbsc/tests/bsc-nat/bsc_nat_test.c')
-rw-r--r-- | openbsc/tests/bsc-nat/bsc_nat_test.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index c5234aa24..8f4e2d152 100644 --- a/openbsc/tests/bsc-nat/bsc_nat_test.c +++ b/openbsc/tests/bsc-nat/bsc_nat_test.c @@ -444,24 +444,29 @@ static void test_mgcp_ass_tracking(void) msg = msgb_alloc(4096, "foo"); copy_to_msg(msg, ass_cmd, sizeof(ass_cmd)); parsed = bsc_nat_parse(msg); - if (bsc_mgcp_assign(&con, msg) != 0) { + if (bsc_mgcp_assign_patch(&con, msg) != 0) { fprintf(stderr, "Failed to handle assignment.\n"); abort(); } - if (con.msc_timeslot != 21) { + if (con.msc_endp != 21) { fprintf(stderr, "Timeslot should be 21.\n"); abort(); } - if (con.bsc_timeslot != 21) { - fprintf(stderr, "Assigned timeslot should have been 21.\n"); + if (con.bsc_endp != 1) { + fprintf(stderr, "Assigned timeslot should have been 1.\n"); abort(); } + if (con.bsc->endpoint_status[1] != 1) { + fprintf(stderr, "The status on the BSC is wrong.\n"); + abort(); + } + talloc_free(parsed); bsc_mgcp_dlcx(&con); - if (con.bsc_timeslot != -1 || con.msc_timeslot != -1) { + if (con.bsc_endp != -1 || con.msc_endp != -1 || con.bsc->endpoint_status[1] != 0) { fprintf(stderr, "Clearing should remove the mapping.\n"); abort(); } @@ -483,8 +488,8 @@ static void test_mgcp_find(void) llist_add(&con->list_entry, &nat->bsc_connections); sccp_con = talloc_zero(con, struct sccp_connections); - sccp_con->msc_timeslot = 12; - sccp_con->bsc_timeslot = 12; + sccp_con->msc_endp = 12; + sccp_con->bsc_endp = 12; sccp_con->bsc = con; llist_add(&sccp_con->list_entry, &nat->sccp_connections); @@ -498,13 +503,6 @@ static void test_mgcp_find(void) abort(); } - sccp_con->msc_timeslot = 0; - sccp_con->bsc_timeslot = 0; - if (bsc_mgcp_find_con(nat, 1) != sccp_con) { - fprintf(stderr, "Didn't find the connection\n"); - abort(); - } - /* free everything */ talloc_free(nat); } @@ -523,7 +521,7 @@ static void test_mgcp_rewrite(void) char *input = strdup(orig); - output = bsc_mgcp_rewrite(input, strlen(input), ip, port); + output = bsc_mgcp_rewrite(input, strlen(input), 0x1e, ip, port); if (msgb_l2len(output) != strlen(patc)) { fprintf(stderr, "Wrong sizes for test: %d %d != %d != %d\n", i, msgb_l2len(output), strlen(patc), strlen(orig)); fprintf(stderr, "String '%s' vs '%s'\n", (const char *) output->l2h, patc); |