Run testExcludedRoutesDisabled only in APKs with target SDK < T.
This test crashes if run from an APK that has target SDK 33 or above because it tries to disable a compat change that on those SDK versions is enabled by default. Run it only in CtsNetTestCasesMaxTargetSdk31 and skip it in our regular CTS modules. Bug: 233553525 Test: test-only change Change-Id: Iaf9c46591c13505c9d2a2a09994b9ee22a22390c
This commit is contained in:
@@ -46,6 +46,7 @@ import com.android.testutils.ConnectivityModuleTest;
|
||||
import com.android.testutils.DevSdkIgnoreRule;
|
||||
import com.android.testutils.DevSdkIgnoreRule.IgnoreAfter;
|
||||
import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo;
|
||||
import com.android.testutils.filters.CtsNetTestCasesMaxTargetSdk31;
|
||||
|
||||
import libcore.junit.util.compat.CoreCompatChangeRule.DisableCompatChanges;
|
||||
import libcore.junit.util.compat.CoreCompatChangeRule.EnableCompatChanges;
|
||||
@@ -1307,6 +1308,7 @@ public class LinkPropertiesTest {
|
||||
}
|
||||
|
||||
@Test @IgnoreUpTo(SC_V2)
|
||||
@CtsNetTestCasesMaxTargetSdk31(reason = "Compat change cannot be overridden on T or above")
|
||||
@DisableCompatChanges({LinkProperties.EXCLUDED_ROUTES})
|
||||
public void testExcludedRoutesDisabled() {
|
||||
final LinkProperties lp = new LinkProperties();
|
||||
|
||||
Reference in New Issue
Block a user