Commit Graph

3023 Commits

Author SHA1 Message Date
Xin Li
5000dc4dca DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master
Bug: 136196576
Change-Id: I51435cf03e91cb11ea8027b226f8dbf6eb2b1e73
2019-07-10 09:50:54 -07:00
android-build-team Robot
27b8409b39 Snap for 5622519 from 9954e55f3cdb63682fb59d8cbbd0a611b2bacc68 to pi-platform-release
Change-Id: Ib718f08062790b0a7553978410946e591c58a283
2019-07-08 23:33:57 +00:00
Junyu Lai
f9b69119bf Merge "Resolve resource ID at runtime to stabilize tests" 2019-07-08 02:05:08 +00:00
junyulai
223fae9a7f Resolve resource ID at runtime to stabilize tests
This change also remove some unused references.

Bug: 136638851
Test: atest android.net.cts.ConnectivityManagerTest

Merged-In: Ic44b31ed9acc48b9bcba7e1e70cc18a65bc0a8f6
Change-Id: Ic44b31ed9acc48b9bcba7e1e70cc18a65bc0a8f6
(cherry-pick from ag/8500407)
2019-07-05 15:28:17 +08:00
Pete Bentley
62ec101de4 Merge "Fix regression tests for SSLCertificateSocketFactoryTest hostname verification." 2019-06-25 14:13:43 +00:00
Julien Desprez
14fae15d0a [Cherry pick] Mark module as "secondary_user" since it uncovered bug before
This will allow running this module against a secondary
user in continuous infra to uncover bugs.

Test: run cts-unit-tests
Bug: 130892086
Change-Id: I063a0d29163567ec2cf97d2e4469e88e7203e852
Merged-In: Ic8af2e3e77e24db340b2894c2d36e3501962952c
2019-06-24 09:15:51 -07:00
Pete Bentley
331856df7d Fix regression tests for SSLCertificateSocketFactoryTest hostname verification.
No longer relies on a server with a known bad TLS certificate, instead
connects to a known good server but installs a HostnameVerifier which
rejects all hostnames in order to test that verification is taking place
where expected.

Bug: 2807618
Bug: 134532880
Test: atest CtsNetTestCases
Test: atest CtsNetTestCases --instant
Change-Id: I7608047a75555296153459a45747ee83ec87db4b
2019-06-24 15:27:42 +01:00
Pete Bentley
29ec721673 Merge "Update test host used for TLS host verification." 2019-06-20 12:27:27 +00:00
Junyu Lai
16174b2cff Merge "Add CTS for creating keepalive offloads on cellular" 2019-06-19 14:08:31 +00:00
junyulai
487b0401c0 Add CTS for creating keepalive offloads on cellular
Bug: 134352656
Test: atest android.net.cts.ConnectivityManagerTest (--instant)
Change-Id: Ia7b1111abe687efad032a8c9205990c97a769fcd
2019-06-19 10:10:21 +08:00
Luke Huang
1053db1f82 Add test with inline executor for DnsResolverTest
Makes general query test cases also take inline executor.
The new added test case testSequentialQuery with inline executor
will only pass after aosp/980686.

Bug: 134310704
Test: atest DnsResolverTest
      atest DnsResolverTest --instant
Change-Id: I135358fe45652277ed795a2f359f44f4db787c08
2019-06-13 01:18:37 +08:00
Luke Huang
c80f04858e Fix DnsResolverTest for instant mode
add AppModeFull@ to DnsResolverTest since WRITE_SECURE_SETTINGS
could not be ganted in instant mode.

Bug: 134897744
Test: atest DnsResolverTest
      atest DnsResolverTest --instant

Change-Id: I267c19af1a1c5544ca752a364335ec728a478bb2
2019-06-13 00:46:18 +08:00
Pete Bentley
8eeaa698c6 Update test host used for TLS host verification.
Temporary fix, this is still brittle to certificate changes
on the test host.

Bug: 134532880
Test: atest android.net.cts.SSLCertificateSocketFactoryTest
Change-Id: I6e8c8757963ef46009767925bfa512127d9daba7
2019-06-07 18:41:48 +01:00
Benedict Wong
5715ce685d Merge changes If6fa3598,Ia969f78f
* changes:
  Remove mContext from IpSecBaseTest
  Add reflected-packet based data tests
2019-05-31 17:29:23 +00:00
Treehugger Robot
1d6880153b Merge "Cleanup IPsec CTS tests" 2019-05-31 12:54:49 +00:00
Android Merger
a700ed10de Merge "Merge "Fixing NetworkWatchlistTest#testGetWatchlistConfigHash for secondary users." into pie-cts-dev am: 4e9043b8cf" 2019-05-30 20:45:04 +00:00
jovanak
2045aa4777 Merge "Fixing NetworkWatchlistTest#testGetWatchlistConfigHash for secondary users." into pie-cts-dev
am: 4e9043b8cf

Change-Id: I5417f214cd337c3d0b517b160d753d808e9e3f59
2019-05-30 13:44:48 -07:00
Luke Huang
3df5aa1233 Merge "Add bypass private DNS test case and null network test for DnsResolver cts" 2019-05-30 11:22:50 +00:00
Junyu Lai
a73f8f6ec5 Merge "Fix keepalive CTS fail for devices with kernel older than 4.8" 2019-05-30 05:05:10 +00:00
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
junyulai
063b4e109e Fix keepalive CTS fail for devices with kernel older than 4.8
If kernel < 4.8 then it doesn't support get socket option
TCP_REPAIR_WINDOW, thus TCP keepalive cannot be supported.
However, it might still support NAT-T keepalive. Test TCP
keepalive only if it is supported by kernel.

Bug: 133652079
Test: atest android.net.cts.ConnectivityManagerTest#testMajorMinorVersionCompare \
    android.net.cts.ConnectivityManagerTest#testSocketKeepaliveLimit \
    android.net.cts.ConnectivityManagerTest#testSocketKeepaliveUnprivileged \
    android.net.cts.ConnectivityManagerTest#testKeepaliveUnsupported \
    android.net.cts.ConnectivityManagerTest#testCreateTcpKeepalive

Change-Id: I3f8456deea2b4ded762a413c8e27b58ce54ce0aa
2019-05-29 17:15:53 +08:00
Luke Huang
1f5f11e681 Add bypass private DNS test case and null network test for DnsResolver cts
1. add test case for testing bypass Private DNS
2. add null network test
3. minor change for cleanup

Bug: 130594022
Test: atest DnsResolverTest
Change-Id: I2da65fc1267a1975e014c0aafe2ae47df075b712
2019-05-29 12:04:48 +08: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
jovanak
db6336c0b8 Fixing NetworkWatchlistTest#testGetWatchlistConfigHash for secondary users.
Avoids relying on external storage and using the hardcoded /sdcard/ path.
Unrooted adb does not have access to non-user 0 sdcard paths, and so the "cp"
command fails when the test runs in user 10.

Fixes: 121400865
Test: cts-tradefed run cts-dev -m CtsNetTestCases -t android.net.cts.NetworkWatchlistTest#testGetWatchlistConfigHash in user 10.
Change-Id: Idc667072bcfbbe159416fa7c7b6b19045b52041d
2019-05-24 12:21:50 -07: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
ee4eb2f35b Remove mContext from IpSecBaseTest
This commit removes the mContext from IpSecBaseTest, and replaces it
with InstrumentationRegistry.getContext().

Bug: 72950854
Test: Ran on devices, passing.
Change-Id: If6fa359825aa9d1f7d4c8d49aba7a34925c073ed
2019-05-22 11:08:26 -07:00
Benedict Wong
281d757df6 Cleanup IPsec CTS tests
This commit addresses comments from aosp/963067 and aosp/959617.

No behavioral/functional changes were made, only renames and minor style
nits addressed.

Bug: 72950854
Test: Ran on devices, working
Change-Id: I1702b91e245412f0142e9e47b7fb373b9b4e8126
2019-05-22 11:08:26 -07: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
60b0a6432b Add reflected-packet based data tests
This commit adds tests that reflect outgoing packets, flipping the outer
src/dst headers to avoid the need to tear down and rebuild the outer
TUN.

This allows us to at least test that our implementation can interoperate
with itself.

Bug: 72950854
Test: this, passing
Change-Id: Ia969f78f4c1a0c0a017f5aad425a68852ff4433a
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