Commit e600ba71 authored by Jussi Laakkonen's avatar Jussi Laakkonen

[connman] Add tests for managed iptables rules. JB#42675

Tests for the managed iptables rules read from firewall.conf are added
in this commit. The tests include installing a new set of rules using a
temporary firewall.conf (set in /tmp/connman_test), checking that rules
exist, checking that rules are added and removed when services go up and
down and that iptables is cleaned up properly after shutting down
(cleanup calls to iptables.c and firewall.c).

Also some invalid rules are checked. This list could be expanded later.

The temporary firewall.conf and the directory will be after tests
parent 5864fb03
......@@ -210,6 +210,8 @@ storageroot = $(localstatedir)/lib
configdir = ${sysconfdir}/connman
testconfigdir = "/tmp/connman_test"
if VPN
build_vpn_plugindir = $(abs_top_srcdir)/vpn/plugins/.libs
......@@ -419,8 +421,7 @@ tools_dbus_test_LDADD = gdbus/ @GLIB_LIBS@ @DBUS_LIBS@
tools_polkit_test_LDADD = @DBUS_LIBS@
tools_iptables_test_CFLAGS = -DDEFAULT_STORAGE_ROOT=\""$(storageroot)\"" \
tools_iptables_test_CFLAGS = -DDEFAULT_STORAGE_ROOT=\""$(storageroot)\"" @DBUS_CFLAGS@
tools_iptables_test_SOURCES = $(backtrace_sources) src/log.c src/storage.c \
src/inotify.c src/iptables.c tools/iptables-test.c
tools_iptables_test_LDADD = @GLIB_LIBS@ @XTABLES_LIBS@ @LIBIPTC_LIBS@ @DBUS_LIBS@ -ldl
......@@ -442,7 +443,7 @@ tools_iptables_unit_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
-DDEFAULT_STORAGE_ROOT=\""$(storageroot)\"" \
tools_iptables_unit_SOURCES = $(backtrace_sources) src/log.c src/storage.c \
src/inotify.c src/iptables.c src/firewall.c \
src/nat.c tools/iptables-unit.c
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