From patchwork Wed Oct 7 14:18:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neels Hofmeyr X-Patchwork-Id: 527316 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (unknown [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 68E19140D89 for ; Thu, 8 Oct 2015 01:20:25 +1100 (AEDT) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 3A6CD9E58; Wed, 7 Oct 2015 14:20:24 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [213.95.27.120]) by lists.osmocom.org (Postfix) with ESMTP id 153839E34 for ; Wed, 7 Oct 2015 14:20:23 +0000 (UTC) Received: from mail.sysmocom.de ([144.76.43.93]) by ganesha.gnumonks.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1ZjpZp-0002kd-J2 for openbsc@lists.osmocom.org; Wed, 07 Oct 2015 16:20:22 +0200 Received: from localhost.localdomain (unknown [37.120.38.52]) by mail.sysmocom.de (Postfix) with ESMTPSA id 2A57F1C166F for ; Wed, 7 Oct 2015 14:19:05 +0000 (UTC) From: Neels Hofmeyr To: openbsc@lists.osmocom.org Subject: [PATCH 07/10] gtphub: add gtphub_test.c (empty) Date: Wed, 7 Oct 2015 16:18:25 +0200 Message-Id: <1444227508-26608-8-git-send-email-nhofmeyr@sysmocom.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1444227508-26608-1-git-send-email-nhofmeyr@sysmocom.de> References: <1444227508-26608-1-git-send-email-nhofmeyr@sysmocom.de> X-Spam-Score: 0.2 (/) X-Spam-Report: SpamASsassin versoin 3.3.1 on ganesha.gnumonks.org summary: Content analysis details: (0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 DNS_FROM_AHBL_RHSBL RBL: Envelope sender listed in dnsbl.ahbl.org -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [144.76.43.93 listed in list.dnswl.org] 0.1 TW_LR BODY: Odd Letter Triples with LR -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Development of the OpenBSC GSM base station controller List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" Sponsored-by: On-Waves ehi --- openbsc/.gitignore | 1 + openbsc/tests/gtphub/Makefile.am | 15 ++++++++- openbsc/tests/gtphub/gtphub_test.c | 63 +++++++++++++++++++++++++++++++++++++ openbsc/tests/gtphub/gtphub_test.ok | 1 + openbsc/tests/testsuite.at | 2 ++ 5 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 openbsc/tests/gtphub/gtphub_test.c create mode 100644 openbsc/tests/gtphub/gtphub_test.ok diff --git a/openbsc/.gitignore b/openbsc/.gitignore index f024d76..bf05ac2 100644 --- a/openbsc/.gitignore +++ b/openbsc/.gitignore @@ -78,6 +78,7 @@ tests/trau/trau_test tests/mgcp/mgcp_transcoding_test tests/sgsn/sgsn_test tests/subscr/subscr_test +tests/gtphub/gtphub_test tests/atconfig tests/atlocal diff --git a/openbsc/tests/gtphub/Makefile.am b/openbsc/tests/gtphub/Makefile.am index d53c19d..c4b3ec1 100644 --- a/openbsc/tests/gtphub/Makefile.am +++ b/openbsc/tests/gtphub/Makefile.am @@ -1,3 +1,16 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) + EXTRA_DIST = \ gtphub_nc_test.sh \ - gtphub_nc_test.ok + gtphub_nc_test.ok \ + gtphub_test.ok + +noinst_PROGRAMS = gtphub_test + +gtphub_test_SOURCES = gtphub_test.c + +gtphub_test_LDADD = \ + $(LIBOSMOCORE_LIBS) \ + -lgtp -lrt + diff --git a/openbsc/tests/gtphub/gtphub_test.c b/openbsc/tests/gtphub/gtphub_test.c new file mode 100644 index 0000000..95f82c3 --- /dev/null +++ b/openbsc/tests/gtphub/gtphub_test.c @@ -0,0 +1,63 @@ +/* Test the GTP hub */ + +/* (C) 2015 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include +#include + +#include + +void *osmo_gtphub_ctx; + +static void test_gtphub_api(void) +{ + OSMO_ASSERT(1); +} + +static struct log_info_cat gtphub_categories[] = { + [DGTPHUB] = { + .name = "DGTPHUB", + .description = "GTP Hub", + .color = "\033[1;33m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, +}; + +static struct log_info info = { + .cat = gtphub_categories, + .num_cat = ARRAY_SIZE(gtphub_categories), +}; + +int main(int argc, char **argv) +{ + osmo_init_logging(&info); + osmo_gtphub_ctx = talloc_named_const(NULL, 0, "osmo_gtphub"); + + test_gtphub_api(); + printf("Done\n"); + + talloc_report_full(osmo_gtphub_ctx, stderr); + return 0; +} + diff --git a/openbsc/tests/gtphub/gtphub_test.ok b/openbsc/tests/gtphub/gtphub_test.ok new file mode 100644 index 0000000..a965a70 --- /dev/null +++ b/openbsc/tests/gtphub/gtphub_test.ok @@ -0,0 +1 @@ +Done diff --git a/openbsc/tests/testsuite.at b/openbsc/tests/testsuite.at index 14d1f72..9a1f9dd 100644 --- a/openbsc/tests/testsuite.at +++ b/openbsc/tests/testsuite.at @@ -109,4 +109,6 @@ AT_KEYWORDS([gtphub]) AT_CHECK([test "$enable_gtphub_test" != no || exit 77]) cat $abs_srcdir/gtphub/gtphub_nc_test.ok > expout AT_CHECK([$abs_top_builddir/tests/gtphub/gtphub_nc_test.sh $abs_top_builddir/src/gprs/osmo-gtphub], [], [expout], [ignore]) +cat $abs_srcdir/gtphub/gtphub_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gtphub/gtphub_test], [], [expout], [ignore]) AT_CLEANUP