Commit Graph

344 Commits

Author SHA1 Message Date
Felipe Leme
d207fe5beb Tagged app2 as a CTS test artifact.
BUG: 27436960

Change-Id: I4e97b6341dae3361f4efdaec3132a7aa9a38dece
2016-03-01 16:31:58 -08:00
Stuart Scott
a9e563cf83 Switch to CTSv2
bug:21762834
Change-Id: Ie51a0ed4560b46c2f360e14980e5fab7fe6479fe
2016-02-29 21:51:59 -08:00
Felipe Leme
31c9ec9cb4 Added CTS tests to check background network access while on power save mode.
BUG: 27127112
Change-Id: Ifa3019d7b94459d737a9dff80b4b36a2dd43aca5
2016-02-23 14:14:55 -08:00
Felipe Leme
0a0857762a Split client-side test in 2 classes so some common code can be used to
test Power Save Mode.

BUG:  27127112
Change-Id: I6954ce8474da6da678d4bfe194334ed5a08aaeff
2016-02-19 15:21:18 -08:00
Felipe Leme
a0f49f2384 Refactored how data is shared between test apps.
When running the device-site tests, it's necessary to share state
between a second app and the main test app. Currently that's achieved
through a shared preference file that is accessed by both apps (since
they use a shared id), but this approach will not work on power save
mode tests (because the test app will be in foreground and the
background restrictions won't be applied in the second app).

This change refactors the data sharing mechanism by:

- Using an ordered broadcast that is sent from the test app to the
  secondary app.
- Checking for the network status in the secondary app.
- Moving the test logic to the client-side tests.

BUG:  27127112
Change-Id: I44987701b908b329fdf40e3a7a97e9f30cfadecb
2016-02-19 15:20:17 -08:00
Felipe Leme
a557ba6818 Updated tests cases after to assert the proper number of notifications.
Previously NMPS was broadcasting an intent every time
add|removeRestrictBackgroundWhitelistedUid() was called, but that
behavior has been changed to just broadcast an intent when there is a
change.

BUG: 26685616

Change-Id: I4eb7a4fda864a28ea23b661d1a88e18bfb80533d
2016-02-11 17:00:23 -08:00
Felipe Leme
38300a564a Refactored tests to make a real network connection.
The current approach assumes that if the active network is null it is
blocked for background access, but that's not the case.

BUG: 26685616
Change-Id: Ic6990037a2bc503c14512d7303ec71eb178f784b
2016-02-10 11:25:38 -08:00
Felipe Leme
c50a6c7d4b Improve CTS tests to really check background network restrictions.
BUG: 26685616
Change-Id: If2b1649435b0a4e5b8c383eb3196807a03359d70
2016-02-08 12:40:43 -08:00
Felipe Leme
4fc69f6c25 Split hostside network tests in multiple classes.
Initially HostsideNetworkTests.java was used to just launch VpnTest, but
it became more complex with the inclusion of ConnectivityManagerTest,
which required hostside logic.

By splitting these tests not only the VPN tests will run faster (since it
doesn't need the setup/clean from ConnectivityManager), but the
ConnectivityManager tests will be cleaner (since it can have more logic
on setup and teardown).

BUG: 26685616
Change-Id: Ie29c4a3e83956b217d90b84c9b4541690cde0344
2016-02-04 12:49:32 -08:00
Felipe Leme
34caa7fc25 Renamed and cloned HostsideNetworkTests.java
This is a no-op change that will make it easier to split the
HostsideNetworkTestCase.java logic into multiple files.

In this change, HostsideNetworkTests.java was renamed to
HostsideNetworkTestCase.java and copied as-is to
HostsideRestrictBackgroundNetworkTests.java; the next change will split
the logic in between these class so they can be properly git-diffed.

In fact, the only difference between then is the class declarations:

diff HostsideNetworkTestCase.java HostsideRestrictBackgroundNetworkTests.java
39c39
< abstract class HostsideNetworkTestCase extends DeviceTestCase implements IAbiReceiver,
---
> public class HostsideRestrictBackgroundNetworkTests extends DeviceTestCase implements IAbiReceiver,

BUG: 26685616
Change-Id: I87dadec528eaeff776d55d3382f356066496429a
2016-02-04 12:44:21 -08:00
Felipe Leme
5b35136917 Added CTS tests for RESTRICT_BACKGROUND_CHANGED.
These tests require a second app (besides the test app) that defines a
service; the host-side test then launches the service whose only purpose
is to define a broadcast receiver, which in turn will count the number
of intents received in a shared preferences file. Then the test app will
read the shared preferences and assert the proper number of intents have
been received.

BUG: 26451391
Change-Id: I4c5d5e57c09a0bd57a7f6581820cc9115318dd47
2016-02-04 10:22:42 -08:00
Yi Kong
737411b802 Merge "Wait for network to resume in ConcurrencyTest" am: 3ba439e1b2 am: 52697c65f3
am: d2fbf987ce

* commit 'd2fbf987ce788f87aeacf02e04b250f006ecb21c':
  Wait for network to resume in ConcurrencyTest
2016-01-29 18:08:46 +00:00
Yi Kong
d2fbf987ce Merge "Wait for network to resume in ConcurrencyTest" am: 3ba439e1b2
am: 52697c65f3

* commit '52697c65f38b93e979b854017d5669d3dbc00395':
  Wait for network to resume in ConcurrencyTest
2016-01-29 18:05:26 +00:00
Yi Kong
3ba439e1b2 Merge "Wait for network to resume in ConcurrencyTest" 2016-01-29 17:59:59 +00:00
Nicolas Prévot
3f8fb226de Merge "Cts tests for multiple CA Certificates for WifiEnterpriseConfig." 2016-01-29 11:25:42 +00:00
Sergio Giro
15e852c14c Merge "AbstractVerifierTest: adapt tests to reflect that tabs are preserved by the DN parser" am: 31cf2dfd30 am: 5982f2bc9a
am: fc9df7044f

* commit 'fc9df7044f0aa6c860fc0e11f510b1aa10fd8b24':
  AbstractVerifierTest: adapt tests to reflect that tabs are preserved by the DN parser
2016-01-28 15:07:42 +00:00
Sergio Giro
fc9df7044f Merge "AbstractVerifierTest: adapt tests to reflect that tabs are preserved by the DN parser" am: 31cf2dfd30
am: 5982f2bc9a

* commit '5982f2bc9aa50360ebde52a721da71c6f72af526':
  AbstractVerifierTest: adapt tests to reflect that tabs are preserved by the DN parser
2016-01-28 15:05:40 +00:00
Sergio Giro
f2b8106f8d AbstractVerifierTest: adapt tests to reflect that tabs are preserved by the DN parser
Recently in
53f06c0d1d
I changed the tests to reflect the fact that tabs and newlines were
discarded.

I must have made some mistake verifying the change, as tabs seem preserved.

Changing the assertion for tabs.

Bug: 26517725
Change-Id: I514a3d670019e3e2911e2c69b434d0f577ff9b7a
2016-01-28 14:40:48 +00:00
Yi Kong
9980740cb9 Wait for network to resume in ConcurrencyTest
so that subsequent tests would not fail due to lack of network
connection.

Bug: 26182816
Change-Id: I6bc89897c9ad8e5966f03db7fc72169d3b973e53
2016-01-28 07:24:03 +08:00
Felipe Leme
d12935eed8 Removed reference to hidden annotation.
BUG: 26082535
BUG: 26451391
Change-Id: I267010a49df3212ca96f54b65aa7c8a14982a70c
2016-01-27 12:34:06 -08:00
Felipe Leme
310885be93 Added tests for restricted background APIs.
Although the main purpose of these change is to test the new public
API (ConnectivityManager.getRestrictBackgroundStatus()), it also
indirectly tests the new private API on
INetworkPolicyManager (addRestrictBackgroundWhitelistedUid(),
removeRestrictBackgroundWhitelistedUid(), and
getRestrictBackgroundWhitelistedUids()), since they're used on each test
to setup the device state.

This change also modified how the device-side tests are run: the
runDeviceTests() had a className parameter that was not used, and this
CL not only uses it but also introduces a methodName as well. The
reasoning for this change is that the host-side tests must interact with
the device-side tests many times during each test; in fact, the "real"
test is done at the host side, while the device-side test is just used
to assert the expected result of getRestrictBackgroundStatus()).

BUG: 26451391

Change-Id: I7114e350f3b247d2f05b0c280a09cad383c61f9a
2016-01-27 09:32:44 -08:00
Nicolas Prevot
6f1da5f774 Cts tests for multiple CA Certificates for WifiEnterpriseConfig.
BUG:22547958
Change-Id: I6e6da2732f57f9642dd34cb1d9d46e8e85e8d3f7
2016-01-22 11:46:06 +00:00
Sergio Giro
d223b32572 Merge "AbstractVerifierTest: adapt tests to the new behaviour concerning whitespace" am: c21b54c82b am: 6aa2e158e4
am: fceca8f0e9

* commit 'fceca8f0e94e915e47e60096ef3b6d11f6cfe404':
  AbstractVerifierTest: adapt tests to the new behaviour concerning whitespace
2016-01-18 12:25:12 +00:00
Sergio Giro
fceca8f0e9 Merge "AbstractVerifierTest: adapt tests to the new behaviour concerning whitespace" am: c21b54c82b
am: 6aa2e158e4

* commit '6aa2e158e4494329087e48c26af1dcd128a1c048':
  AbstractVerifierTest: adapt tests to the new behaviour concerning whitespace
2016-01-18 12:23:29 +00:00
Sergio Giro
53f06c0d1d AbstractVerifierTest: adapt tests to the new behaviour concerning whitespace
In a DN like "cn=\na" the "\n" now gets trimmed, which makes sense.
Changing tests to reflect the change.

Bug: 26517725
Change-Id: I641687dd864524d66b925f555000edd44c970962
2016-01-18 12:14:09 +00:00
Dimitry Ivanov
a907d75f06 Merge "Untie MultinetworkApiTest from platform libc++.so" am: 2e14e9afaa am: 4577e05c13
am: 5a78c96856

* commit '5a78c968564520b256ea1e23e36c4b11ca130bc4':
  Untie MultinetworkApiTest from platform libc++.so
2016-01-13 18:54:39 +00:00
Dimitry Ivanov
5a78c96856 Merge "Untie MultinetworkApiTest from platform libc++.so" am: 2e14e9afaa
am: 4577e05c13

* commit '4577e05c13459a4fe27cd5e080eec04975160355':
  Untie MultinetworkApiTest from platform libc++.so
2016-01-12 21:28:10 +00:00
Dimitry Ivanov
04d19df9ca Untie MultinetworkApiTest from platform libc++.so
Bug: http://b/26512135
Change-Id: Ia01fd851fd7d2e50708620adf11d904e42de0b3b
2016-01-12 12:19:12 -08:00
Yi Kong
074b8b0de5 Merge "ConcurrencyTest: re-enable WiFi during teardown" am: a49620ff08
am: 8cf5a71ec0

* commit '8cf5a71ec0100fda09c19fc7116c1b50a0e5f096':
  ConcurrencyTest: re-enable WiFi during teardown
2015-12-31 14:43:17 +00:00
Yi Kong
27c101458c ConcurrencyTest: re-enable WiFi during teardown
Bug: 26182816
Change-Id: I3d5704794b17e0ec536a979a544a97a3e1f7b5c7
(cherry picked from commit f79ef7ff21ca9301035b9130d2d864112e8f9ae3)
2015-12-31 14:38:44 +00:00
Yi Kong
bed4c40f42 ConcurrencyTest: re-enable WiFi during teardown
Bug: 26182816
Change-Id: I3d5704794b17e0ec536a979a544a97a3e1f7b5c7
2015-12-23 13:21:37 +00:00
Stuart Scott
131383d5e4 Add support for tests to declare runtime hints.
bug:21762834
Change-Id: I11f3e6ecb026dcbbb8c73c750c7a70d8a15d81fb
2015-12-22 08:53:12 -08:00
Neil Fuller
1ca5875aea Merge "Isolate Local(Server|)SocketTest CTS tests" am: 85ac7d010e am: 6962425a88
am: b64304dd62

* commit 'b64304dd6255cf5efa5a2144d84a69520b251464':
  Isolate Local(Server|)SocketTest CTS tests
2015-12-19 10:11:07 +00:00
Neil Fuller
b64304dd62 Merge "Isolate Local(Server|)SocketTest CTS tests" am: 85ac7d010e
am: 6962425a88

* commit '6962425a885f3e32431a15d8a5c34a78c633c777':
  Isolate Local(Server|)SocketTest CTS tests
2015-12-19 10:09:08 +00:00
Neil Fuller
85ac7d010e Merge "Isolate Local(Server|)SocketTest CTS tests" 2015-12-19 10:05:20 +00:00
Neil Fuller
8ff7b0e3a6 Isolate Local(Server|)SocketTest CTS tests
Tests are failing with "Address in use". It does not repeat when the
test is run locally.

It is unclear why this has started happening: all tests should be
closing their respective sockets. This change will either prevent
conflicts between tests or help debug if they continue to fail.

Bug: 26140463
Change-Id: I72172b70e00936a6cca9d35c7977fe191621b0cc
2015-12-14 13:47:55 +00:00
Sergio Giro
ee3370d33a Merge "frameworks/base: add tests for AbstractVerifier" am: f4756068ed am: 05c2b772a3
am: 6449e09912

* commit '6449e09912dd7d26e0c1fc8fa7c64b3442d39ef2':
  frameworks/base: add tests for AbstractVerifier
2015-11-27 14:19:43 +00:00
Sergio Giro
6449e09912 Merge "frameworks/base: add tests for AbstractVerifier" am: f4756068ed
am: 05c2b772a3

* commit '05c2b772a3b80b8bcfe384fac47dd3efb63480fc':
  frameworks/base: add tests for AbstractVerifier
2015-11-27 14:16:39 +00:00
Sergio Giro
615ffeb922 frameworks/base: add tests for AbstractVerifier
DistinguishedNameParser was moved to frameworks/base in
46972b2d825a2368706e7d2210559ca18fc2b332

Testing its behaviour through AbstractVerifier.

DistinguishedNameParserTest adapted from
f7ce6a3b235a9aaf884d3b96e50d6b249dd770e0

Bug: 25882613

Change-Id: Idf901503d96df8b160d84f4f88dbf79359f0e035
2015-11-27 13:55:32 +00:00
Daniel Xie
eb2b399ce9 Merge "Don\'t run Wifi scan timestamp tests when location is turned off." into marshmallow-cts-dev am: 57031aa47e am: 3f0866e144 am: 9bfb43c08f am: 3b7e1623b3
am: df3a267558

* commit 'df3a2675583188747cc04e7e9daa141f7ca3b53d':
  Don't run Wifi scan timestamp tests when location is turned off.
2015-11-17 04:16:41 +00:00
Daniel Xie
975335db32 Merge "Don\'t run Wifi scan timestamp tests when location is turned off." into marshmallow-cts-dev am: 57031aa47e am: 3f0866e144 am: 9bfb43c08f am: 3b7e1623b3
am: df3a267558

* commit 'df3a2675583188747cc04e7e9daa141f7ca3b53d':
  Don't run Wifi scan timestamp tests when location is turned off.
2015-11-17 01:45:02 +00:00
Wei Wang
abe587984a Don't run Wifi scan timestamp tests when location is turned off.
Bug:24957400
Change-Id: I891040ffc0808d62a8f5f1bb20fd633b9f7f482c
2015-11-10 14:23:55 -08:00
Nash Lincoln
0784f04f1b migrate net host tests to cts_v2
Change-Id: Ida3141522a536a2d33bb366fdb6b00ced907c3a4
2015-11-06 17:05:17 -08:00
Daniel Xie
935fba1ab2 Squashed mnc-dev changes:
This contains all of the changes from b54aa51 to
791e51a on mnc-dev, except the changes
to tests/tests/security.

Bug: 24846656
Change-Id: I01f53a1a238ac49f86928e0e22796dc73e0e34af
2015-10-19 16:01:03 -07:00
Aaron Holden
58bb58ab7b Move WiFi Precondition from device to host side
This enables the option to synchronously connect to a Wifi network if
not already connected.

bug:23939594
Change-Id: I2c808fc95acba324ee72564d08983a2b6e00db95
2015-10-09 12:33:25 -07:00
Stuart Scott
48d6d1ed5f Remove common-config and switch to AndroidJUnitTest.
bug:21762834
Change-Id: I17e1b44e4429a3fbeb9f110a74038e4ec306af38
2015-10-06 10:55:25 -07:00
Aaron Holden
c75c7e30f6 Cleanup of CTS Preconditions work
- removed unused constant from ScreenLockHelper class
- used getProperty method of ITestDevice, instead of executeShellCommand
- modified BuildCheckTest to reflect use of 'getProperty' method above
- placed target preparer for Wifi check above apk installer, so apk
isn't installed until precondition check has passed
- removed unused imports in net module's PreconditionsTest
- added Wifi precondition check to content, text, webkit & widget modules

bug:23939594
Change-Id: I125b9937b974d142c0d2343f584516bfc713787a
2015-10-06 09:50:57 -07:00
Stuart Scott
f9a13a9b49 Migrate Admin to CTSv2.
bug:21762834
Change-Id: Ibec9df07e2f635218bdae70ddf36fda6e60de0e0
2015-10-05 13:36:17 -07:00
Aaron Holden
d62c5997f6 Add WiFi precondition check to 'net' CTS module
bug:23939594
Change-Id: I9e625e635fc6942c9eaa95915888f0fe7284a9ea
2015-09-28 13:17:30 -07:00
Paul Jensen
69ab5795b1 am c9ab5af9: am 8fafeb28: am df4f2629: am a1b4d2de: am 22e42b48: resolved conflicts for 3e4042eb to mnc-dev
* commit 'c9ab5af9f2a811e2b6459b077092c29ca13b6f6d':
  CTS: verify ConnectivityManager.requestNetwork throws for restricted networks
2015-09-25 18:16:04 +00:00