Commit Graph

523 Commits

Author SHA1 Message Date
Etan Cohen
eeea3d5510 [RTT][CTS] Add information to assert to help debug failures
Modify the assert message to print out the # of failures and the total
number of iterations. Will help diagnose scope of test failures.

Bug: 109836816
Test: atest WifiRttTest
Change-Id: Ic4d5b6844225edbd9704694c539e31754b7a340c
2018-06-14 08:51:43 -07:00
Lorenzo Colitti
78f8585339 Wait a few seconds for IPv6 connectivity to appear.
Currently, DnsTest immediately executes a DNS lookup as soon as
it starts. If the device has just connected to a network - as it
might if the test framework has just enabled wifi - and IPv6
connectivity is not yet available, the test will fail with little
proof that the network doesn't have IPv6.

Fix this by waiting for IPv6 connectivity and by adding the
active LinkProperties to the failure message.

Bug: 109670546
Test: DnsTest passes on dual-stack network
Test: DnsTest fails on IPv4-only network
Change-Id: I88b8d001f08fe41af666bccf8094c67729dda9c2
2018-06-05 16:12:41 +09:00
Etan Cohen
13c598050a [RTT] Add sanity checks for RTT ranging results
Add checks to validate that the reported number of measurements and
of successes is reasonable: non-zero for successful results.

Bug: 79879905
Test: 'atest WifiRttTest' passes
Change-Id: Ie79b10edacb660dd8c5d116539a4ee5cc32a779d
2018-05-16 15:44:42 -07:00
Etan Cohen
346856ab46 Revert "[RTT] Disable RTT CTS"
This reverts commit 14c32a88c15f2e00647a226c1e670967a683dcf7.

Enable Wi-Fi RTT CTS in production.

Bug: b/74457054
Test: atest CtsNetTestCases:WifiRttTest
Change-Id: Ia60776dbf60406d3665b01c7fecb3c9cd1a6c8ee
2018-05-16 15:31:57 -07:00
Etan Cohen
01d63b603e [RTT] Update CTS to auto-select test AP
Update CTS to select a test AP:
- Scan for APs
- Select the APs supporting IEEE 802.11mc
- Pick the AP with the highest RSSI

Bug: 74518964
Test: atest WifiRttTest (and pick the CTS test)
Change-Id: I6467c75eedcc8260703d2a99214154c9e888cce9
2018-05-16 15:31:57 -07:00
Etan Cohen
b58779a4e1 Revert "[RTT] Modify CTS tests to use associated AP information"
This reverts commit 47d58e2a69.

The revert restores the older method of test AP selction: hard
code the name of the test AP. Subsequent CLs will update to
preferred test AP selection method.

Bug: 74518964
Test: atest WifiRttTest (with rest of CL stack)
Change-Id: Iab71978607aeaf37babdb1afdaeca5c114ccdbf7
2018-05-16 15:31:57 -07:00
Benedict Wong
9d623ccbba Merge "Add CTS support for eBPF" into pi-dev 2018-05-08 17:13:45 +00:00
Rebecca Silberstein
d8752ba525 WifiManagerTest: allow for multiple modes
Now that WifiService can/will support dual simultaneous mode operation, make
sure the tests allow for it as well.

Bug: 31346104
Test: atest android.net.wifi.cts
Change-Id: Id3aaacb3651568c18850a0fdf3832c0f52218cf2
2018-05-02 10:41:18 -07:00
Benedict Wong
27d1957bee Add CTS support for eBPF
Addition of eBPF requires tweaks regarding packet counting of
UDP-encapsulated-ESP packet bytes. This patch conditions the expected
number of bytes received based on eBPF being enabled

Bug: 74113670
Test: Ran CTS tests, passing on 3.18, 4.4, 4.9 kernels
Merged-In: If02a4bb6ebfdf949fdb58b5816aa9d252d9eef52
Change-Id: If02a4bb6ebfdf949fdb58b5816aa9d252d9eef52
(cherry picked from commit e061f54d7215729309e9e977743f5b28813878b0)
2018-04-25 13:58:14 -07:00
Roshan Pius
7457ee7eb8 WifiManagerTest: Fetch scan results only on scan success
When wifi location scans are off, the scan is expected to fail. But,
WifiManager.getScanResults() could still return results from the last
scan. This was causing the test to fail because it was relying on
|mScanResults| being null to detect scan failure.

Also, changed the scan done internal state name in the test to more accurately
reflect that scan has been completed (could be success or failure).

Bug: 77601152
Test: Ran `atest android.net.wifi.cts.WifiManagerTest#
testWifiManagerScanWhenWifiOffLocationTurnedOn` with location turned on,
but wifi scans turned off.

Change-Id: I6d5203a836d86d03fbb8e9af0035fe951a6b9db8
2018-04-24 13:56:43 -07:00
Roshan Pius
e549804b9d WifiManagerTest: Don't assert for isScanAlwaysAvailable
This may not be true on all platforms (Android wear for example don't
want to support this functionality)

Bug: 78242827
Test: atest android.net.wifi.cts
Change-Id: I73ab8cd31a9b4a29bd47f8e47957c921a0b16fa3
2018-04-18 15:48:33 -07:00
Etan Cohen
7530899eb8 [RTT] Increase CTS coverage
Increase CTS coverage by utilizing additional methods.

Bug: 77915947
Test: atest WifiRttTest
Change-Id: Ibc560aafb317fb27fd969b8899cc49c5cd7a979f
2018-04-13 15:17:15 -07:00
TreeHugger Robot
1026eaee92 Merge "ScanResultTest: Retry scan attempts on failure" into pi-dev 2018-04-12 23:58:51 +00:00
Roshan Pius
021f8dde9b ScanResultTest: Retry scan attempts on failure
Scans can fail for multiple reasons (throttling, driver error, framework
aborting scans, etc). Add a retry mechanism for scans in this test
because these tests are dependendent on a successful scan being
completed.

Bug: 77601110
Test: atest ScanResultTest#testScanResultTimeStamp
Test: atest android.net.wifi.cts
Change-Id: Ic15e455394dde6fc01c01ea7f3eed2e27976d666
2018-04-06 15:43:37 -07:00
Lorenzo Colitti
356139091d Revert "Add cts to test unwanted capabilities api"
This reverts commit bf6a2ad00c.

Bug: 77601789
Test: atest android.net.cts.NetworkRequestTest
Change-Id: Ib3db82e889ed4ca050a837b1169a9da8e17bb424
2018-04-06 22:44:19 +09:00
TreeHugger Robot
4997cbc5ae Merge "Add cts to test unwanted capabilities api" into pi-dev 2018-04-04 16:55:14 +00:00
Ricky Wai
934dd7cacc Merge "Set empty watchlist test config before CTS" into pi-dev 2018-04-03 17:28:13 +00:00
Pavel Maltsev
bf6a2ad00c Add cts to test unwanted capabilities api
Test: atest android.net.cts.NetworkRequestTest
Bug: 74945408
Bug: 72828388
Change-Id: I19099a3d7a555f610c96eb1859493903152e10a3
2018-04-03 09:55:54 -07:00
TreeHugger Robot
38c80d304a Merge "Add CTS tests for getMultipathPreference" into pi-dev 2018-04-02 11:56:24 +00:00
Lorenzo Colitti
0599bb578e Merge changes from topic "generic-sockets" into pi-dev
* changes:
  Prevent CTS from hanging if no UDP packet was received
  Switch checkTcp and checkUnconnectedUdp to use generic sockets
  Add generic socket interfaces and functions
  Add GCM to algorithms tested in CTS
2018-03-31 07:37:11 +00:00
Ricky Wai
087de1c815 Set empty watchlist test config before CTS
Test: CTS pass
Bug: 63908748
Change-Id: I8b607feb44f873aced1ae3c2ff02c02f0553fb10
2018-03-30 23:56:35 +00:00
Benedict Wong
cbe0a822b7 Merge "Update encapSocket API calls to getFileDescriptor" into pi-dev 2018-03-30 20:28:19 +00:00
Benedict Wong
b9b074bc03 Prevent CTS from hanging if no UDP packet was received
Previously, CTS tests could block forever on attempting to read a packet
from a UDP socket.

This patch modifies the receive methods of the NativeUdpSocket wrapper,
allowing it to gracefully fail if UDP packets are not received.
This patch also updates the IKE over UDP encap socket test to use the
NativeUdpSocket wrapper, preventing the tests from hanging in the same
fashion.

Bug: 70938121
Test: Ran updated tests on walleye + marlin
Merged-In: I390e4585e85647eb8555e706d44b76f95dec931f
Change-Id: I390e4585e85647eb8555e706d44b76f95dec931f
(cherry picked from commit e2fcb9d64ba10f07a69a6b96a7f7e1465856172a)
2018-03-30 11:25:50 -07:00
Benedict Wong
60b87e1f6d Switch checkTcp and checkUnconnectedUdp to use generic sockets
This patch switches IpSecManager checkTransform() tests to use generic
sockets, allowing for exercising of Java sockets as well as native/OS
sockets.

Bug: 76152303
Test: This; ran on Walleye
Merged-In: I515227e7aa04c424aefbbe46209ddce81421b2f1
Change-Id: I515227e7aa04c424aefbbe46209ddce81421b2f1
(cherry picked from commit 796f61bb7be36f66302311f89caa74a3a3f13dad)
2018-03-30 11:25:42 -07:00
Benedict Wong
c33ed347f0 Add generic socket interfaces and functions
This patch adds functionality to unify java and native sockets. This is
part one of two of a change to allow functionality for testing full
coverage of all APIs.

Bug: 76152303
Test: Ran tests on Walleye
Merged-In: I9bd57d6267f82d8c1ac293a0147dc2c115dd4181
Change-Id: I9bd57d6267f82d8c1ac293a0147dc2c115dd4181
(cherry picked from commit d524e0785c7bbe5c7987f8ae01fdc5d57e13545d)
2018-03-30 11:25:31 -07:00
Benedict Wong
3c0ad1ddcc Add GCM to algorithms tested in CTS
This change adds all combinations of GCM algorithms, ensuring proper
support, config flags, and data accounting. Algorithm for calculating
size of packets has also been made more generic to allow for calculation
based on different encryption algorithms.

Bug: 73261868
Test: This
Merged-In: Ib77ac237fee75415223f0291cecc0b60ce76b77f
Change-Id: Ib77ac237fee75415223f0291cecc0b60ce76b77f
(cherry picked from commit f64579bceb6287f09503d940619d096aa8c1ac0d)
2018-03-30 11:25:14 -07:00
Benedict Wong
c8d2a142f0 Update encapSocket API calls to getFileDescriptor
This change updates the getSocket calls to getFileDescriptor, persuant
to new API.

Bug: 72473753
Test: CTS tests run on walleye
Merged-In: I65479cb35c88aee1f65c8597c3382cd30fa8d4a9
Change-Id: I65479cb35c88aee1f65c8597c3382cd30fa8d4a9
(cherry picked from commit 94d33818769cf60b9801b39875f5bc5dff2dc734)
2018-03-30 11:24:50 -07:00
Jeff Sharkey
12bd94f72e Merge "API council requested tweaks to NetworkRequest." into pi-dev 2018-03-30 16:30:23 +00:00
Chalard Jean
8d96a68560 Add CTS tests for getMultipathPreference
Test: Test passing with 1 or more connected wifis
      No wifi won't pass but it's already a requirement
Bug: 34630278

Change-Id: I43bf18943fbd00dc29417b18604e29f9111ec0b2
2018-03-30 23:07:21 +09:00
Paul Jensen
d3b6046c65 Add CTS test for Network.fromNetworkHandle()
Bug: 77210159
Bug: 64148938
Test: make CtsNetTestCases

Change-Id: I38d34cb4af681f1b1030d7f8d0404af210e43912
2018-03-29 07:29:33 -04:00
Jeff Sharkey
ee374f3929 API council requested tweaks to NetworkRequest.
If you put values into the Builder, you should be able to observe
those values on the built object.

Test: atest android.net.cts.NetworkRequestTest
Bug: 74945408
Change-Id: I894a82c10eb13c46fb764384e6c5348dde8df154
2018-03-28 16:04:02 -06:00
Benedict Wong
7fc961f929 Add tests where only auth or crypt are enabled
This patch adds tests for cases where only auth or crypt are enabled.
These cases are supported, and this patch adds test coverage.

Bug: 75049573
Test: this, run on walleye
Merged-In: I656d9c4a86c13ce4928d6bd68a9e0d48cf805191
Change-Id: I656d9c4a86c13ce4928d6bd68a9e0d48cf805191
(cherry picked from commit 69517633288bac80d31f53720b2837b261926485)
2018-03-23 11:06:19 -07:00
Benedict Wong
458bdc8532 Add tests for IPsec SPI expiration timer changes
This change adds tests to ensure that SPI expiration timers are set to a
high value, greater than 1 hour (3600s).

Bug: 72316671
Test: Ran this, and MultiNetworkSysCtlTest.
Merged-In: Ib4776322bd5df772a3700b6e7ed1b5e7ed6b4637
Change-Id: Ib4776322bd5df772a3700b6e7ed1b5e7ed6b4637
(cherry picked from commit 45bc61034edee35d4ea5ab1753e15411d4c9d15c)
2018-03-20 11:29:58 -07:00
TreeHugger Robot
b93a68bb8c Merge "[NET][WIFI] Add OWNERS file for Net + Wi-Fi Aware/RTT tests" into pi-dev 2018-03-20 01:07:32 +00:00
Etan Cohen
c61122e056 [NET][WIFI] Add OWNERS file for Net + Wi-Fi Aware/RTT tests
Add OWNERS file for:
- Default net
- Wi-Fi Aware/RTT

Bug: 74954883
Test: N/A
Change-Id: I80105cd68be10b268bd9277e43e6ff08683a47fc
2018-03-19 23:24:02 +00:00
Etan Cohen
d0c37e8d1b [RTT] Remove testAvailabilityStatusChange because of lack of triggering API
The availability status change test performs the following:
- Disable RTT
- Verifies broadcast informing of RTT status change arrives (and then
  validates disabled)
- Enable RTT
- Verifies broadcast informing of RTT status change arrives (and then
  validates enabled)

However: there is no API available to CTS (to apps) to disable RTT in
a robust way:
- No APM control API
- Disabling Wi-Fi is possible but that only disables RTT if scans are
  also disabled and there is no API for that and the rest of the tests
  requires scans to be on (higher priority tests).

Bug: 74518964
Test: atest CtsNetTestCases:WifiRttTest
Change-Id: Ieaeca065661cebae1921933fad56f82dd6f30c2f
2018-03-15 11:41:20 -07:00
Etan Cohen
47d58e2a69 [RTT] Modify CTS tests to use associated AP information
Update the test to use the associated AP as the test AP:
- Make sure associated
- Find associated AP
- Disable Wi-Fi
- Run test
- Enable Wi-Fi

Bug: 74518964
Test: CtsNetTestCases:WifiRttTest pass
Change-Id: I0ee4eb56f32b4b3d119b86442d8e5912a6694fc8
2018-03-14 17:25:12 -07:00
Roshan Pius
9b397a50e5 Merge "WifiManagerTest: Check if scan is currently available" into pi-dev 2018-03-14 15:25:37 +00:00
Etan Cohen
fbb4ac835d [RTT] Disable RTT CTS
Pending infrastructure support for RTT APs.

Bug: t/31350604
Bug: b/74457054
Test: atest CtsNetTestCases:WifiRttTest
Change-Id: I23c3912336de17bec6717f79b10e1f83e0717658
2018-03-13 17:00:10 +00:00
Etan Cohen
439c05ce8b [RTT] CTS for the public Wi-Fi RTT APIs
Baseline set of tests for the public Wi-Fi RTT API.

Note: some of these tests require an IEEE 802.11mc capable AP.

Bug: 63446747
Test: tests pass
Change-Id: I176d9adbef15ce1c33b4572d5eb7e6cdf672f021
2018-03-13 07:55:16 -07:00
Roshan Pius
ace44ad873 WifiManagerTest: Check if scan is currently available
Changes in the CL:
a) Separate the scan part of testWifiManagerActions test into a
separate test.
b) The new scan test should check the |WIFI_SCAN_AVAILABLE| broadcast to
determine if the scan is expected to pass or not.

Bug: 72863107
Test: `atest
android.net.wifi.cts.WifiManagerTest#testWifiManagerActions`
Test: `atest
android.net.wifi.cts.WifiManagerTest#
testWifiManagerScanWhenWifiOffLocationTurnedOn`
Change-Id: I595c73152459ab09ad4061997b02a7165106915c
2018-03-09 16:31:53 -08:00
Etan Cohen
c548e56342 Merge "[AWARE] Update CTS for (new) Aware Location Mode behavior" 2018-03-02 15:48:23 +00:00
Eugene Susla
618eb894c9 Merge "Fix ConnectivityManagerTest" 2018-03-01 20:50:29 +00:00
Etan Cohen
aca8ac117e [AWARE] Update CTS for (new) Aware Location Mode behavior
Aware is now disabled whenever Location Mode is off. Update CTS
to check for Location Mode and fail if not available with relevant
notification.

Bug: 70218191
Test: CTS tests fail with Location Mode off
Test: CTS tests pass (with known failure for MAC randomization) with Location Mode on
Change-Id: I0739012a2a5fce56e76c1607e7b700c12fa8e083
2018-03-01 08:05:34 -08:00
Eugene Susla
3038dd2b7d Fix ConnectivityManagerTest
Fixes: 72455858
Test: ensure bug fixed
Change-Id: I843cb0f15389472a81f61d5c0b5814423c231fe4
2018-02-28 14:35:12 -08:00
Chenbo Feng
3aedd8b21a Check qtaguid support before private stats test
The AccessPrivateDataTest and CreatePrivateDataTest is directly testing
the proc file of xt_qtaguid module. These two test will no longer valid
after we block the access from untrusted app to qtaguid proc file. So
remove the AccessPrivateDataTest and added a new qtaguid test to make
sure apps with SDK 28 or above cannot access qtaguid proc file.

Bug: 30950746
Bug: 68774956
Test: run cts -m CtsAppSecurityHostTestCases \
	-t android.appsecurity.cts.AppSecurityTests

Change-Id: I957ba31fea392982e7d15eda2afd9580299192f2
2018-02-28 02:54:32 -08:00
Adam Vartanian
57e1941be9 Merge changes from topic "am-325cd506-a538-4cb7-a65c-bc30576c59e9" into oc-dev am: fb27c032ff am: 3c22d6bea8 am: bbc39aba5b
am: df4e5f9902

Change-Id: I1f9a8d36b810c58a435d88f1acc19e61ed9bdd56
2018-02-03 23:42:59 +00:00
Adam Vartanian
df4e5f9902 Merge changes from topic "am-325cd506-a538-4cb7-a65c-bc30576c59e9" into oc-dev am: fb27c032ff am: 3c22d6bea8
am: bbc39aba5b

Change-Id: Ic129a3fdff54705ba345cd032a0b17ce502ac5c9
2018-02-02 03:58:55 +00:00
Adam Vartanian
bbc39aba5b Merge changes from topic "am-325cd506-a538-4cb7-a65c-bc30576c59e9" into oc-dev am: fb27c032ff
am: 3c22d6bea8

Change-Id: I2fe9d75f0bf5b94f2fa0b2d0a819f2b8281ccf7b
2018-02-02 03:32:08 +00:00
Etan Cohen
4fa2e9968e Merge "[AWARE] Remove "Respond to ANY" API - dummy tests deprecated" 2018-01-31 16:05:05 +00:00