diff --git a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java index 0bb6000cc9..1bed83dd98 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 @@ public class ConnectivityManagerTest { 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 @@ public class ConnectivityManagerTest { @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); }