diff options
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) { |
