From 2f839234b2f547aa27c08fb930b2a988451da7cd Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 27 Feb 2017 16:51:43 +0100 Subject: conn timeout: implement conn_fsm COMMUNICATING state When in the ACCEPTED state, if the MS never sent any message, the conn would stay open indefinitely. Introduce a new state COMMUNICATING, so that the ACCEPTED state can timeout. COMMUNICATING starts as soon as the MS first replies with a message for CC, SMS or USSD negotiation. The CC/SMS/USSD code is then expected to handle timeouts and BUMP the conn_fsm as appropriate. Add new test in msc_vlr_test_ms_timeout.c to verify that a CM Service Request and Paging Response without replies from the MS time out. Explicitly test for the COMMUNICATING state in msc_vlr_test_no_authen.c, but in the other tests just rely on the test output validation to ensure that the new state is entered in the right places. Change-Id: If7c9acab9ed393874f21231a0f78464c384b3d2f --- openbsc/tests/msc_vlr/msc_vlr_tests.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'openbsc/tests/msc_vlr/msc_vlr_tests.h') diff --git a/openbsc/tests/msc_vlr/msc_vlr_tests.h b/openbsc/tests/msc_vlr/msc_vlr_tests.h index 82ff51ada..95f210ec2 100644 --- a/openbsc/tests/msc_vlr/msc_vlr_tests.h +++ b/openbsc/tests/msc_vlr/msc_vlr_tests.h @@ -116,6 +116,13 @@ void check_talloc(void *msgb_ctx, void *tall_bsc_ctx, int expected_blocks); OSMO_ASSERT(accepted == expect_accepted); \ } while (false) +#define EXPECT_CONN_STATE(expect_state) do { \ + OSMO_ASSERT(conn_exists(g_conn)); \ + log("g_conn->conn_fsm->state == %s", \ + osmo_fsm_inst_state_name(g_conn->conn_fsm)); \ + OSMO_ASSERT(g_conn->conn_fsm->state == expect_state); \ + } while (false) + #define VERBOSE_ASSERT(val, expect_op, fmt) \ do { \ log(#val " == " fmt, (val)); \ -- cgit v1.2.3