forked from acouzens/open5gs
testsuite is added. (refer to libosmocom)
This commit is contained in:
parent
c9596d82f7
commit
9fbcb45171
|
@ -5,6 +5,7 @@
|
||||||
*.la
|
*.la
|
||||||
*.conf
|
*.conf
|
||||||
.deps
|
.deps
|
||||||
|
.dirstamp
|
||||||
.libs
|
.libs
|
||||||
|
|
||||||
# generated files
|
# generated files
|
||||||
|
@ -33,6 +34,13 @@ Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
m4
|
m4
|
||||||
|
|
||||||
|
# autotest
|
||||||
|
test/package.m4
|
||||||
|
test/atconfig
|
||||||
|
test/testsuite
|
||||||
|
test/testsuite.dir/
|
||||||
|
test/testsuite.log
|
||||||
|
|
||||||
# executables
|
# executables
|
||||||
lib/core/test/testcore
|
lib/core/test/testcore
|
||||||
test/testvolte
|
test/testvolte
|
||||||
|
@ -58,3 +66,7 @@ debian/nextepc-sgw
|
||||||
debian/nextepc-pgw
|
debian/nextepc-pgw
|
||||||
debian/nextepc-pcrf
|
debian/nextepc-pcrf
|
||||||
debian/nextepc-hss
|
debian/nextepc-hss
|
||||||
|
|
||||||
|
# webui
|
||||||
|
webui/.next/
|
||||||
|
webui/node_modules/
|
||||||
|
|
|
@ -17,6 +17,7 @@ CORE_CONFIG_NICE(config.nice)
|
||||||
|
|
||||||
dnl Must come before AM_INIT_AUTOMAKE.
|
dnl Must come before AM_INIT_AUTOMAKE.
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
|
AC_CONFIG_TESTDIR(test)
|
||||||
AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects])
|
AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects])
|
||||||
|
|
||||||
# Where to generate output; srcdir location.
|
# Where to generate output; srcdir location.
|
||||||
|
|
|
@ -58,7 +58,8 @@ status_t context_read_file()
|
||||||
d_assert(config->path, return CORE_ERROR,);
|
d_assert(config->path, return CORE_ERROR,);
|
||||||
|
|
||||||
file = fopen(config->path, "rb");
|
file = fopen(config->path, "rb");
|
||||||
d_assert(file, return CORE_ERROR,);
|
d_assert(file, return CORE_ERROR,
|
||||||
|
"Failed to read configuration file `%s`", config->path);
|
||||||
|
|
||||||
d_assert(yaml_parser_initialize(&parser), return CORE_ERROR,);
|
d_assert(yaml_parser_initialize(&parser), return CORE_ERROR,);
|
||||||
yaml_parser_set_input_file(&parser, file);
|
yaml_parser_set_input_file(&parser, file);
|
||||||
|
|
|
@ -12,9 +12,6 @@ testepc_SOURCES = \
|
||||||
security_test.c s1setup_test.c attach_test.c volte_test.c handover_test.c \
|
security_test.c s1setup_test.c attach_test.c volte_test.c handover_test.c \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
check-local: testepc
|
|
||||||
./testepc -f sample.conf
|
|
||||||
|
|
||||||
testvolte_SOURCES = \
|
testvolte_SOURCES = \
|
||||||
abts.h abts.c testpacket.h testpacket.c \
|
abts.h abts.c testpacket.h testpacket.c \
|
||||||
volte/testutil.h volte/testutil.c \
|
volte/testutil.h volte/testutil.c \
|
||||||
|
@ -50,7 +47,44 @@ DEFS = \
|
||||||
-DFD_EXT_DIR=\"$(abs_top_builddir)/lib/@FREEDIAMETER_DIR@/extensions\" \
|
-DFD_EXT_DIR=\"$(abs_top_builddir)/lib/@FREEDIAMETER_DIR@/extensions\" \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
TESTS = testvolte
|
TESTSUITE = $(srcdir)/testsuite
|
||||||
|
|
||||||
|
check-local: atconfig $(TESTSUITE)
|
||||||
|
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
|
||||||
|
|
||||||
|
installcheck-local: atconfig $(TESTSUITE)
|
||||||
|
$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
|
||||||
|
$(TESTSUITEFLAGS)
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
test ! -f '$(TESTSUITE)' || \
|
||||||
|
$(SHELL) '$(TESTSUITE)' --clean
|
||||||
|
|
||||||
|
AUTOM4TE = $(SHELL) $(top_srcdir)/build-aux/missing --run autom4te
|
||||||
|
AUTOTEST = $(AUTOM4TE) --language=autotest
|
||||||
|
$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4
|
||||||
|
$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
# The `:;' works around a Bash 3.2 bug when the output is not writeable.
|
||||||
|
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
|
||||||
|
:;{ \
|
||||||
|
echo '# Signature of the current package.' && \
|
||||||
|
echo 'm4_define([AT_PACKAGE_NAME],' && \
|
||||||
|
echo ' [$(PACKAGE_NAME)])' && \
|
||||||
|
echo 'm4_define([AT_PACKAGE_TARNAME],' && \
|
||||||
|
echo ' [$(PACKAGE_TARNAME)])' && \
|
||||||
|
echo 'm4_define([AT_PACKAGE_VERSION],' && \
|
||||||
|
echo ' [$(PACKAGE_VERSION)])' && \
|
||||||
|
echo 'm4_define([AT_PACKAGE_STRING],' && \
|
||||||
|
echo ' [$(PACKAGE_STRING)])' && \
|
||||||
|
echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \
|
||||||
|
echo ' [$(PACKAGE_BUGREPORT)])'; \
|
||||||
|
echo 'm4_define([AT_PACKAGE_URL],' && \
|
||||||
|
echo ' [$(PACKAGE_URL)])'; \
|
||||||
|
} >'$(srcdir)/package.m4'
|
||||||
|
|
||||||
|
EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE)
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = Makefile.in
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
MOSTLYCLEANFILES = core *.stackdump testepc.log testepc.trs
|
MOSTLYCLEANFILES = core *.stackdump
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
AT_INIT
|
||||||
|
AT_BANNER([NextEPC Amazing Tests.])
|
||||||
|
|
||||||
|
|
||||||
|
AT_SETUP([basic])
|
||||||
|
AT_KEYWORDS([basic])
|
||||||
|
AT_CHECK_UNQUOTED(
|
||||||
|
[$abs_top_builddir/test/testepc -f $abs_top_builddir/test/sample.conf],
|
||||||
|
[0], [dnl
|
||||||
|
MongoDB URI : 'mongodb://localhost/nextepc'
|
||||||
|
Configuration : '$abs_top_builddir/test/sample.conf'
|
||||||
|
s1ap_message_test : SUCCESS
|
||||||
|
nas_message_test : SUCCESS
|
||||||
|
gtp_message_test : SUCCESS
|
||||||
|
security_test : SUCCESS
|
||||||
|
s1setup_test : SUCCESS
|
||||||
|
attach_test : SUCCESS
|
||||||
|
volte_test : SUCCESS
|
||||||
|
handover_test : SUCCESS
|
||||||
|
All tests passed.
|
||||||
|
])
|
||||||
|
AT_CLEANUP
|
||||||
|
|
||||||
|
AT_SETUP([volte])
|
||||||
|
AT_KEYWORDS([volte])
|
||||||
|
AT_CHECK_UNQUOTED(
|
||||||
|
[$abs_top_builddir/test/testvolte -f $abs_top_builddir/test/sample-volte.conf],
|
||||||
|
[0], [dnl
|
||||||
|
MongoDB URI : 'mongodb://localhost/nextepc'
|
||||||
|
Configuration : '$abs_top_builddir/test/sample-volte.conf'
|
||||||
|
volte_test : SUCCESS
|
||||||
|
All tests passed.
|
||||||
|
])
|
||||||
|
AT_CLEANUP
|
|
@ -50,10 +50,10 @@ static void test_fd_logger_handler(enum fd_hook_type type, struct msg * msg,
|
||||||
|
|
||||||
void test_terminate(void)
|
void test_terminate(void)
|
||||||
{
|
{
|
||||||
d_trace_global_on();
|
|
||||||
|
|
||||||
testpacket_final();
|
testpacket_final();
|
||||||
app_terminate();
|
app_terminate();
|
||||||
|
|
||||||
|
d_trace_global_on();
|
||||||
core_terminate();
|
core_terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -902,8 +902,6 @@ void pcscf_fd_config()
|
||||||
fd_config.cnf_flags.no_sctp = 1;
|
fd_config.cnf_flags.no_sctp = 1;
|
||||||
fd_config.cnf_addr = "127.0.0.1";
|
fd_config.cnf_addr = "127.0.0.1";
|
||||||
|
|
||||||
printf("%s\n", FD_EXT_DIR);
|
|
||||||
|
|
||||||
fd_config.ext[fd_config.num_of_ext].module =
|
fd_config.ext[fd_config.num_of_ext].module =
|
||||||
FD_EXT_DIR "/dbg_msg_dumps/.libs/dbg_msg_dumps.so";
|
FD_EXT_DIR "/dbg_msg_dumps/.libs/dbg_msg_dumps.so";
|
||||||
fd_config.ext[fd_config.num_of_ext].conf = "0x8888";
|
fd_config.ext[fd_config.num_of_ext].conf = "0x8888";
|
||||||
|
|
|
@ -49,11 +49,11 @@ static void test_fd_logger_handler(enum fd_hook_type type, struct msg * msg,
|
||||||
|
|
||||||
void test_terminate(void)
|
void test_terminate(void)
|
||||||
{
|
{
|
||||||
d_trace_global_on();
|
|
||||||
|
|
||||||
pcscf_fd_final();
|
pcscf_fd_final();
|
||||||
testpacket_final();
|
testpacket_final();
|
||||||
test_app_terminate();
|
test_app_terminate();
|
||||||
|
|
||||||
|
d_trace_global_on();
|
||||||
core_terminate();
|
core_terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue