Commit Graph

371 Commits

Author SHA1 Message Date
Felipe Leme
52be3a68ad Refactored tests to use 'list wifi-networks'.
BUG: 27808364
Change-Id: Ife3f35e9c3c6a4285b671eeb7d7d0223be908a1b
2016-04-01 15:40:41 -07:00
Felipe Leme
af092432df Merge "Moved wi-fi switch to hostside." into nyc-dev 2016-04-01 17:40:15 +00:00
Philip P. Moltmann
058f525d35 Merge "Test that we can set and read txt records." into nyc-dev 2016-03-31 03:52:48 +00:00
Felipe Leme
eac0fe6ab1 Moved wi-fi switch to hostside.
BUG: 27808364
Change-Id: I89bca5f5ba90a7dc145d2ac170fd505161fd073d
2016-03-30 18:17:43 -07:00
Felipe Leme
bbb00ffc0f Fixed build broken by bad merge.
BUG: 27324964
Change-Id: Idbe6f8237b560db31eb949971358db41ac00d530
2016-03-30 16:37:24 -07:00
Felipe Leme
eb7e5053c1 Test network restrictions while on foreground service state.
BUG: 27324964
BUG: 26776313

Change-Id: Idcd0a391333d243d17b6bd68c67becaad2b37fdd
2016-03-30 22:32:27 +00:00
Felipe Leme
9a4643cd0e Improved test case for blacklist access.
BUG: 27127112
BUG: 26685616

Change-Id: I8b183cdb1cf5ebbc446176a042e4196ab063f1a3
2016-03-30 22:27:51 +00:00
Felipe Leme
3787c6bb7e Merge "Refactored method to get UIDs." into nyc-dev 2016-03-30 17:09:11 +00:00
Felipe Leme
c3d29ebf21 Refactored method to get UIDs.
BUG: 27904062
Change-Id: Ib0d3911f40e0a5deed833f71e75abd10a224768f
2016-03-30 10:07:20 -07:00
Felipe Leme
3aef04bf0d Merge "Added sanity check to verify process state." into nyc-dev 2016-03-30 15:41:51 +00:00
Felipe Leme
de7cbcf6ee Added sanity check to verify process state.
BUG: 26776313
BUG: 27324964

Change-Id: I209c04d5c6d89acdac9b5bdaee5a4dbd7700c53e
2016-03-29 17:57:14 -07:00
Philip P. Moltmann
10788e7864 Test that we can set and read txt records.
Bug: 27696905
Change-Id: I494665adeb8a859791bb5d08fe5b6ee73f20ac8d
2016-03-29 11:28:23 -07:00
Wally Yau
825b3f1595 Merge "Fixed test for lingering traffic data." into marshmallow-cts-dev am: 0f7a74c am: 8bdae23 am: 810b12c am: 324a5da
am: 9a60672

* commit '9a606728458d1abc646fd39d32d273a5634c9142':
  Fixed test for lingering traffic data.
2016-03-28 18:36:11 +00:00
Wally Yau
324a5da160 Merge "Fixed test for lingering traffic data." into marshmallow-cts-dev am: 0f7a74c am: 8bdae23
am: 810b12c

* commit '810b12cbb62c4c91f5deab49b228916bdb6f2708':
  Fixed test for lingering traffic data.
2016-03-28 18:12:25 +00:00
Ningyuan Wang
ebbfd8ce11 handle null mScanResult for CTS test
This adds one more assert statement to ensure the ScanResult
variable is not null before we proceed.

Bug: 27744749
TEST=run cts test without error

Change-Id: I48f3c5369792d3a55b594b71250b0dfdf0d5282b
2016-03-22 16:42:18 -07:00
Nicholas Sauer
a552317982 [CTS] - Set test runtimes
bug: 27747405
Change-Id: If08ec156678d5435c88d9f179d3bacd064493aff
2016-03-19 00:10:02 +00:00
Felipe Leme
275d05f0d3 Re-try commands that set/get metered networks.
BUG: 27671582
Change-Id: I9160a964b44e6d48d8932dc1e1ea7702a5359885
2016-03-17 14:08:46 -07:00
Paul Stewart
104fd51f87 WifiManagerTest#testWifiWatchdog: Disambiguate failures
There is nothing in the WifiWatchdog test that supports the
assumption that the device under test is pre-configured with a
working WiFi network configuration.  This CL makes it possible
from the test stack trace whether the test failed at the
beginning or during the reconnections.

Bug: 27638295
Change-Id: Iff1bd398c74076fb1a969741818562ea582e868e
2016-03-16 12:39:03 -07:00
Kevin Ma
604deb783c Add theater mode test. am: d857ae7745
am: 6b5cb02329

* commit '6b5cb023290fa341f1ed68b91df41fd6cd491185':
  Add theater mode test.
2016-03-14 22:38:24 +00:00
Kevin Ma
f1b8dcd75b Merge "Add Airplane mode test." into cw-e-dev am: c7e43bddd3
am: 1525e170ea

* commit '1525e170eabb306f6c193d40570a9f99ccf337c4':
  Add Airplane mode test.
2016-03-14 22:18:09 +00:00
Kevin Ma
d857ae7745 Add theater mode test.
Change-Id: Ie4c4d690fc1b10e917104536e7224c667365db6e
2016-03-14 15:15:42 -07:00
Kevin Ma
744f5e2688 Add Airplane mode test.
Change-Id: If3bfa92828cdc878b2f994beafc41faba7398feb
2016-03-14 15:05:37 -07:00
Roshan Pius
2bbc892a80 Wifi Cts: Set 'disableOthers' flag in enableNetwork
Wifi framework only enables a network if it is going to connect to it
which is not the case when 'disableOthers' flag is false.

BUG: 27567420
Change-Id: I45d39f4f8efebd7e19fd0bcf5bd97a68d08217ee
2016-03-14 12:09:58 -07:00
Felipe Leme
f448ccd08d Print uid when running network checks.
BUG: 27570398
Change-Id: I4dcbd4e41641c406c687a0e29e2637581d91b17c
2016-03-09 15:10:55 -08:00
Felipe Leme
b3cc6ef3ae Added tests for battery save mode on non-metered networks.
BUG: 27127112
Change-Id: I4a05194a32294d15badfaa4156606e728f943a9a
2016-03-09 12:27:32 -08:00
Wally Yau
d7f1dbef66 Fixed test for lingering traffic data.
Change-Id: I7d68a518e25e17dbbaa57b12e2af4dc57b8df8d3
2016-03-07 16:16:09 -08:00
Felipe Leme
37c0bf0477 Added CTS tests for apps that are blacklisted for restricted background data.
BUG: 27432317
Change-Id: Ie9156ab4f2fa7c639d8e9a978954e09b322d6187
2016-03-02 14:35:20 -08:00
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