summaryrefslogtreecommitdiff
path: root/server/FirewallControllerTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/FirewallControllerTest.cpp')
-rw-r--r--server/FirewallControllerTest.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/server/FirewallControllerTest.cpp b/server/FirewallControllerTest.cpp
index 5d2a012f..1c3944ad 100644
--- a/server/FirewallControllerTest.cpp
+++ b/server/FirewallControllerTest.cpp
@@ -193,3 +193,19 @@ TEST_F(FirewallControllerTest, TestReplaceBlacklistUidRule) {
std::vector<int32_t> uids = { 10023, 10059, 10124 };
EXPECT_EQ(expected, makeUidRules(V4 ,"FW_blackchain", false, uids));
}
+
+TEST_F(FirewallControllerTest, TestEnableChildChains) {
+ std::vector<std::string> expected = {
+ "-t filter -A fw_INPUT -j fw_dozable",
+ "-t filter -A fw_OUTPUT -j fw_dozable",
+ };
+ EXPECT_EQ(0, mFw.enableChildChains(DOZABLE, true));
+ expectIptablesCommands(expected);
+
+ expected = {
+ "-t filter -D fw_INPUT -j fw_powersave",
+ "-t filter -D fw_OUTPUT -j fw_powersave",
+ };
+ EXPECT_EQ(0, mFw.enableChildChains(POWERSAVE, false));
+ expectIptablesCommands(expected);
+}