add a netmgr unit test

tests of UDP and TCP cases including:
- sending and receiving
- closure sockets without reading or sending
- closure of sockets at various points while sending and receiving
- since the teste is multithreaded, cmocka now aborts tests on the
  first failure, so that failures in subthreads are caught and
  reported correctly.
This commit is contained in:
Ondřej Surý 2020-10-27 17:12:41 +01:00 committed by Ondřej Surý
parent 26a3a22895
commit 14f54d13dc
4 changed files with 1219 additions and 0 deletions

View file

@ -39,6 +39,9 @@ variables:
BIND_INSTALL_PATH: "${CI_PROJECT_DIR}/.local"
# In multithreaded unit tests, abort on the first failure
CMOCKA_TEST_ABORT: 1
stages:
- autoconf
- precheck

View file

@ -29,6 +29,7 @@ check_PROGRAMS = \
md_test \
mem_test \
netaddr_test \
netmgr_test \
parse_test \
pool_test \
quota_test \
@ -68,6 +69,14 @@ random_test_LDADD = \
$(LDADD) \
-lm
netmgr_test_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(LIBUV_CFLAGS)
netmgr_test_LDADD = \
$(LDADD) \
$(LIBUV_LIBS)
unit-local: check
EXTRA_DIST = testdata

1206
lib/isc/tests/netmgr_test.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -1938,6 +1938,7 @@
./lib/isc/tests/md_test.c C 2018,2019,2020
./lib/isc/tests/mem_test.c C 2015,2016,2017,2018,2019,2020
./lib/isc/tests/netaddr_test.c C 2016,2018,2019,2020
./lib/isc/tests/netmgr_test.c C 2020
./lib/isc/tests/parse_test.c C 2012,2013,2016,2018,2019,2020
./lib/isc/tests/pool_test.c C 2013,2016,2018,2019,2020
./lib/isc/tests/quota_test.c C 2020