diff options
| author | Lorenzo Colitti <lorenzo@google.com> | 2017-04-26 16:30:39 +0900 |
|---|---|---|
| committer | Lorenzo Colitti <lorenzo@google.com> | 2017-04-28 00:12:12 +0900 |
| commit | a1611964d39521e20d92f6622da6c06d3ce91fba (patch) | |
| tree | 656eb82d9dbf012e5a1156948c28284918e0b71b /server/FirewallControllerTest.cpp | |
| parent | dd9a54b0ae0945c0f90a4893ef3ba216ff1f4ff0 (diff) | |
Move enableChildChains to iptables-restore.
This saves 100-200ms on boot.
(cherry picked from commit 0b64071d1326214b83e7dfb90701a4ee14ab6036)
Bug: 37641280
Test: marlin builds and boots
Test: new unit test passes
Test: netd_{unit,integration}_test pass
Test: fw_dozable added/removed from fw_INPUT/fw_OUTPUT on "adb shell dumpsys deviceidle <force-idle|unforce>"
Change-Id: Iaa8daba011cf187d07526b2b85f9e9aba83adf4f
Merged-In: Iabd2fa6ea260495feee3335b1605f3699b1722c5
Diffstat (limited to 'server/FirewallControllerTest.cpp')
| -rw-r--r-- | server/FirewallControllerTest.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/server/FirewallControllerTest.cpp b/server/FirewallControllerTest.cpp index 1c3944ad..7f6f0ae0 100644 --- a/server/FirewallControllerTest.cpp +++ b/server/FirewallControllerTest.cpp @@ -196,16 +196,20 @@ TEST_F(FirewallControllerTest, TestReplaceBlacklistUidRule) { 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", + "*filter\n" + "-A fw_INPUT -j fw_dozable\n" + "-A fw_OUTPUT -j fw_dozable\n" + "COMMIT\n" }; EXPECT_EQ(0, mFw.enableChildChains(DOZABLE, true)); - expectIptablesCommands(expected); + expectIptablesRestoreCommands(expected); expected = { - "-t filter -D fw_INPUT -j fw_powersave", - "-t filter -D fw_OUTPUT -j fw_powersave", + "*filter\n" + "-D fw_INPUT -j fw_powersave\n" + "-D fw_OUTPUT -j fw_powersave\n" + "COMMIT\n" }; EXPECT_EQ(0, mFw.enableChildChains(POWERSAVE, false)); - expectIptablesCommands(expected); + expectIptablesRestoreCommands(expected); } |
