aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gb/gprs_ns_test.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-09 11:07:56 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-03-27 22:31:06 +0100
commit3de27490ceb8172363169358b7c4fcbcb26f4b11 (patch)
tree97a1ae8c6a919b8f35cd8673d89001fecb508938 /tests/gb/gprs_ns_test.c
parent8301a09dcc60ed7d72f8ccab0551ec794559ed7e (diff)
gprs-ns/test: Check the nsvc state explicitely
This patch extends test_sgsn_reset_invalid_state by assertions to check that nscv->state and nsvc->remote_state have been set as expected. Sponsored-by: On-Waves ehf
Diffstat (limited to 'tests/gb/gprs_ns_test.c')
-rw-r--r--tests/gb/gprs_ns_test.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c
index 500b40da..00b8732e 100644
--- a/tests/gb/gprs_ns_test.c
+++ b/tests/gb/gprs_ns_test.c
@@ -842,11 +842,18 @@ static void test_sgsn_reset_invalid_state()
sent_pdu_type = -1;
send_ns_alive(nsi, &sgsn_peer);
OSMO_ASSERT(sent_pdu_type == -1);
+
send_ns_reset_ack(nsi, &sgsn_peer, SGSN_NSEI+1, SGSN_NSEI);
OSMO_ASSERT(sent_pdu_type == NS_PDUT_ALIVE);
+
send_ns_alive_ack(nsi, &sgsn_peer);
+ OSMO_ASSERT(nsvc->state == (NSE_S_ALIVE | NSE_S_BLOCKED));
+ OSMO_ASSERT(nsvc->remote_state == (NSE_S_ALIVE | NSE_S_BLOCKED));
OSMO_ASSERT(sent_pdu_type == NS_PDUT_UNBLOCK);
+
send_ns_unblock_ack(nsi, &sgsn_peer);
+ OSMO_ASSERT(nsvc->state == NSE_S_ALIVE);
+ OSMO_ASSERT(nsvc->remote_state == NSE_S_ALIVE);
send_ns_unitdata(nsi, &sgsn_peer, 0x1234, dummy_sdu, sizeof(dummy_sdu));