summaryrefslogtreecommitdiff
path: root/unit
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2013-02-12 10:19:53 +0100
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-02-12 12:34:54 +0200
commit660657415977d73451d81981290c9a922875c6e4 (patch)
tree55bf4d26d7f0ecbc23aff8a86b29709e44e61d6c /unit
parent65abac44bf5498ca5565835671226bb6ca45a7d1 (diff)
downloadconnman-660657415977d73451d81981290c9a922875c6e4.tar.gz
connman-660657415977d73451d81981290c9a922875c6e4.tar.bz2
connman-660657415977d73451d81981290c9a922875c6e4.zip
test-iptables: Add chain add remove tests
Diffstat (limited to 'unit')
-rw-r--r--unit/test-iptables.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/unit/test-iptables.c b/unit/test-iptables.c
index 4fb8059f..77fa50a9 100644
--- a/unit/test-iptables.c
+++ b/unit/test-iptables.c
@@ -84,6 +84,35 @@ static void test_iptables_chain2(void)
g_assert(err == 0);
}
+static void test_iptables_chain3(void)
+{
+ int err;
+
+ err = __connman_iptables_new_chain("filter", "user-chain-0");
+ g_assert(err == 0);
+
+ err = __connman_iptables_commit("filter");
+ g_assert(err == 0);
+
+ err = __connman_iptables_new_chain("filter", "user-chain-1");
+ g_assert(err == 0);
+
+ err = __connman_iptables_commit("filter");
+ g_assert(err == 0);
+
+ err = __connman_iptables_delete_chain("filter", "user-chain-1");
+ g_assert(err == 0);
+
+ err = __connman_iptables_commit("filter");
+ g_assert(err == 0);
+
+ err = __connman_iptables_delete_chain("filter", "user-chain-0");
+ g_assert(err == 0);
+
+ err = __connman_iptables_commit("filter");
+ g_assert(err == 0);
+}
+
static void test_iptables_rule0(void)
{
int err;
@@ -265,6 +294,7 @@ int main(int argc, char *argv[])
g_test_add_func("/iptables/chain0", test_iptables_chain0);
g_test_add_func("/iptables/chain1", test_iptables_chain1);
g_test_add_func("/iptables/chain2", test_iptables_chain2);
+ g_test_add_func("/iptables/chain3", test_iptables_chain3);
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);