Commit Graph

1278 Commits

Author SHA1 Message Date
Benedict Wong
701f04f642 Merge "Fix IPsec CTS tests for interface address checking" into qt-dev
am: b256c48d9b

Change-Id: Id490a48213f8ef6b2da320f682a8b6bea0ee4a26
2019-05-15 17:30:22 -07:00
Benedict Wong
4af108aacf 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
2019-05-15 01:02:28 -07:00
TreeHugger Robot
c7774ffa16 Merge "Enforce IPsec Tunnel mode for Android Q" into qt-dev 2019-05-15 03:58:29 +00:00
Junyu Lai
6bbc8f71af Merge changes I60b9e9ae,I8be89116 am: c3db303f0b
am: 3fc54a07ae

Change-Id: I7dbe2879e00bb9f7614ca700b40fb54e7e3f1744
2019-05-13 07:24:29 -07:00
junyulai
bbf160a93d 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

(Clean cherry-pick of aosp/957205)

Change-Id: I60b9e9ae9cf2b63490493ced9738cd2f402c3f9b
Merged-In: I60b9e9ae9cf2b63490493ced9738cd2f402c3f9b
2019-05-13 22:19:02 +08:00
junyulai
ad4c047f6d [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

(Clean cherry-pick of aosp/937026)

Change-Id: I8be89116bed5c4dedb2ca42b6d633aa9e8c6a49a
Merged-In: I8be89116bed5c4dedb2ca42b6d633aa9e8c6a49a
2019-05-13 22:16:50 +08: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
236be238b6 Merge "Convert IPsec tests to JUnit4" into qt-dev
am: cb00fbdcc2

Change-Id: I55b51901ecf1166bc553b247e0c9681fb1e20058
2019-05-10 15:52:14 -07:00
Benedict Wong
0d08e91fe7 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
2019-05-10 20:05:43 +00:00
Benedict Wong
fbbb9c9c04 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.
Merged-In: I545444bb483b0f5de45d00a07dc45aeb9e9cbdf7
Change-Id: I7b849ad24a04b6b7899a80f1856236b5ceb5a839
(cherry picked from commit d2465991d9)
2019-05-10 18:08:48 +00:00
Benedict Wong
d2465991d9 Merge "Enforce IPsec Tunnel mode for Android Q" am: 81e51bce50
am: ad380770a3

Change-Id: I545444bb483b0f5de45d00a07dc45aeb9e9cbdf7
2019-05-10 11:05:43 -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
Benedict Wong
817d192bc4 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
Merged-In: Ic4181fc857fa880db5553314efa914f870dbe87c
(cherry picked from commit d708a4c217f13c9028427d98031394f0933482bf)
2019-05-09 17:30:32 -07:00
Benedict Wong
2d2a1ab8f7 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
Merged-In: Icffeed2ebb2005d79faf04f48fd5126d1d6fb175
(cherry picked from commit 0e4743d56553d698ac45ae548f31019ea6e91541)
2019-05-09 17:30:32 -07:00
Benedict Wong
2742923a63 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
Merged-In: I9fdba4a905886c7a4820d86ef52c0cc1843215b2
(cherry picked from commit 2f07cd8551d755a4076e94b9e620bc446a66bf54)
2019-05-09 17:30:32 -07:00
Benedict Wong
f57c5e21cc Merge changes Ic4181fc8,Icffeed2e,I9fdba4a9 am: 54c0726220
am: df00896e14

Change-Id: Id0c3017b926b6f2fc158b10c0c0eb9a727e57dd6
2019-05-09 16:50:17 -07: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
e341fca9bc Merge "Check for IPSEC_TUNNELS feature before running CTS tests" am: 4243c834ce
am: 0086fba2bf

Change-Id: Ia45b229e5c3b5d1f8c8a7afcb53304ef83cca04a
2019-05-08 13:57:50 -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
af4330f777 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
Merged-In: I62fcc2cbca8bf3d2b70da5646303a7059a0df663
(cherry picked from commit 698c99fcf03a4e1afb028ac66852140762a7f2b1)
2019-05-08 04:17:03 +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
Hui Yu
a6bb88ebc1 Merge "Make sure app_idle_constants is set during setup." into qt-dev
am: dc7e2bb71c

Change-Id: Id524c3206efbc09ecf422b837b92891c8baafde5
2019-05-03 09:34:37 -07:00
Kweku Adams
eb7b9bab13 Merge "Testing Data Saver changed broadcast on unsupported devices." into qt-dev
am: 42f325acb9

Change-Id: If94305b8d2a8b877af585f0c209538b2b2827a7a
2019-05-03 07:52:00 -07:00
Roshan Pius
a856348e4c Merge "WifiManagerTest: Allow NETWORK_SETTINGS for apps with BIND_QUICK_SETTINGS_TILE" into qt-dev
am: 026e9c3e77

Change-Id: I0b8d13199fe4d3df33100fc9cf5f6f6c8b6aa676
2019-05-03 04:32:17 -07:00
Hui Yu
dc7e2bb71c Merge "Make sure app_idle_constants is set during setup." into qt-dev 2019-05-02 22:51:17 +00:00
Kweku Adams
42f325acb9 Merge "Testing Data Saver changed broadcast on unsupported devices." into qt-dev 2019-05-02 22:14:37 +00:00
Roshan Pius
5dea0afd70 WifiManagerTest: Allow NETWORK_SETTINGS for apps with BIND_QUICK_SETTINGS_TILE
Bug: 130199973
Test: atest WifiManagerTest
Change-Id: Ia31a56ba5fadb52fd724a7d213116cb0f1d0407a
2019-05-02 16:42:55 +00:00
Jack Yu
86398e2699 Merge "Allow NFC to grant NETWORK_SETTINGS permission" into qt-dev
am: 5b80d31a46

Change-Id: Id1567d18da2c534cc6800b210f1b3a10caf2c8ca
2019-04-30 22:39:18 -07:00
TreeHugger Robot
5b80d31a46 Merge "Allow NFC to grant NETWORK_SETTINGS permission" into qt-dev 2019-04-30 18:54:53 +00:00
Sasha Smundak
153173af0b Merge "Convert hostsidetests/net/**/Android.mk file to Android.bp" am: 9bca8f5c35
am: 69de989faf

Change-Id: I9a37e90afe4f6682187f9c5937cc552067ab9f7c
2019-04-30 10:36:46 -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
Kweku Adams
3a88dd4732 Testing Data Saver changed broadcast on unsupported devices.
Bug: 114131539
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: I3e8f9297ca49ee86bd26bb3d7a094c38b6203118
2019-04-29 11:25:14 -07:00
Hui Yu
022058ec74 Make sure app_idle_constants is set during setup.
Set app_idle_constants in NetPolicyTestsPreparer is not always successful(suspect timing issue).
Set app_idle_constants in AbstractRestrictBackgroundNetworkTestCase again to make sure.

Bug: 115393390
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testAppIdleMetered_whenCharging

Change-Id: I41148bc7eea0825537133f0471ceefeb5b05d763
2019-04-26 17:07:34 -07:00
Lorenzo Colitti
5abd1ff346 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
(cherry picked from commit ad17ee9e92)
2019-04-26 12:52:28 -07:00
Jack Yu
7457cd2728 Allow NFC to grant NETWORK_SETTINGS permission
There is use cases in NFC that need this permission.

Bug:131195124
Test: Cts pass after NFC app add NETWORK_SETTINGS permission
Change-Id: Iec5a08721da43767cfd0ced51e73a1b757b0d97a
2019-04-26 11:49:45 +08:00
Luke Huang
2890f04eaf Merge "Convert Android.mk to Android.bp for net cts" am: b2ba69080c
am: e6a6c9e68f

Change-Id: I90f1b3d41e956abbd1106403d8d1d176e23caa99
2019-04-24 20:26:09 -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
221ac7cdb2 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
(cherry picked from commit d60c09fd4db5deb81900af5208cc9306e2f77b3b)
Merged-In: Iba7ed3fe8cb23d7d14a29f2259a08e9c833db146
Merged-In: I10882b8d9a62766acfff6ec18afb3d813c631fd3
2019-04-23 05:35:17 +00:00
Chalard Jean
0114b8482d Merge "Add a test for a bugfix in UrlQuerySanitizer" am: 7e14f42570
am: 46c238d8ed

Change-Id: I10882b8d9a62766acfff6ec18afb3d813c631fd3
2019-04-22 20:04:55 -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
5d3ac8f9e1 CTS tests related to VPN meteredness.
(cherry picked from commit d1008aa730)

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: I2dea70c1c432d05b1a22c945f1e3e17166e4132d
Merged-In: I3030e5468a55bbc32be2a753f098dcf7f0256af8
2019-04-15 07:55:58 -07:00
Varun Anand
7973b17dd7 Merge "CTS tests related to VPN meteredness." am: 1806a7da53
am: dd6406d69d

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

Change-Id: I3b9eab390a476805eca35c5ae49d6516465f2699
2019-04-12 10:59:13 -07:00
Luke Huang
7b73ea2972 Merge "DnsResolver cts changes to match API council requests" am: ea5e4a5409
am: 8999684430

Change-Id: I1a94c563c19b5db0a3339f1420e9552934b0b4d6
2019-04-12 05:47:24 -07:00