Commit Graph

725 Commits

Author SHA1 Message Date
Lorenzo Colitti
1d75845bd5 Log the address of the IPv4 address that causes the test to fail.
Bug: 29231261
Change-Id: I6aac389d2c234091a284486422ee663119d021a9
2016-06-09 14:38:03 +09:00
Felipe Leme
d1f3d68694 Skip Doze Mode-related tests when device does not support it.
Fixes: 29072117
Change-Id: I7ca37eae58258c021ed6297a9f1ee3b2749da7d7
2016-06-02 20:16:25 +00:00
Felipe Leme
b9b85ce0cd Add flakyness check when a valid connection is expected.
BUG: 29082308

Change-Id: Iadb9a0bd7fbd307d799af7a7a5dabc0ed000bc6d
2016-06-02 09:08:49 -07:00
Felipe Leme
4188bc32d5 Added test for whitelisting pending intent for Doze Mode.
BUG: 28818704

Change-Id: I927364e78cd73133899d67be23e0b274829686af
2016-05-27 14:21:36 -07:00
Phil Weaver
f057299a13 Merge "CTS coverage: connectivity change, photo, + video" into nyc-dev 2016-05-25 23:06:26 +00:00
TreeHugger Robot
b853005f3c Merge "Use ConnectionManager API to check if network is metered." into nyc-dev 2016-05-25 16:54:26 +00:00
TreeHugger Robot
94636121f1 Merge "Add a test for closing sockets when a VPN comes up." into nyc-dev 2016-05-24 05:38:33 +00:00
Felipe Leme
68471ef930 Use ConnectionManager API to check if network is metered.
Also retry when getActiveNetworkInfo() returns null.

BUG: 28870582
BUG: 28909522
Change-Id: I4a43f171a7d6c73ea50555b66f858a54da65ae58
2016-05-23 11:33:34 -07:00
Phil Weaver
36f05df51f CTS coverage: connectivity change, photo, + video
Confirming that connectivity change broadcasts can be received
when explicitly registering for them in N, and via the manifest
pre-N.

Confirming that new_photo and new_video broadcasts are not received.

Bug: 28122277
Change-Id: Icfc27364a41ee8f4a55920e295ba658a367bb7d2
2016-05-19 13:27:24 -07:00
Marcus Nascimento
b232cf2d49 Merge "Merge "Add assertion messages to testStartUsingNetworkFeature_enableHipri." into lollipop-mr1-cts-dev am: 92849de21f -s ours" into marshmallow-cts-dev am: a6aa5bce79 am: 9ef251d523 am: 1ad52d8800 am: 01c938ccb7
am: 64f19d0319

* commit '64f19d031975520dc26fbe23c70a826e491032c9':
  Add assertion messages to testStartUsingNetworkFeature_enableHipri.

Change-Id: I222dcf7299db1d2bac9641c5f200f69f87a21905
2016-05-19 18:23:44 +00:00
Marcus Nascimento
01c938ccb7 Merge "Merge "Add assertion messages to testStartUsingNetworkFeature_enableHipri." into lollipop-mr1-cts-dev am: 92849de21f -s ours" into marshmallow-cts-dev am: a6aa5bce79 am: 9ef251d523
am: 1ad52d8800

* commit '1ad52d8800d39194d738a0d805de134a833b412c':
  Add assertion messages to testStartUsingNetworkFeature_enableHipri.

Change-Id: I5fe5ef00893350a7bf0d52176c0dc451d9e089a9
2016-05-19 18:09:28 +00:00
Marcus Nascimento
9ef251d523 Merge "Merge "Add assertion messages to testStartUsingNetworkFeature_enableHipri." into lollipop-mr1-cts-dev am: 92849de21f -s ours" into marshmallow-cts-dev
am: a6aa5bce79

* commit 'a6aa5bce79af1d1294ff815a396f1764fc703a27':
  Add assertion messages to testStartUsingNetworkFeature_enableHipri.

Change-Id: Ib12541988e1c5154fd5343d8fec9e6628239238a
2016-05-19 17:54:53 +00:00
Android Merger
a6aa5bce79 Merge "Merge "Add assertion messages to testStartUsingNetworkFeature_enableHipri." into lollipop-mr1-cts-dev am: 92849de21f -s ours" into marshmallow-cts-dev 2016-05-19 17:28:36 +00:00
Marcus Nascimento
8074918f7f Merge "Add assertion messages to testStartUsingNetworkFeature_enableHipri." into lollipop-mr1-cts-dev
am: 92849de21f  -s ours

* commit '92849de21f245cd43c4c05b28fbf59ef6feb725a':
  Add assertion messages to testStartUsingNetworkFeature_enableHipri.

