[PATCH 2/2] gprs-ns/test: Check the nsvc state explicitely

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Jacob Erlbeck jerlbeck at sysmocom.de
Thu Oct 9 09:07:56 UTC 2014


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
---
 tests/gb/gprs_ns_test.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c
index eab71e7..9c3a3ac 100644
--- a/tests/gb/gprs_ns_test.c
+++ b/tests/gb/gprs_ns_test.c
@@ -847,11 +847,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));
 
-- 
1.9.1





More information about the OpenBSC mailing list