Commit Graph

2968 Commits

Author SHA1 Message Date
paulhu
e3288fddcd Fix ConnectivityManagerApi23Test failures and remove duplication.
1. All ConnectivityManagerApi23Test were failed due to
   WifiManager#setWifiEnabled doesn't allow to use since
   Android Q. So we need to use shell command to enable/disable
   Wi-Fi instead.
2. Some methods are duplicated between
   ConnectivityManagerApi23Test and ConnectivityManagerTest, but
   they are not identical. So put these methods into
   ConnectivityUtils to clean up duplications and prevent fork
   happened again.

Bug: 133334943
Bug: 133209319
Test: Run the below tests on Crosshatch, Sailfish, Bonito.
      atest CtsNetApi23TestCases
      atest CtsNetTestCases

Change-Id: Ic37111cb12a46f5c36c2be887250c5d762216f6e
Merged-In: I075b7408d2a1e1145c7a9031075e07fa1db37fed
Merged-In: I0c02357eff07b98c1745de35d08ae6b8349de7fb
Merged-In: I04d1e1d096bcd4a9626cf9f00396fca7f9892a82
2019-05-30 01:25:20 +00:00
Benedict Wong
6d82630b8f Merge changes I3babc72d,I79d231e2
* changes:
  Fix IPsec CTS tests for interface address checking
  Convert IPsec tests to JUnit4
2019-05-28 21:44:06 +00:00
paulhu
5f7599b6d5 Ignore all tests in IpSecManagerTunnelTest with instant apps
Test runner will crash while tring to get test network service
in IpSecManagerTunnelTest. Because MANAGE_TEST_NETWORKS
permission can't be granted to instant apps. So ignore all tests
in this file.

Bug: 133399750
Test: atest CtsNetTestCases --instant
Change-Id: I5a096f20ec168133dbb65d27d3388c01e6ee895b
2019-05-24 11:37:37 +08:00
Benedict Wong
5c79356068 Fix IPsec CTS tests for interface address checking
Fixes two potentially device/kernel specific, or flaky bugs:
1. Java interface checking by name seems to cache the lookup, resulting
in interface address checks occasionally failing (on delete).
2. Link-local addresses appear to be added on all links for some set of
kernels and devices.

This patch addresses both by only checking that the requested address
was added via a address-based NetworkInterface lookup.

Bug: 72950854
Test: Ran on sargo-eng on qt-dev/HEAD
Test: Manually verified that the addresses are indeed added/removed
Change-Id: I3babc72dfe72337c4d68facb1695aec15e504c90
Merged-In: I3babc72dfe72337c4d68facb1695aec15e504c90
(cherry picked from commit 4af108aacf)
2019-05-22 11:08:26 -07:00
Benedict Wong
a8d59c0183 Convert IPsec tests to JUnit4
This patch fixes an incompatibility where some tests in the same
hierarchy were using Junit3, and other Junit4

No functional test changes made

Bug: 72950854
Test: Ran on devices, working
Change-Id: I79d231e202ba25ad5f57b44b387bebd7f012aa95
Merged-In: I79d231e202ba25ad5f57b44b387bebd7f012aa95
(cherry picked from commit 0d08e91fe7)
2019-05-22 11:08:26 -07:00
paulhu
435166fa86 Enable instant app mode for CtsNetTestCases
1. Indicating CtsNetTestCases support instant app mode but
   ignore some tests that cannot run in instant app mode.
2. Move some tests which need to test on API 23 into
   CtsNetApi23TestCases module due to instant app package
   must target at least API 26.

Bug: 123366918
Test: atest CtsNetTestCases --instant
Test: atest CtsNetApi23TestCases
Test: atest FrameworksNetTests

Change-Id: I4e828cbc48143e36c1be38b91c3c698122d4be5a
Merged-In: I1d78349d14763c133e1eab020d26865f46ff19a3
Merged-In: I931369875c86a396a898682009337cef1b918ba4
Merged-In: Ia8a45d6d751be94f9f707f879ea6ce4e6a45fae1
2019-05-22 01:11:10 +08:00
Xin Li
0f12601ff3 DO NOT MERGE - Merge pie-platform-release (PPRL.190505.001) into master.
Bug: 132622481
Change-Id: If0c7a9fe0a6f3b0abf65d60492c6b2d0a4ce8527
2019-05-15 16:55:12 -07:00
Xin Li
acd4822618 DO NOT MERGE - Merge pi-platform-release (PPRL.190505.001) into stage-aosp-master
Bug: 132622481
Change-Id: Idefc5f1ded84cc4621e3297b1f1e0894fd3bd9b3
2019-05-14 09:34:08 -07:00
Junyu Lai
3fc54a07ae Merge changes I60b9e9ae,I8be89116
am: c3db303f0b

