Commit 62e0ea68 authored by Jussi Laakkonen's avatar Jussi Laakkonen

[unit] Add unit test for iptables.c longjmp() use. JB#43924

This adds a unit test to run at build for testing longjmp() use in
iptables.c. The tests test both cases to 1) handle longjmp() when
setjmp() was properly called to save env and 2) exit() when longjmp() is
called via xtables exit_err() from a location that normally does not
call it.
parent 9a3876f6
......@@ -77,6 +77,7 @@ unit/test-vpn-settings
unit/test-sailfish_iptables_ext
unit/test-firewall
unit/test-globalproxy
unit/test-iptables
*.gcda
*.gcno
......
......@@ -296,7 +296,7 @@ endif
noinst_PROGRAMS += unit/test-access unit/test-ippool \
unit/test-sailfish_access unit/test-vpn-settings \
unit/test-sailfish_iptables_ext unit/test-service \
unit/test-globalproxy unit/test-firewall
unit/test-globalproxy unit/test-firewall unit/test-iptables
if TEST_COVERAGE
COVERAGE_OPT = --coverage
......@@ -375,10 +375,15 @@ unit_test_firewall_SOURCES = $(backtrace_sources) src/connman.h src/log.c \
src/firewall.c unit/test-firewall.c
unit_test_firewall_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ -ldl
unit_test_iptables_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS) @GLIB_CFLAGS@
unit_test_iptables_SOURCES = $(backtrace_sources) src/connman.h src/log.c \
unit/test-iptables.c src/iptables.c
unit_test_iptables_LDADD = @GLIB_LIBS@ -ldl
TESTS = unit/test-access unit/test-ippool \
unit/test-sailfish_access unit/test-vpn-settings \
unit/test-sailfish_iptables_ext unit/test-service \
unit/test-globalproxy unit/test-firewall
unit/test-globalproxy unit/test-firewall unit/test-iptables
if SAILFISH_WAKEUP_TIMER
unit_test_sailfish_wakeup_timer_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
......
......@@ -10,6 +10,7 @@ TESTS="test-access \
test-firewall \
test-globalproxy \
test-ippool \
test-iptables \
test-sailfish_access \
test-sailfish_iptables_ext \
test-sailfish_wakeup_timer \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment