aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-09-30 09:10:25 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-10-09 17:22:34 +0200
commit68c6f887c222bf9527fe3960285608f12071e81f (patch)
tree55242c882c094c883a0b6033668dbc4a2d3c55c5 /openbsc/tests
parent7b76f82b6e3e99f872356b45b25e2dc2e386a231 (diff)
sgsn: Add boilerplate code for a SGSN test
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/Makefile.am4
-rw-r--r--openbsc/tests/atlocal.in1
-rw-r--r--openbsc/tests/sgsn/Makefile.am10
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c27
-rw-r--r--openbsc/tests/sgsn/sgsn_test.ok0
-rw-r--r--openbsc/tests/testsuite.at7
6 files changed, 49 insertions, 0 deletions
diff --git a/openbsc/tests/Makefile.am b/openbsc/tests/Makefile.am
index 7bb871218..273c84f63 100644
--- a/openbsc/tests/Makefile.am
+++ b/openbsc/tests/Makefile.am
@@ -12,6 +12,10 @@ if BUILD_SMPP
SUBDIRS += smpp
endif
+if HAVE_LIBGTP
+SUBDIRS += sgsn
+endif
+
# The `:;' works around a Bash 3.2 bug when the output is not writeable.
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
diff --git a/openbsc/tests/atlocal.in b/openbsc/tests/atlocal.in
index 542a78e92..3b03bb726 100644
--- a/openbsc/tests/atlocal.in
+++ b/openbsc/tests/atlocal.in
@@ -2,3 +2,4 @@ enable_nat_test='@osmo_ac_build_nat@'
enable_smpp_test='@osmo_ac_build_smpp@'
enable_bsc_test='@osmo_ac_build_bsc@'
enable_mgcp_transcoding_test='@osmo_ac_mgcp_transcoding@'
+enable_sgsn_test='@found_libgtp@'
diff --git a/openbsc/tests/sgsn/Makefile.am b/openbsc/tests/sgsn/Makefile.am
new file mode 100644
index 000000000..9753acfc9
--- /dev/null
+++ b/openbsc/tests/sgsn/Makefile.am
@@ -0,0 +1,10 @@
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
+AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS)
+
+EXTRA_DIST = sgsn_test.ok
+
+noinst_PROGRAMS = sgsn_test
+
+sgsn_test_SOURCES = sgsn_test.c
+sgsn_test_LDADD = $(LIBOSMOCORE_LIBS)
+
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
new file mode 100644
index 000000000..729cecd83
--- /dev/null
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -0,0 +1,27 @@
+/* Test the SGSN */
+/*
+ * (C) 2014 by Holger Hans Peter Freyther
+ * (C) 2014 by sysmocom s.f.m.c. GmbH
+ * All Rights Reserved
+ *
+ * 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>
+
+int main(int argc, char **argv)
+{
+ return 0;
+}
diff --git a/openbsc/tests/sgsn/sgsn_test.ok b/openbsc/tests/sgsn/sgsn_test.ok
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/openbsc/tests/sgsn/sgsn_test.ok
diff --git a/openbsc/tests/testsuite.at b/openbsc/tests/testsuite.at
index 57310d629..ee62fa932 100644
--- a/openbsc/tests/testsuite.at
+++ b/openbsc/tests/testsuite.at
@@ -90,3 +90,10 @@ AT_KEYWORDS([trau])
cat $abs_srcdir/trau/trau_test.ok > expout
AT_CHECK([$abs_top_builddir/tests/trau/trau_test], [], [expout], [ignore])
AT_CLEANUP
+
+AT_SETUP([sgsn])
+AT_KEYWORDS([sgsn])
+AT_CHECK([test "$enable_sgsn_test" != no || exit 77])
+cat $abs_srcdir/sgsn/sgsn_test.ok > expout
+AT_CHECK([$abs_top_builddir/tests/sgsn/sgsn_test], [], [expout], [ignore])
+AT_CLEANUP