Change-Id: I2b98b3083c33dfd7e9e4a204375433c116f84813
2019-05-13 07:19:21 -07:00
junyulai
80ec50b8ae add cts for unprivileged keepalive slots
Currently, unprivileged Nat-T keepalives are limited to 1 slot
per uid. Add CTS to verify that the keepalive slots are limited
as customized for unprivileged requests.

Bug: 129371366
Test: atest android.net.cts
      .ConnectivityManagerTest#testSocketKeepaliveUnprivileged
      --generate-new-metrics 10

Change-Id: I60b9e9ae9cf2b63490493ced9738cd2f402c3f9b
2019-05-13 18:10:36 +08:00
junyulai
b41bc72ea3 [KA14] add cts for keepalive limit test.
Per SDK requirement, OEM is required to support minimum number of
concurrent keepalives. Implement CTS to verify this.

Bug: 129371366
Test: atest android.net.cts
      .ConnectivityManagerTest#testSocketKeepaliveLimit
      --generate-new-metrics 10

Change-Id: I8be89116bed5c4dedb2ca42b6d633aa9e8c6a49a
2019-05-13 18:10:23 +08:00
Benedict Wong
ad380770a3 Merge "Enforce IPsec Tunnel mode for Android Q"
am: 81e51bce50

Change-Id: I6004a243d1840c5f89f400d8f5a3f682054ef12f
2019-05-10 10:57:35 -07:00
Benedict Wong
81e51bce50 Merge "Enforce IPsec Tunnel mode for Android Q" 2019-05-10 17:41:04 +00:00
Benedict Wong
084c8b47b6 Enforce IPsec Tunnel mode for Android Q
This commit adds a second condition to whether the device is expected to
have the tunnel mode feature. If a device's first API/launch version is
Q or above, require IPsec tunnels

Bug: 72950854
Test: Ran on device with first API level < Q and == Q.
Change-Id: I7b849ad24a04b6b7899a80f1856236b5ceb5a839
2019-05-10 01:22:13 -07:00
Xin Li
849c3a4352 [automerger skipped] Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master."
am: 8982cb36d7 -s ours
am skip reason: subject contains skip directive

Change-Id: Iab80c552f75d155db7c8b1e9408eb86dd56acaa3
2019-05-09 16:42:07 -07:00
Benedict Wong
df00896e14 Merge changes Ic4181fc8,Icffeed2e,I9fdba4a9
am: 54c0726220

Change-Id: I3a5a1a1ae0096eba2993798bf2707a8cfda81c97
2019-05-09 15:10:52 -07:00
Xin Li
8982cb36d7 Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master." 2019-05-09 22:05:51 +00:00
Benedict Wong
54c0726220 Merge changes Ic4181fc8,Icffeed2e,I9fdba4a9
* changes:
  Add IPsec Tunnel mode data tests
  Add utilities to generate packets
  Add TunUtils as utility to reflect packets
2019-05-09 20:51:01 +00:00
Benedict Wong
64e64ff454 Add IPsec Tunnel mode data tests
This change adds single-direction tests for the IPsec Tunnel Mode API.
In the outbound direction, TUNs are used to capture outgoing packets,
and values are inspected. In the inbound direction, packets are built
manually, using the PacketUtils framework. Additional testing for
end-to-end integration tests will follow in aosp/941021 using packet
reflection via the TUN.

Bug: 72950854
Test: This; passing
Change-Id: Ic4181fc857fa880db5553314efa914f870dbe87c
2019-05-09 11:25:15 -07:00
Benedict Wong
75fb3d002e Add utilities to generate packets
This change adds utility methods to generate packets incrementally. It
supports UDP, ESP, IPv4, IPv6 packet generation.

For ESP, it exclusively does AES-CBC, HMAC-SHA256.

Bug: 72950854
Test: This
Change-Id: Icffeed2ebb2005d79faf04f48fd5126d1d6fb175
2019-05-09 11:25:06 -07:00
Benedict Wong
0086fba2bf Merge "Check for IPSEC_TUNNELS feature before running CTS tests"
am: 4243c834ce

