diff options
| author | Lorenzo Colitti <lorenzo@google.com> | 2017-07-06 17:25:37 +0900 |
|---|---|---|
| committer | Lorenzo Colitti <lorenzo@google.com> | 2017-07-06 18:24:39 +0900 |
| commit | e85ffe1f7f97fb7f2c60e237167b090d3aa85a80 (patch) | |
| tree | e3c5eb88e6bf01c4ae1cf1c6de72ad215d7e79dc /server/BandwidthControllerTest.cpp | |
| parent | 3807822116411fbb9b054d29988064e62a0c8a52 (diff) | |
Switch costly alerts to iptables-restore.
Costly alerts appear to be currently unused, but they are the
last user of iptables commands in BandwidthController, so
migrating them to iptables-restore will allow us to delete
the iptables-specific code in BandwidthController.
Bug: 28362720
Test: netd_{unit,integration}_test pass
Change-Id: I07c6df6df347fd6485e6d0740b7d6165a423e34b
Diffstat (limited to 'server/BandwidthControllerTest.cpp')
| -rw-r--r-- | server/BandwidthControllerTest.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/server/BandwidthControllerTest.cpp b/server/BandwidthControllerTest.cpp index becfe49b..066f9ebc 100644 --- a/server/BandwidthControllerTest.cpp +++ b/server/BandwidthControllerTest.cpp @@ -585,24 +585,28 @@ TEST_F(BandwidthControllerTest, CostlyAlert) { int64_t alertBytes = 0; std::vector<std::string> expected = { - "-A bw_costly_shared -m quota2 ! --quota 123456 --name sharedAlert\n", + "*filter\n" + "-A bw_costly_shared -m quota2 ! --quota 123456 --name sharedAlert\n" + "COMMIT\n" }; EXPECT_EQ(0, setCostlyAlert("shared", kQuota, &alertBytes)); EXPECT_EQ(kQuota, alertBytes); - expectIptablesCommands(expected); + expectIptablesRestoreCommands(expected); expected = {}; expectUpdateQuota(kQuota); EXPECT_EQ(0, setCostlyAlert("shared", kQuota + 1, &alertBytes)); EXPECT_EQ(kQuota + 1, alertBytes); - expectIptablesCommands(expected); + expectIptablesRestoreCommands(expected); expected = { + "*filter\n" "-D bw_costly_shared -m quota2 ! --quota 123457 --name sharedAlert\n" + "COMMIT\n" }; EXPECT_EQ(0, removeCostlyAlert("shared", &alertBytes)); EXPECT_EQ(0, alertBytes); - expectIptablesCommands(expected); + expectIptablesRestoreCommands(expected); } TEST_F(BandwidthControllerTest, ManipulateSpecialApps) { |
