From patchwork Thu Oct 9 09:07:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Erlbeck X-Patchwork-Id: 397944 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [IPv6:2001:780:45:1d:225:90ff:fe52:c662]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B74681400B2 for ; Thu, 9 Oct 2014 20:09:42 +1100 (EST) Received: from localhost ([127.0.0.1] helo=ganesha.gnumonks.org) by ganesha.gnumonks.org with esmtp (Exim 4.72) (envelope-from ) id 1Xc9j1-0000Yp-Kj; Thu, 09 Oct 2014 11:09:31 +0200 Received: from mail.sysmocom.de ([2a01:4f8:191:444c::2:4]) by ganesha.gnumonks.org with esmtp (Exim 4.72) (envelope-from ) id 1Xc9hc-0000SM-RB for openbsc@lists.osmocom.org; Thu, 09 Oct 2014 11:08:07 +0200 Received: from sysmocom-tmp.am93.sysmocom.de (unknown [91.65.194.134]) by mail.sysmocom.de (Postfix) with ESMTPSA id 710527D171; Thu, 9 Oct 2014 09:08:04 +0000 (UTC) From: Jacob Erlbeck To: openbsc@lists.osmocom.org Subject: [PATCH 2/2] gprs-ns/test: Check the nsvc state explicitely Date: Thu, 9 Oct 2014 11:07:56 +0200 Message-Id: <1412845676-13076-2-git-send-email-jerlbeck@sysmocom.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412845676-13076-1-git-send-email-jerlbeck@sysmocom.de> References: <1412845676-13076-1-git-send-email-jerlbeck@sysmocom.de> X-Spam-Score: 0.0 (/) Cc: Jacob Erlbeck X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Development of the OpenBSC GSM base station controller List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openbsc-bounces@lists.osmocom.org Errors-To: openbsc-bounces@lists.osmocom.org 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));