Add TEST_MAPPING for network policy related logic.
TEST_MAPPING is included to run network policy related CTS and unit tests in presubmit whenever network policy related code changes. Bug: 142080863 Bug: 137859686 Test: manual Test: atest --test-mapping services/core/java/com/android/server/net/ Change-Id: I894b21716cd301416890a3a65751808c50e17842
This commit is contained in:
@@ -364,7 +364,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
|
||||
"com.android.server.net.action.SNOOZE_RAPID";
|
||||
|
||||
/**
|
||||
* Indicates the maximum wait time for admin data to be available;
|
||||
* Indicates the maximum wait time for admin data to be available.
|
||||
*/
|
||||
private static final long WAIT_FOR_ADMIN_DATA_TIMEOUT_MS = 10_000;
|
||||
|
||||
|
||||
31
services/core/java/com/android/server/net/TEST_MAPPING
Normal file
31
services/core/java/com/android/server/net/TEST_MAPPING
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"presubmit": [
|
||||
{
|
||||
"name": "CtsHostsideNetworkTests",
|
||||
"file_patterns": ["(/|^)NetworkPolicy[^/]*\\.java"],
|
||||
"options": [
|
||||
{
|
||||
"include-filter": "com.android.cts.net.HostsideRestrictBackgroundNetworkTests"
|
||||
},
|
||||
{
|
||||
"exclude-annotation": "androidx.test.filters.FlakyTest"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "FrameworksServicesTests",
|
||||
"file_patterns": ["(/|^)NetworkPolicy[^/]*\\.java"],
|
||||
"options": [
|
||||
{
|
||||
"include-filter": "com.android.server.net."
|
||||
},
|
||||
{
|
||||
"include-annotation": "android.platform.test.annotations.Presubmit"
|
||||
},
|
||||
{
|
||||
"exclude-annotation": "androidx.test.filters.FlakyTest"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -121,6 +121,7 @@ import android.os.RemoteException;
|
||||
import android.os.SimpleClock;
|
||||
import android.os.SystemClock;
|
||||
import android.os.UserHandle;
|
||||
import android.platform.test.annotations.Presubmit;
|
||||
import android.telephony.CarrierConfigManager;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.SubscriptionPlan;
|
||||
@@ -195,6 +196,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@MediumTest
|
||||
@Presubmit
|
||||
public class NetworkPolicyManagerServiceTest {
|
||||
private static final String TAG = "NetworkPolicyManagerServiceTest";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user