opnsense-src/tests/sys/netinet/libalias/Makefile
Lutz Donnerhacke 488f39f355 tests/libalias: Test LibAliasIn and redirection
Rework the tests to check the correct layer in a single test. Factor
out tests for reuse in other modules. Extend the test suite for
libalias(3) to incoming connections. Test the various types of
redirections.

gettimeofday(3) is almost as expensive as the calls to libalias.
So the call frequency for this call is reduced by a factor of 1000 in
order to neglect it's influence.

Using NAT entries became more realistic: A communication of a random
length of up to 150 packets (10% outgoing, 90% incoming) is applied
for each entry.

Add port forwardings to the performance tests.  This will cause random
incoming packets to match the random port forwardings opends beforehand.

After a long test run, a lot of ressouces have been allocated.
Measure the time tot free them.

Reviewed by:	kp (partially)
Differential Revision: https://reviews.freebsd.org/D30412
Differential Revision: https://reviews.freebsd.org/D30408
Differential Revision: https://reviews.freebsd.org/D30405
Differential Revision: https://reviews.freebsd.org/D30443

(cherry picked from commit f1462ab051)
(cherry picked from commit 755bab6d55)
(cherry picked from commit 6e87898a2c)
(cherry picked from commit d62e1ecba0)
(cherry picked from commit 5434ebd256)

Fix various bugs:
(cherry picked from commit ccac04cae5)
(cherry picked from commit 7b8696bf12)
(cherry picked from commit fef99da69f)
(cherry picked from commit f4c460dacd)
2021-06-02 11:35:09 +02:00

33 lines
485 B
Makefile

# $FreeBSD$
PACKAGE= tests
TESTSDIR= ${TESTSBASE}/sys/netinet/libalias
BINDIR= ${TESTSDIR}
ATF_TESTS_C+= 1_instance \
2_natout \
3_natin \
PROGS+= perf
LIBADD+= alias
SRCS.1_instance=1_instance.c util.c
SRCS.2_natout= 2_natout.c util.c
SRCS.3_natin= 3_natin.c util.c
SRCS.perf= perf.c util.c
.include <bsd.test.mk>
#
# Testing during development
#
test: all
cd ${.OBJDIR}; kyua test
report:
cd ${.OBJDIR}; kyua report
report-v:
cd ${.OBJDIR}; kyua report --verbose