diff options
| author | waynema <waynema@google.com> | 2021-12-01 10:30:31 +0800 |
|---|---|---|
| committer | waynema <waynema@google.com> | 2021-12-01 10:43:04 +0800 |
| commit | f61e444c24c1920c82fe859c5534dca2d6cc3347 (patch) | |
| tree | 7ab161ad22416fc762de4a78e3fa56ed89691777 /server/FirewallControllerTest.cpp | |
| parent | 98e1b88375f56d764b603da39f98ce5f62b0e556 (diff) | |
[NETD-TC#3] Delete TestSetStandbyRule, TestSetDozeRule and TestSetFirewallRule.
All tests set member variable mUseBpfOwnerMatch as false.
They call the function setUidRule() and not run eBPF code path.
In all tests they are used to test forming iptable rules.
Change-Id: I31426a73cda282a222e3ce5f71a7c3a318788ee2
Diffstat (limited to 'server/FirewallControllerTest.cpp')
| -rw-r--r-- | server/FirewallControllerTest.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/server/FirewallControllerTest.cpp b/server/FirewallControllerTest.cpp index f4a857c9..0b784055 100644 --- a/server/FirewallControllerTest.cpp +++ b/server/FirewallControllerTest.cpp @@ -51,54 +51,6 @@ protected: } }; -TEST_F(FirewallControllerTest, TestSetStandbyRule) { - ExpectedIptablesCommands expected = { - { V4V6, "*filter\n-D fw_standby -m owner --uid-owner 12345 -j DROP\nCOMMIT\n" } - }; - mFw.setUidRule(STANDBY, 12345, ALLOW); - expectIptablesRestoreCommands(expected); - - expected = { - { V4V6, "*filter\n-A fw_standby -m owner --uid-owner 12345 -j DROP\nCOMMIT\n" } - }; - mFw.setUidRule(STANDBY, 12345, DENY); - expectIptablesRestoreCommands(expected); -} - -TEST_F(FirewallControllerTest, TestSetDozeRule) { - ExpectedIptablesCommands expected = { - { V4V6, "*filter\n-I fw_dozable -m owner --uid-owner 54321 -j RETURN\nCOMMIT\n" } - }; - mFw.setUidRule(DOZABLE, 54321, ALLOW); - expectIptablesRestoreCommands(expected); - - expected = { - { V4V6, "*filter\n-D fw_dozable -m owner --uid-owner 54321 -j RETURN\nCOMMIT\n" } - }; - mFw.setUidRule(DOZABLE, 54321, DENY); - expectIptablesRestoreCommands(expected); -} - -TEST_F(FirewallControllerTest, TestSetFirewallRule) { - ExpectedIptablesCommands expected = { - { V4V6, "*filter\n" - "-A fw_INPUT -m owner --uid-owner 54321 -j DROP\n" - "-A fw_OUTPUT -m owner --uid-owner 54321 -j DROP\n" - "COMMIT\n" } - }; - mFw.setUidRule(NONE, 54321, DENY); - expectIptablesRestoreCommands(expected); - - expected = { - { V4V6, "*filter\n" - "-D fw_INPUT -m owner --uid-owner 54321 -j DROP\n" - "-D fw_OUTPUT -m owner --uid-owner 54321 -j DROP\n" - "COMMIT\n" } - }; - mFw.setUidRule(NONE, 54321, ALLOW); - expectIptablesRestoreCommands(expected); -} - TEST_F(FirewallControllerTest, TestReplaceAllowlistUidRule) { std::string expected = "*filter\n" |