Change-Id: Ia996f994fdfc373ffbe634a40cb13002128fe98d
2019-05-08 13:25:51 -07:00
Benedict Wong
4243c834ce Merge "Check for IPSEC_TUNNELS feature before running CTS tests" 2019-05-08 20:04:06 +00:00
Benedict Wong
65845a7e50 Add TunUtils as utility to reflect packets
This patch adds a TunUtils class, allowing for packet capture over a TUN
interface, inspection of some basic header fields, and reflection of
packets with flipped src/dst headers.

Bug: 72950854
Test: Ran, passing
Change-Id: I9fdba4a905886c7a4820d86ef52c0cc1843215b2
2019-05-07 19:24:17 -07:00
Benedict Wong
437eb03a33 Check for IPSEC_TUNNELS feature before running CTS tests
If tunnel feature does is not present, skip tests.

Bug: 117183273
Test: This
Change-Id: I62fcc2cbca8bf3d2b70da5646303a7059a0df663
2019-05-07 19:24:14 -07:00
android-build-team Robot
a99d52775e Snap for 5450365 from 3e6758b79a12f454bf38493c42abe73e0e7dc2bf to pi-platform-release
Change-Id: If2786de1eb5013fff64a97e73642f4b67277dd08
2019-05-07 21:44:58 +00:00
Sasha Smundak
69de989faf Merge "Convert hostsidetests/net/**/Android.mk file to Android.bp"
am: 9bca8f5c35

Change-Id: I45955562531b79d6601422d0d246fdbcad14bba3
2019-04-30 10:27:23 -07:00
Sasha Smundak
b3af5c95b2 Convert hostsidetests/net/**/Android.mk file to Android.bp
See build/soong/README.md for more information.

Bug: 122332514
Test: atest CtsHostsideNetworkTests
(same failures as in baseline)
Change-Id: I5b6a22263331b19570b42f156d7ad5d59f8208b4
2019-04-29 13:18:42 -07:00
Luke Huang
e6a6c9e68f Merge "Convert Android.mk to Android.bp for net cts"
am: b2ba69080c

Change-Id: Ib06cf43d108e74a52c539e9113a2ea6f9937a8c2
2019-04-24 20:20:21 -07:00
Luke Huang
4df605b6a4 Convert Android.mk to Android.bp for net cts
Bug: 130623306
Test: atest CtsNativeNetTestCases CtsNativeNetDnsTestCases
      atest CtsNetTestCases

Change-Id: Ifc69f6f83161a44b663e6afdf034963ad241a6b5
2019-04-23 09:27:27 +00:00
Chalard Jean
46c238d8ed Merge "Add a test for a bugfix in UrlQuerySanitizer"
am: 7e14f42570

Change-Id: I7a72ee29f753ea8943ca4b6fc8c0c68775e09df1
2019-04-22 19:51:28 -07:00
Chalard Jean
83e71f6401 Add a test for a bugfix in UrlQuerySanitizer
...so this does not happen again.
This is a test for the fix in Ic91660d974dce21f2affdcacaeffe9accf8451ac

Bug: 1866121
Test: This
Change-Id: Ib7ee866f65baf99b46a31e2115355a42a829421e
2019-04-22 21:58:46 +09:00
Varun Anand
dd6406d69d Merge "CTS tests related to VPN meteredness."
am: 1806a7da53

Change-Id: Icfe2f2c2cdaa4e49180c02f3137a0969aa6884d8
2019-04-15 07:05:51 -07:00
Varun Anand
1806a7da53 Merge "CTS tests related to VPN meteredness." 2019-04-15 13:45:57 +00:00
Luke Huang
c8ecc806ad Merge "Minor changes for DnsResolverTest"
am: e445f54934

Change-Id: I176d2e3538d20acef4e04f082735b55c5cca07e6
2019-04-12 10:50:04 -07:00
Treehugger Robot
e445f54934 Merge "Minor changes for DnsResolverTest" 2019-04-12 17:24:36 +00:00
Luke Huang
f1dc4d4380 Minor changes for DnsResolverTest
Done for code-style nits from aosp/940128.

Bug: 129395490
Test: atest DnsResolverTest
Change-Id: Ia4db272cc1a4687b3749116375bac0efb37420d8
2019-04-12 10:34:14 +08:00
Luke Huang
8999684430 Merge "DnsResolver cts changes to match API council requests"
am: ea5e4a5409

Change-Id: I42df921cc3bb01ea25a671d5a1af678a6d3f5872
2019-04-11 17:57:03 -07:00
Luke Huang
ea5e4a5409 Merge "DnsResolver cts changes to match API council requests" 2019-04-12 00:45:18 +00:00
Lorenzo Colitti
c40bdf2fce Merge "Add instant and ABI XML tags for hostside networking tests."
am: 75c73cda26

Change-Id: Ibff6db948fe3a8ada9da6ac5bca334e85a75e4d9
2019-04-11 16:59:45 -07:00
Lorenzo Colitti
75c73cda26 Merge "Add instant and ABI XML tags for hostside networking tests." 2019-04-11 23:52:10 +00:00
Varun Anand
d1008aa730 CTS tests related to VPN meteredness.
Tests cover scenarios related to whether VPN has explicitly declared its
underlying networks plus whether it is an always metered VPN.

For each of these scenarios, we ensure VPN meteredness based on its
capabilities and ConnectivityManager#isActiveNetworkMetered matches.

Bug: 123727651
Test: atest HostsideVpnTests
Change-Id: I3030e5468a55bbc32be2a753f098dcf7f0256af8
2019-04-11 14:32:21 -07:00
Lorenzo Colitti
ad17ee9e92 Add instant and ABI XML tags for hostside networking tests.
These are not multi-ABI because the behaviour does not depend on
the ABI of the app. Some of the APIs are ultimately backed by JNI
code in the system server, but that only depends on the system
server's ABI, not the app's.

Enable instant mode because these applications are subject to the
same network restrictions as other apps.

Fix: 123364589
Test: atest CtsHostsideNetworkTests
Test: cts-tradefed run commandAndExit cts --enable-parameterized-modules --module-parameter instant_app -m CtsHostsideNetworkTests
Change-Id: Ib3c4cd365ffe95889d51a236f035ea84516f0abd
2019-04-11 20:43:59 +09:00
Adam Vartanian
6d8d727f92 Merge "Add test for SslError.getCertificate()"
am: 6ddb09cf3f

Change-Id: I6d1ed99c2719d1a4f32fdbb08faca611909c1e18
2019-04-10 05:57:52 -07:00
Luke Huang
4b1fab0dd0 DnsResolver cts changes to match API council requests
Bug: 129261432
Test: atest DnsResolverTest
Change-Id: I803f10218a01614ba7fb26597971853e602273c6
2019-04-10 15:39:21 +08:00
Adam Vartanian
5227dbe606 Add test for SslError.getCertificate()
Bug: 129200144
Test: cts -m CtsNetTestCases -t android.net.http.cts
Change-Id: I1b23746865a4bffc90847b30384defd2c7d49879
2019-04-09 15:46:20 +01:00
Lorenzo Colitti
66bfb3a8a3 Merge "[automerger skipped] Merge "Merge "Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev am: b6d3940f89" into oreo-mr1-cts-dev am: d93f6d545c" into pie-cts-dev am: f9b246a320 -s ours
am: 8f755d309d -s ours
am skip reason: change_id Iee8bfe418bf6003e5c78df77d75f6f9745249267 with SHA1 3852fd92f5 is in history

Change-Id: I5a6edd6e8f9216e670edb0e046ffd762fc02da3d
2019-04-08 21:36:12 -07:00
Android Merger
8f755d309d Merge "[automerger skipped] Merge "Merge "Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev am: b6d3940f89" into oreo-mr1-cts-dev am: d93f6d545c" into pie-cts-dev am: f9b246a320 -s ours am skip reason: change_id Iee8bfe418bf6003e5c78df77d75f6f9745249267 with SHA1 3852fd92f5 is in history" 2019-04-09 03:22:03 +00:00
Lorenzo Colitti
df64089298 [automerger skipped] Merge "Merge "Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev am: b6d3940f89" into oreo-mr1-cts-dev am: d93f6d545c" into pie-cts-dev
am: f9b246a320 -s ours
am skip reason: change_id Iee8bfe418bf6003e5c78df77d75f6f9745249267 with SHA1 3852fd92f5 is in history

Change-Id: I16d2ba7d301964e1beaf261c1b769a05be4a0187
2019-04-08 20:21:53 -07:00
Android Merger
f9b246a320 Merge "Merge "Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev am: b6d3940f89" into oreo-mr1-cts-dev am: d93f6d545c" into pie-cts-dev 2019-04-09 02:38:32 +00:00
Lorenzo Colitti
aaac541459 Merge "Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev am: b6d3940f89" into oreo-mr1-cts-dev
am: d93f6d545c

Change-Id: Ie4a894d0d07dd2f26ef63efbb83a4531110f84aa
2019-04-08 19:38:21 -07:00