Split testFirewallBlocking to tests for each chain
Bug: 271232428
Test: atest CtsNetTestCases
Change-Id: Ib49a2fc566066ea2b33d52e1f0d6a0c0e02fbb00
diff --git a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
index 0bb6000..1bed83d 100644
--- a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
+++ b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
@@ -3406,6 +3406,9 @@
private static final boolean EXPECT_PASS = false;
private static final boolean EXPECT_BLOCK = true;
+
+ // ALLOWLIST means the firewall denies all by default, uids must be explicitly allowed
+ // DENYLIST means the firewall allows all by default, uids must be explicitly denyed
private static final boolean ALLOWLIST = true;
private static final boolean DENYLIST = false;
@@ -3471,17 +3474,49 @@
@Test @IgnoreUpTo(SC_V2) @ConnectivityModuleTest
@AppModeFull(reason = "Socket cannot bind in instant app mode")
- public void testFirewallBlocking() {
- // ALLOWLIST means the firewall denies all by default, uids must be explicitly allowed
+ public void testFirewallBlockingDozable() {
doTestFirewallBlocking(FIREWALL_CHAIN_DOZABLE, ALLOWLIST);
- doTestFirewallBlocking(FIREWALL_CHAIN_POWERSAVE, ALLOWLIST);
- doTestFirewallBlocking(FIREWALL_CHAIN_RESTRICTED, ALLOWLIST);
- doTestFirewallBlocking(FIREWALL_CHAIN_LOW_POWER_STANDBY, ALLOWLIST);
+ }
- // DENYLIST means the firewall allows all by default, uids must be explicitly denyed
+ @Test @IgnoreUpTo(SC_V2) @ConnectivityModuleTest
+ @AppModeFull(reason = "Socket cannot bind in instant app mode")
+ public void testFirewallBlockingPowersave() {
+ doTestFirewallBlocking(FIREWALL_CHAIN_POWERSAVE, ALLOWLIST);
+ }
+
+ @Test @IgnoreUpTo(SC_V2) @ConnectivityModuleTest
+ @AppModeFull(reason = "Socket cannot bind in instant app mode")
+ public void testFirewallBlockingRestricted() {
+ doTestFirewallBlocking(FIREWALL_CHAIN_RESTRICTED, ALLOWLIST);
+ }
+
+ @Test @IgnoreUpTo(SC_V2) @ConnectivityModuleTest
+ @AppModeFull(reason = "Socket cannot bind in instant app mode")
+ public void testFirewallBlockingLowPowerStandby() {
+ doTestFirewallBlocking(FIREWALL_CHAIN_LOW_POWER_STANDBY, ALLOWLIST);
+ }
+
+ @Test @IgnoreUpTo(SC_V2) @ConnectivityModuleTest
+ @AppModeFull(reason = "Socket cannot bind in instant app mode")
+ public void testFirewallBlockingStandby() {
doTestFirewallBlocking(FIREWALL_CHAIN_STANDBY, DENYLIST);
+ }
+
+ @Test @IgnoreUpTo(SC_V2) @ConnectivityModuleTest
+ @AppModeFull(reason = "Socket cannot bind in instant app mode")
+ public void testFirewallBlockingOemDeny1() {
doTestFirewallBlocking(FIREWALL_CHAIN_OEM_DENY_1, DENYLIST);
+ }
+
+ @Test @IgnoreUpTo(SC_V2) @ConnectivityModuleTest
+ @AppModeFull(reason = "Socket cannot bind in instant app mode")
+ public void testFirewallBlockingOemDeny2() {
doTestFirewallBlocking(FIREWALL_CHAIN_OEM_DENY_2, DENYLIST);
+ }
+
+ @Test @IgnoreUpTo(SC_V2) @ConnectivityModuleTest
+ @AppModeFull(reason = "Socket cannot bind in instant app mode")
+ public void testFirewallBlockingOemDeny3() {
doTestFirewallBlocking(FIREWALL_CHAIN_OEM_DENY_3, DENYLIST);
}