From patchwork Thu Oct 9 09:07:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Erlbeck X-Patchwork-Id: 397943 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 48CC9140076 for ; Thu, 9 Oct 2014 20:08:48 +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 1Xc9i3-0000Si-GX; Thu, 09 Oct 2014 11:08: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-0000SL-Fo for openbsc@lists.osmocom.org; Thu, 09 Oct 2014 11:08:06 +0200 Received: from sysmocom-tmp.am93.sysmocom.de (unknown [91.65.194.134]) by mail.sysmocom.de (Postfix) with ESMTPSA id 3FBDC7D16E; Thu, 9 Oct 2014 09:08:04 +0000 (UTC) From: Jacob Erlbeck To: openbsc@lists.osmocom.org Subject: [PATCH 1/2] gprs-ns/test: Re-add return value check for gprs_nsvc_reset Date: Thu, 9 Oct 2014 11:07:55 +0200 Message-Id: <1412845676-13076-1-git-send-email-jerlbeck@sysmocom.de> X-Mailer: git-send-email 1.9.1 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 The return value check has been removed in the commit 'Use gprs_nsvc_reset instead of gprs_ns_tx_reset', because gprs_nsvc_reset had no return value then. Since a compatible return value has been added by 'Let gprs_nsvc_reset return a value', the former patch is partly reverted by this commit. Sponsored-by: On-Waves ehf --- tests/gb/gprs_ns_test.c | 9 ++++++++- tests/gb/gprs_ns_test.ok | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c index 2185ff8..eab71e7 100644 --- a/tests/gb/gprs_ns_test.c +++ b/tests/gb/gprs_ns_test.c @@ -592,6 +592,7 @@ static void test_bss_reset_ack() struct sockaddr_in peer[4] = {{0},}; struct gprs_nsvc *nsvc; struct sockaddr_in *nse[4]; + int rc; peer[0].sin_family = AF_INET; peer[0].sin_port = htons(1111); @@ -641,7 +642,13 @@ static void test_bss_reset_ack() printf("--- Setup VC 2 SGSN -> BSS (hits NSEI 2) ---\n\n"); nsvc = gprs_nsvc_by_nsvci(nsi, 0x2001); - gprs_nsvc_reset(nsvc, NS_CAUSE_OM_INTERVENTION); + rc = gprs_nsvc_reset(nsvc, NS_CAUSE_OM_INTERVENTION); + if (rc < 0) + printf("Failed to send RESET to %s\n\n", gprs_ns_ll_str(nsvc)); + else { + send_ns_reset_ack(nsi, nse[1], 0x2001, 0x2000); + gprs_dump_nsi(nsi); + } printf("--- Setup VC 1 SGSN -> BSS (hits NSEI 1) ---\n\n"); diff --git a/tests/gb/gprs_ns_test.ok b/tests/gb/gprs_ns_test.ok index 1e0bf7f..d6be1a9 100644 --- a/tests/gb/gprs_ns_test.ok +++ b/tests/gb/gprs_ns_test.ok @@ -375,6 +375,8 @@ Current NS-VCIs: --- Setup VC 2 SGSN -> BSS (hits NSEI 2) --- +Failed to send RESET to 0.0.0.0:0 + --- Setup VC 1 SGSN -> BSS (hits NSEI 1) --- MESSAGE to BSS, msg length 12