Change-Id: Iabea0582c95db8353d3d7e4ec5008a45aa05b403
2016-05-19 17:28:26 +00:00
Daniel Xie
92849de21f Merge "Add assertion messages to testStartUsingNetworkFeature_enableHipri." into lollipop-mr1-cts-dev 2016-05-19 16:39:30 +00:00
TreeHugger Robot
f76c309ebe Merge "Added tests for idle apps and doze mode." into nyc-dev 2016-05-17 22:40:45 +00:00
Aaron Holden
4e0eb2e458 Merge "Remove module-level WifiCheck preparers" into nyc-dev 2016-05-16 22:45:29 +00:00
Lorenzo Colitti
cbcfb98dd8 Add a test for closing sockets when a VPN comes up.
Bug: 28251576
Change-Id: Iab0a8643cff3c54eb04168a7cdfa116c0b8e30b1
2016-05-16 23:10:44 +09:00
Felipe Leme
88debac60e Added tests for idle apps and doze mode.
BUG: 28473659
BUG: 28521946
Change-Id: I4bc9166bf2050136fa86e374aac59f80afd76f1c
2016-05-13 15:08:16 -07:00
Aaron Holden
3361c86147 Remove module-level WifiCheck preparers
As WifiCheck is now declared in the CTS config, remove declarations in
the module configs.

Also downgrade TargetSetupErrors on failure to logged errors

bug:28234985
Change-Id: I2e1a369bc26aeca922686c4c3d8c033bb7f9fbc7
2016-05-11 09:55:44 -07:00
Felipe Leme
ed64e61b5f Covers more corner cases on restricted network modes:
- Tests what happens on foreground applications when a restriction (like
  Data Saver or Battery Saver modes) is turned on (prior tests would
  turn the restriction on *before* switching the app to foreground).
- Tests multiple restrictions simultaneously enabled.

Also improved existing code:

- Fixed background state check.
- Reused some common checks in helper methods.
- Retries checks for process state.

BUG: 28473659

Change-Id: Ifcf9cc6d895ccde0ab5177f9f5d8c347ce53b811
2016-05-09 12:48:29 -07:00
Felipe Leme
6cd41f6d03 Asserts foreground apps always have network access.
BUG: 28473659
Change-Id: Iea6933a4630ff2e9c00a2d2e9e4a6f1a51de70f2
2016-05-06 14:28:03 -07:00
Felipe Leme
aa2e8ea1d8 Assert whitelists are revoked on uninstall.
BUG: 28616418
Change-Id: I909fd4c6024afe5b42560090c6e2f11b43c220de
2016-05-06 09:18:54 -07:00
Felipe Leme
691e85def7 Temporarily disable NetworkInfo check.
There are known issues that cause these check to fail, and the fix has
not been submitted yet.

BUG: 28473659
BUG: 28521946
Change-Id: I26dfbebc2d07396ef89ac78230645e4791c708ee
2016-05-04 18:48:24 +00:00
Felipe Leme
50bce69fab Improved connectivity check by also asserting NetworkInfo states.
BUG: 28473659
BUG: 26571724
Change-Id: Iba687003431ed5c353412268726967a798f538da
2016-05-03 08:29:52 -07:00
Felipe Leme
fa8e24c3e6 Added test for required packages whitelisted for Data Saver Mode.
Also fixed code that checks for whitelist uids, otherwise it would pass
when the required uid is missing but a superset was present (for
example, when asking for 1009 but 10090 was whitelisted).

BUG: 28431507
Change-Id: Iaaa67e586907dba215496460445ad627ba7b63c5
2016-04-29 14:10:12 -07:00
Marcus Nascimento
c847a249c6 Merge "Merge "Add assertion message to assertions for testExecute_withMobile." into lollipop-mr1-cts-dev am: ce158e65ae -s ours" into marshmallow-cts-dev am: 90419fc992 am: 4699aa522a am: 69db501b63 am: f9185c256f
am: 8ad4295bec

* commit '8ad4295bec64574b3c05547efc29f225b385e6ce':
  Add assertion message to assertions for testExecute_withMobile.

Change-Id: Id4892624242d707920f285c13dbfd029f7f2cc3d
2016-04-29 11:17:44 +00:00
Marcus Nascimento
f9185c256f Merge "Merge "Add assertion message to assertions for testExecute_withMobile." into lollipop-mr1-cts-dev am: ce158e65ae -s ours" into marshmallow-cts-dev am: 90419fc992 am: 4699aa522a
am: 69db501b63

* commit '69db501b632720dda1e5aba0ac8aa676f11247e8':
  Add assertion message to assertions for testExecute_withMobile.

Change-Id: I17fe6ca042b8ec387e082ef475538933e1e9a33c
2016-04-29 11:12:32 +00:00
Marcus Nascimento
4699aa522a Merge "Merge "Add assertion message to assertions for testExecute_withMobile." into lollipop-mr1-cts-dev am: ce158e65ae -s ours" into marshmallow-cts-dev
am: 90419fc992

* commit '90419fc99220c249b29a09805c06f9a1fc25f0d1':
  Add assertion message to assertions for testExecute_withMobile.

Change-Id: Ifc327d9165a543b163c954d964c982fdd14ab1af
2016-04-29 11:05:01 +00:00
Android Merger
90419fc992 Merge "Merge "Add assertion message to assertions for testExecute_withMobile." into lollipop-mr1-cts-dev am: ce158e65ae -s ours" into marshmallow-cts-dev 2016-04-29 10:59:36 +00:00
Marcus Nascimento
5d6e8323f6 Merge "Add assertion message to assertions for testExecute_withMobile." into lollipop-mr1-cts-dev
am: ce158e65ae  -s ours

* commit 'ce158e65aec1b2c9687852872c9fd9ed74585144':
  Add assertion message to assertions for testExecute_withMobile.

Change-Id: I12a3b5e90ce51ebbc233d69126eb78e3a85d6ba3
2016-04-29 10:59:28 +00:00
Daniel Xie
ce158e65ae Merge "Add assertion message to assertions for testExecute_withMobile." into lollipop-mr1-cts-dev 2016-04-28 16:44:37 +00:00
Marcus Nascimento
51eb8c19a0 Add assertion message to assertions for testExecute_withMobile.
Some partner test devices without a SIM Card or with no signal, thus
without mobile network data connection.

Added a message to check signal and SIM card and rerun the test.

Also added a verification that the network type is supported in the
event of a Connectivity Action's timeout. Unsuported network type could
be caused by a network stack crash.

Bug: 28207677
Change-Id: Ibca50359df7d5fb8371f4f4037fc81f029f48b30
2016-04-28 16:40:31 +00:00
TreeHugger Robot
25a61dcae9 Merge "Add more test coverage to ConnectivityManagerTest." into nyc-dev 2016-04-27 10:21:48 +00:00
Marcus Nascimento
335856c1d3 Add assertion messages to testStartUsingNetworkFeature_enableHipri.
testStartUsingNetworkFeature_enableHipri should be able to reconnect to Wifi Network.
Added a prefix to the already defined error message to rerun the test.

The ConnectivityManager's startUsingNetworkFeature will fail without SIM card and/or signal.
Changed the error message to check SIM card and signal and rerun the test.

Bug: 28264205
Change-Id: Ia1b35cab11afa65ae93ea7dab2f7cc3a330d8471
2016-04-26 11:32:30 +01:00
Owain Davies
c403c81218 Merge "Merge "Add assertion message if testDns ipv6 lookup reutrns ipv4." into lollipop-mr1-cts-dev am: b996de8" into marshmallow-cts-dev am: 48216c2 am: 275a0e6 am: 4be27c8 am: 0399523
am: fd3f832

* commit 'fd3f832fcfb9dc4fa3e4d497a97ebdf1636269b2':
  Add assertion message if testDns ipv6 lookup reutrns ipv4.

Change-Id: I774f8188a4329508bd590564859f38b3ec049f7c
2016-04-25 23:48:09 +00:00
Owain Davies
6d3841c6a5 Merge "Merge "Added assertion message to testDns failures" into lollipop-mr1-cts-dev am: 350b2aa" into marshmallow-cts-dev am: 936375b am: 2bfd0e1 am: 2a0f366 am: 39cb9a5
am: 7cde9a8

* commit '7cde9a81f8ee813b47dd424cea85692fd6f794fb':
  Added assertion message to testDns failures

Change-Id: Icef1c18274c8ae3883b718d823f851d4c1562417
2016-04-25 23:48:07 +00:00
Owain Davies
03995235ba Merge "Merge "Add assertion message if testDns ipv6 lookup reutrns ipv4." into lollipop-mr1-cts-dev am: b996de8" into marshmallow-cts-dev am: 48216c2 am: 275a0e6
am: 4be27c8

* commit '4be27c8e8497987720d58494a330484648e72caa':
  Add assertion message if testDns ipv6 lookup reutrns ipv4.

Change-Id: I03a0a86365929a6bdc8eb2815229341eb7a6a311
2016-04-23 06:19:47 +00:00
Owain Davies
39cb9a5a5c Merge "Merge "Added assertion message to testDns failures" into lollipop-mr1-cts-dev am: 350b2aa" into marshmallow-cts-dev am: 936375b am: 2bfd0e1
am: 2a0f366

* commit '2a0f3660e12cdbaa8f573811d82f07ebd9a8ed51':
  Added assertion message to testDns failures

Change-Id: I36b06607bea7de4f032daa1ddc84d988d6d44399
2016-04-23 06:19:46 +00:00
Owain Davies
275a0e6237 Merge "Merge "Add assertion message if testDns ipv6 lookup reutrns ipv4." into lollipop-mr1-cts-dev am: b996de8" into marshmallow-cts-dev
am: 48216c2

* commit '48216c2807c0fd5561a592b2be09dad3cc0a0bd7':
  Add assertion message if testDns ipv6 lookup reutrns ipv4.

Change-Id: I361b96fa073ffe1d7719be745e32241322b1eeed
2016-04-23 06:13:45 +00:00
Owain Davies
2bfd0e1192 Merge "Merge "Added assertion message to testDns failures" into lollipop-mr1-cts-dev am: 350b2aa" into marshmallow-cts-dev
am: 936375b

* commit '936375b6f25a328a06d5b783f6fde63afb13d681':
  Added assertion message to testDns failures

Change-Id: I9a56dfe2d0960898b61f26ccee3607c7558034de
2016-04-23 06:13:44 +00:00
Android Merger
48216c2807 Merge "Merge "Add assertion message if testDns ipv6 lookup reutrns ipv4." into lollipop-mr1-cts-dev am: b996de8" into marshmallow-cts-dev 2016-04-23 06:07:51 +00:00
Android Merger
936375b6f2 Merge "Merge "Added assertion message to testDns failures" into lollipop-mr1-cts-dev am: 350b2aa" into marshmallow-cts-dev 2016-04-23 06:07:42 +00:00
Owain Davies
4455109378 Merge "Add assertion message if testDns ipv6 lookup reutrns ipv4." into lollipop-mr1-cts-dev
am: b996de8

* commit 'b996de81cde4d1596dc15346591ed0ccb41608ca':
  Add assertion message if testDns ipv6 lookup reutrns ipv4.

Change-Id: I4b791741f7c69f23097ccd9d56d33984a0862b5a
2016-04-23 06:07:33 +00:00
Owain Davies
7db24c68cf Merge "Added assertion message to testDns failures" into lollipop-mr1-cts-dev
am: 350b2aa

* commit '350b2aae5bc303d094a540c12bcb650a8bf5e139':
  Added assertion message to testDns failures

Change-Id: I347197b0db859e3875b14701424d2d55d9059d32
2016-04-23 06:07:31 +00:00
Daniel Xie
b996de81cd Merge "Add assertion message if testDns ipv6 lookup reutrns ipv4." into lollipop-mr1-cts-dev 2016-04-23 06:02:23 +00:00
Lorenzo Colitti
8a14c224e3 Add more test coverage to ConnectivityManagerTest.
1. Test NetworkCallbacks as well as CONNECTIVITY_ACTION, since
   we are moving away from CONNECTIVITY_ACTION.
2. Use the Network objects we get back to test
   Network#getSocketFactory().
3. Check that TCP connections are closed with ECONNABORTED when
   a network disconnects.

Bug: 28251576
Change-Id: I41a438b82ef9251e52866332f3445f1bf876e04f
2016-04-22 22:25:51 +09:00
Chad Brubaker
bac071b74f Rewrite X509TrustManagerExtensionsTest
X509TrustManagerExtensionsTest used internal implementation details to
test X509TrustManagerExtensions#isUserAddedCertificate, these
implementation details are no longer the same and so this test failed to
catch the API being broken and then incorrectly flagged the fixed API as
broken.

To ensure that isUserAddedCertificate is properly covered the tests for
the API are split into two places: X509TrustManagerExtensionsTest covers
tests for the default case where there are no added CAs and
CaCertManagementTest to test the behavior when CAs have been added.

Bug:28262103
Change-Id: I14f3211c277fdc9c8bfc3d4ac932be375961fa28
2016-04-20 15:12:38 -07:00
Felipe Leme
0e47422a47 Changed order of metered network check.
BUG: 27808364
Change-Id: I8a1088673cdd2c310a787a0b0708ad58876e9ac0
2016-04-14 12:49:31 -07:00
Felipe Leme
f744474a28 Improvements on test case setup.
- On hostside, checks if wi-fi is on instead of checking for connectivity (which can be very slow).
- Don't automatically reset metered network on superclass' tearDown().
- Make sure tearDown() cleans up all state changes.

BUG: 27808364
Change-Id: I4818047c5fb8f6f430b0aab5ecfa77717f860db3
2016-04-14 11:47:34 -07:00