Add CtsNetTestCasesLatestSdk to postsubmit
Also exclude some tests that cannot run on cuttlefish. This is a first step to add the suite to presubmit. Having the test in presubmit is essential to avoid regressions and keep it passing. Bug: 158153057 Test: m CtsNetTestCases; this patch will provide postsubmit results Change-Id: I48b2b5490d3fd5eb6f9456825c11f3fee0ec5b67
This commit is contained in:
parent
7deca3e618
commit
f33b6ea261
4 changed files with 23 additions and 0 deletions
|
|
@ -82,6 +82,7 @@ android_test {
|
|||
min_sdk_version: "29",
|
||||
target_sdk_version: "29",
|
||||
test_suites: [
|
||||
"device-tests",
|
||||
"mts",
|
||||
],
|
||||
test_config_template: "AndroidTestTemplate.xml",
|
||||
|
|
|
|||
13
tests/cts/net/TEST_MAPPING
Normal file
13
tests/cts/net/TEST_MAPPING
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
// TODO: move to mainline-presubmit once supported
|
||||
"postsubmit": [
|
||||
{
|
||||
"name": "CtsNetTestCasesLatestSdk",
|
||||
"options": [
|
||||
{
|
||||
"exclude-annotation": "com.android.testutils.SkipPresubmit"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -96,6 +96,7 @@ import androidx.test.InstrumentationRegistry;
|
|||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.testutils.SkipPresubmit;
|
||||
|
||||
import libcore.io.Streams;
|
||||
|
||||
|
|
@ -325,6 +326,7 @@ public class ConnectivityManagerTest {
|
|||
*/
|
||||
@AppModeFull(reason = "Cannot get WifiManager in instant app mode")
|
||||
@Test
|
||||
@SkipPresubmit(reason = "Virtual devices use a single internet connection for all networks")
|
||||
public void testOpenConnection() throws Exception {
|
||||
boolean canRunTest = mPackageManager.hasSystemFeature(FEATURE_WIFI)
|
||||
&& mPackageManager.hasSystemFeature(FEATURE_TELEPHONY);
|
||||
|
|
@ -990,6 +992,7 @@ public class ConnectivityManagerTest {
|
|||
|
||||
@AppModeFull(reason = "Cannot get WifiManager in instant app mode")
|
||||
@Test
|
||||
@SkipPresubmit(reason = "Keepalive is not supported on virtual hardware")
|
||||
public void testCreateTcpKeepalive() throws Exception {
|
||||
if (!mPackageManager.hasSystemFeature(FEATURE_WIFI)) {
|
||||
Log.i(TAG, "testCreateTcpKeepalive cannot execute unless device supports WiFi");
|
||||
|
|
@ -1199,6 +1202,7 @@ public class ConnectivityManagerTest {
|
|||
*/
|
||||
@AppModeFull(reason = "Cannot get WifiManager in instant app mode")
|
||||
@Test
|
||||
@SkipPresubmit(reason = "Keepalive is not supported on virtual hardware")
|
||||
public void testSocketKeepaliveLimitWifi() throws Exception {
|
||||
if (!mPackageManager.hasSystemFeature(FEATURE_WIFI)) {
|
||||
Log.i(TAG, "testSocketKeepaliveLimitWifi cannot execute unless device"
|
||||
|
|
@ -1252,6 +1256,7 @@ public class ConnectivityManagerTest {
|
|||
*/
|
||||
@AppModeFull(reason = "Cannot request network in instant app mode")
|
||||
@Test
|
||||
@SkipPresubmit(reason = "Keepalive is not supported on virtual hardware")
|
||||
public void testSocketKeepaliveLimitTelephony() throws Exception {
|
||||
if (!mPackageManager.hasSystemFeature(FEATURE_TELEPHONY)) {
|
||||
Log.i(TAG, "testSocketKeepaliveLimitTelephony cannot execute unless device"
|
||||
|
|
@ -1294,6 +1299,7 @@ public class ConnectivityManagerTest {
|
|||
*/
|
||||
@AppModeFull(reason = "Cannot get WifiManager in instant app mode")
|
||||
@Test
|
||||
@SkipPresubmit(reason = "Keepalive is not supported on virtual hardware")
|
||||
public void testSocketKeepaliveUnprivileged() throws Exception {
|
||||
if (!mPackageManager.hasSystemFeature(FEATURE_WIFI)) {
|
||||
Log.i(TAG, "testSocketKeepaliveUnprivileged cannot execute unless device"
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ import android.os.SystemClock;
|
|||
import android.test.AndroidTestCase;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.testutils.SkipPresubmit;
|
||||
|
||||
import java.net.Inet4Address;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.InetAddress;
|
||||
|
|
@ -68,6 +70,7 @@ public class DnsTest extends AndroidTestCase {
|
|||
* Perf - measure size of first and second tier caches and their effect
|
||||
* Assert requires network permission
|
||||
*/
|
||||
@SkipPresubmit(reason = "IPv6 support may be missing on presubmit virtual hardware")
|
||||
public void testDnsWorks() throws Exception {
|
||||
ensureIpv6Connectivity();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue