Commit Graph

356 Commits

Author SHA1 Message Date
Neil Fuller
a8574413ed Add CTS tests for LocalSocket read/write timeouts
The behavior was not previous covered and broke in N
due to commit c80af6d8. There is an associated fix
in frameworks/base.

Some refactoring of existing tests to reduce
duplication and tidy up sockets after tests.

Test: Ran the new CTS test (before and after related fix)
Bug: 31205169
(cherry picked from commit 52376fc1c8)

Change-Id: I9ee96a91abbdaaba64c2f6daf49c92d1b23352e2
2016-08-31 18:18:02 +01:00
Phil Weaver
79fad1a209 Merge "CTS: Only listen to wifi events when toggling wifi" into nyc-dev 2016-06-23 01:48:11 +00:00
Phil Weaver
0d7d1da503 CTS: Only listen to wifi events when toggling wifi
When counting all connectivity changed events, we were failing
on devices with sim cards because we were counting both wifi and
mobile connectivity changes the same. Since the test only
toggles wifi, changing the listener only to pay attention to wifi
changes.

Bug: 29346253
Change-Id: I1ed3b976bc21419218c780d4afc4a5e73f128496
2016-06-22 16:50:38 -07:00
Jun Tahara
86ba00d2a9 Merge \\\\\"Remove non-CTS packets assertion code\\\\\" into marshmallow-cts-dev am: 0ba763ab98 am: 6ce150c6ae am: 5c4a3982a8 am: fd1fb4d863
am: 995005d649

Change-Id: I40f34d7a22b09a4ef5a4190f2a236b643062f306
2016-06-22 00:20:07 +00:00
Jun Tahara
fd1fb4d863 Merge \\\"Remove non-CTS packets assertion code\\\" into marshmallow-cts-dev am: 0ba763ab98 am: 6ce150c6ae
am: 5c4a3982a8

Change-Id: Idcd4a248c8f74e095ba4162d8a468dbd962c8163
2016-06-22 00:14:51 +00:00
Lorenzo Colitti
abc35d5527 Clear local test results across DNS lookups.
If InetAddress.getAllByName("ipv6.google.com") throws
UnknownHostException, the test silently ignores it. This
causes a misleading failure, because the test then reuses the
addrs variable that is left over from the previous DNS query
for "www.google.com", and fails because it has an IPv4 address.

Fixes: 12210306
Bug: 29231261
Change-Id: I1dde945765d40a84eba139055306b07ebc97d0ec
2016-06-21 13:39:49 +09:00
Jun Tahara
349f7ed040 Remove non-CTS packets assertion code
Symptom:
testTrafficStatsForLocalhost fails when applications or services
except CTS are using network.

Root cause:
testTrafficStatsForLocalhost can't calculate the number of
non-localhost packets for CTS.
It includes the all of packets for applications/services except CTS
and non-localhost packets for CTS.

Solution:
Remove this assertion and only logging the number of packets.

Change-Id: I49243d59f359f3a543c6bdb46f6a2645cde8f292
2016-06-20 17:50:39 +09:00
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
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
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
TreeHugger Robot
25a61dcae9 Merge "Add more test coverage to ConnectivityManagerTest." into nyc-dev 2016-04-27 10:21:48 +00: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
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
Owain Davies
c408601c24 Add assertion message if testDns ipv6 lookup reutrns ipv4.
Some partner test networks connect by VPN and if the connection
fails during the testing this test will fail as the local internet
provider intercepts the DNS request and returns an ipv4 address.

Added a message to check the network configuration and rerun the test.

Bug: 26560000
Change-Id: I54e4976b2cef549bfe9fd55ff9609ba2e6513239
2016-04-14 16:12:38 +01:00
Owain Davies
8884aac68d Added assertion message to testDns failures
Identify tests that fail testDns because of no network connection.

Bug:26560000
Change-Id: I7683d54d2932ec46c5850bf360c602f6548b179e
2016-04-14 15:54:44 +01:00
Dianne Hackborn
d5dc8fe740 Test for issue #28156248: Receiving connectivity receiver...
...broadcasts in Android N

New test to verify that modern apps can't receive CONNECTIVITY_CHANGE.

Change-Id: I9c5b6e99d14b782b3857460d8297f6a405545d87
2016-04-13 18:05:50 -07:00
Erik Kline
8d422e8c57 Extend CTS test coverage to include registerDefaultNetworkRequest()
Change-Id: I36491c2697ed1510da38c06324d2e4ddf653bc4e
2016-04-06 12:31:32 +09: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
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
Wally Yau
d7f1dbef66 Fixed test for lingering traffic data.
Change-Id: I7d68a518e25e17dbbaa57b12e2af4dc57b8df8d3
2016-03-07 16:16:09 -08:00
Stuart Scott
a9e563cf83 Switch to CTSv2
bug:21762834
Change-Id: Ie51a0ed4560b46c2f360e14980e5fab7fe6479fe
2016-02-29 21:51:59 -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
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