add gsup_test to catch OS#3231

Encode an Insert Subscr Data with is_ps == true to trigger the encoding bug
described in OS#3231, i.e. show that it is fixed.

Move osmo_gsup_addr_send() to a separate .c file, so that it can be overridden
in the regression test to just dump the msgb instead.

I used this test to reproduce issue OS#3231, and now that it's here we might as
well keep it, and possibly expand on it in the future.

Related: OS#3231
Change-Id: Id1453351758f3e1a9ff03bd99fefaf51886e77da
diff --git a/tests/gsup/Makefile.am b/tests/gsup/Makefile.am
new file mode 100644
index 0000000..7c33dbd
--- /dev/null
+++ b/tests/gsup/Makefile.am
@@ -0,0 +1,41 @@
+AM_CPPFLAGS = \
+	$(all_includes) \
+	-I$(top_srcdir)/src \
+	$(NULL)
+
+AM_CFLAGS = \
+	-Wall \
+	-ggdb3 \
+	$(LIBOSMOCORE_CFLAGS) \
+	$(LIBOSMOGSM_CFLAGS) \
+	$(LIBOSMOABIS_CFLAGS) \
+	$(NULL)
+
+AM_LDFLAGS = \
+	$(NULL)
+
+EXTRA_DIST = \
+	gsup_test.ok \
+	gsup_test.err \
+	$(NULL)
+
+noinst_PROGRAMS = \
+	gsup_test \
+	$(NULL)
+
+gsup_test_SOURCES = \
+	gsup_test.c \
+	$(NULL)
+
+gsup_test_LDADD = \
+	$(top_srcdir)/src/luop.c \
+	$(top_srcdir)/src/gsup_server.c \
+	$(top_srcdir)/src/gsup_router.c \
+	$(LIBOSMOCORE_LIBS) \
+	$(LIBOSMOGSM_LIBS) \
+	$(LIBOSMOABIS_LIBS) \
+	$(NULL)
+
+.PHONY: update_exp
+update_exp:
+	$(builddir)/gsup_test >"$(srcdir)/gsup_test.ok" 2>"$(srcdir)/gsup_test.err"