diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2013-02-12 10:19:51 +0100 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-02-12 12:34:48 +0200 |
commit | 836854599db7b31aeab6a72bf1c28e444e8c858a (patch) | |
tree | 923e6a2f1e21e350d4e0b99977171368d9106115 /unit | |
parent | 161efbae1a4d554d244c206d5cfa1342fc4220cf (diff) | |
download | connman-836854599db7b31aeab6a72bf1c28e444e8c858a.tar.gz connman-836854599db7b31aeab6a72bf1c28e444e8c858a.tar.bz2 connman-836854599db7b31aeab6a72bf1c28e444e8c858a.zip |
test-iptables: Add fallthrough unit test
A fallthrough rule is a one which does not have a verdict, e.g.
ACCEPT, DROP etc.
Diffstat (limited to 'unit')
-rw-r--r-- | unit/test-iptables.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/unit/test-iptables.c b/unit/test-iptables.c index e378a90b..4fb8059f 100644 --- a/unit/test-iptables.c +++ b/unit/test-iptables.c @@ -160,6 +160,24 @@ static void test_iptables_rule2(void) g_assert(err == 0); } +static void test_iptables_target0(void) +{ + int err; + + /* Test if 'fallthrough' targets work */ + + err = __connman_iptables_append("filter", "INPUT", + "-m mark --mark 1"); + g_assert(err == 0); + + err = __connman_iptables_append("filter", "INPUT", + "-m mark --mark 2"); + g_assert(err == 0); + + err = __connman_iptables_commit("filter"); + g_assert(err == 0); +} + struct connman_notifier *nat_notifier; struct connman_service { @@ -250,6 +268,7 @@ int main(int argc, char *argv[]) g_test_add_func("/iptables/rule0", test_iptables_rule0); g_test_add_func("/iptables/rule1", test_iptables_rule1); g_test_add_func("/iptables/rule2", test_iptables_rule2); + g_test_add_func("/iptables/target0", test_iptables_target0); g_test_add_func("/nat/basic0", test_nat_basic0); g_test_add_func("/nat/basic1", test_nat_basic1); |