aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/bsc-nat
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-28 18:22:14 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-29 16:35:26 +0800
commit45fd07dc33b5dd845e2b266adda5d24a4d500f96 (patch)
tree76a24118f01c2b15fa694820922775dda606f85a /openbsc/tests/bsc-nat
parent39cd32e650d490ba2d5e74f2df90a3f12514d618 (diff)
nat: Attempt to assign the BSC Timeslot based on a free list
Do attempt to not reassign an endpoint immediately but go to the next free one.
Diffstat (limited to 'openbsc/tests/bsc-nat')
-rw-r--r--openbsc/tests/bsc-nat/bsc_nat_test.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c
index b7a89c5b..acc5de34 100644
--- a/openbsc/tests/bsc-nat/bsc_nat_test.c
+++ b/openbsc/tests/bsc-nat/bsc_nat_test.c
@@ -444,7 +444,7 @@ 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();
}
@@ -454,14 +454,19 @@ static void test_mgcp_ass_tracking(void)
abort();
}
- if (con.bsc_endp != 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_endp != -1 || con.msc_endp != -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();
}