From 161b70c587435cdf2607b0f1856f2e5d1134f83b Mon Sep 17 00:00:00 2001 From: Xiao Ma Date: Thu, 1 Jun 2023 13:36:46 +0900 Subject: [PATCH] Add NetworkStackModuleTest annotation on the specific test case. EthernetTetheringTest#testTetherZeroLengthDhcpPacket requires the latest NetworkStack module, otherwise, the test will fail due to the loss of the fix. Apply @NetworkStackModuleTest to exclude this testcase from target test suite CtsTetheringTestLatestSdk. Bug: 283200648 Test: atest CtsTetheringTestLatestSdk Change-Id: Iebfb043e2b71427a6feaf90788fe79b6ab6b678d --- TEST_MAPPING | 16 +++++++++++++--- .../src/android/net/EthernetTetheringTest.java | 3 +++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/TEST_MAPPING b/TEST_MAPPING index c1d6a89356..0326bf25af 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -226,7 +226,12 @@ ] }, { - "name": "CtsTetheringTestLatestSdk[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]" + "name": "CtsTetheringTestLatestSdk[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]", + "options": [ + { + "exclude-annotation": "com.android.testutils.NetworkStackModuleTest" + } + ] } ], "mainline-postsubmit": [ @@ -236,8 +241,13 @@ "keywords": ["sim"] }, { - "name": "CtsTetheringTestLatestSdk[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]", - "keywords": ["sim"] + "name": "CtsTetheringTestLatestSdk[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]", + "keywords": ["sim"], + "options": [ + { + "exclude-annotation": "com.android.testutils.NetworkStackModuleTest" + } + ] } ], "imports": [ diff --git a/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java b/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java index 4ee5c429c9..5d57aa5062 100644 --- a/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java +++ b/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java @@ -65,6 +65,7 @@ import com.android.net.module.util.structs.Ipv4Header; import com.android.net.module.util.structs.UdpHeader; import com.android.testutils.DevSdkIgnoreRule; import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo; +import com.android.testutils.NetworkStackModuleTest; import com.android.testutils.TapPacketReader; import org.junit.Rule; @@ -860,6 +861,8 @@ public class EthernetTetheringTest extends EthernetTetheringTestBase { (byte) 0x00, (byte) 0x08, (byte) 0x3a, (byte) 0xdf }; + // This test requires the update in NetworkStackModule(See b/269692093). + @NetworkStackModuleTest @Test public void testTetherZeroLengthDhcpPacket() throws Exception { final TetheringTester tester = initTetheringTester(toList(TEST_IP4_ADDR),