@@ -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
@@ -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
+
new file mode 100644
@@ -0,0 +1,63 @@
+/* Test the GTP hub */
+
+/* (C) 2015 by sysmocom s.f.m.c. GmbH
+ * All Rights Reserved
+ *
+ * Author: Neels Hofmeyr <nhofmeyr@sysmcom.de>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <stdio.h>
+
+#include <osmocom/core/utils.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/application.h>
+
+#include <openbsc/debug.h>
+
+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;
+}
+
new file mode 100644
@@ -0,0 +1 @@
+Done
@@ -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