Commit Graph

1025 Commits

Author SHA1 Message Date
Benedict Wong
aa96bdc3a8 Merge "Add CTS support for eBPF" am: 5cf3c2fe86
am: 480d14e881

Change-Id: I8d0ff6e935d7495c14129fbf7334973417166bdd
2018-04-25 17:42:34 -07:00
Benedict Wong
fe9b0a791e 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
Change-Id: If02a4bb6ebfdf949fdb58b5816aa9d252d9eef52
2018-04-20 02:02:51 +00: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
Chalard Jean
8d66f2dc82 Merge "Add CTS tests for getMultipathPreference" 2018-04-03 09:16:09 +00:00
TreeHugger Robot
3233266e8d Merge "Allow net and media CTS tests to use hidden APIs" into pi-dev 2018-04-03 06:18:49 +00:00
Chalard Jean
8a0530bb9c 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
Merged-in: I43bf18943fbd00dc29417b18604e29f9111ec0b2
Merged-in: Ie90ca72ea3606dea4259984d42762dd742d59970
2018-04-03 05:27:38 +00:00
TreeHugger Robot
38c80d304a Merge "Add CTS tests for getMultipathPreference" into pi-dev 2018-04-02 11:56:24 +00:00
Jiyong Park
b58fc866b4 Allow net and media CTS tests to use hidden APIs
MediaRecorderTest uses EncoderCapabilities.getVideoEncoders().
WifiManagerTest uses WifiManager.getTxPackageCount().

Pass the 'hidden-api-checks=false' flag to temporarily exempt the two
CTS packages from the hidden api check. We eventually should fix the
hidden API usage completely or exempt the violating tests only.

Bug: 77436928
Test: atest CtsMediaTestCases
Test: atest CtsNetTestCases
Change-Id: I85efbb08c24b87079c0360fc3f9a2267462592f0
2018-04-01 17:05:33 +09: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
Benedict Wong
ef1a43e2c1 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
Change-Id: I390e4585e85647eb8555e706d44b76f95dec931f
2018-03-30 18:17:21 +00:00
Benedict Wong
376335421e 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
Change-Id: I515227e7aa04c424aefbbe46209ddce81421b2f1
2018-03-30 18:15:36 +00:00
Benedict Wong
3f6d149f3d 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
Change-Id: I9bd57d6267f82d8c1ac293a0147dc2c115dd4181
2018-03-30 18:14:46 +00:00
Benedict Wong
2a4463d257 Merge "Add GCM to algorithms tested in CTS" 2018-03-30 18:14:14 +00: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
Lorenzo Colitti
8f507d4edd Merge "Update encapSocket API calls to getFileDescriptor" 2018-03-30 04:58:47 +00:00
Lorenzo Colitti
9269dc3d3f Merge "Add CTS test for Network.fromNetworkHandle()" into pi-dev 2018-03-30 01:36:10 +00:00
Sudheer Shanka
217aee2c9c Merge "Don't reset battery status before disabling battery saver mode." into pi-dev 2018-03-29 19:32:56 +00:00
Sudheer Shanka
6d389c2bfc Don't reset battery status before disabling battery saver mode.
Resetting battery status makes the "disabling battery saver mode"
operation that follows it a no-op if the device is plugged-in to power.
In this case, sticky battery saver status won't get reset and might
affect the tests following it.

Also, change back turnBatteryOff -> "cmd battery reset" since issue "72502904"
is fixed now.

Fixes: 77236363
Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests

Change-Id: I93e11c714200e8de6864a3bd7627eb66842a39d1
2018-03-29 10:29:16 -07:00
Sudheer Shanka
b4c9ba42b0 Merge "Turn screen-on if needed, on every iteration network access is verified." into pi-dev 2018-03-29 14:03:06 +00: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
Sudheer Shanka
10864275fb Turn screen-on if needed, on every iteration network access is verified.
In some cases, we verify network connection is available to an app while
in foreground. If the app's foreground status is due to top activity, it
will lose the foreground status in case the screen goes off. So, turn
the screen-on while verifying for network connectivity.

Fixes: 71694434
Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests

Change-Id: Id1a49cedc2501859f73deead372afb7f6a41baac
2018-03-28 18:57:42 -07: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
675406b789 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
Change-Id: I65479cb35c88aee1f65c8597c3382cd30fa8d4a9
2018-03-27 17:00:41 -07:00
Benedict Wong
f3e34ff699 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
Change-Id: Ib77ac237fee75415223f0291cecc0b60ce76b77f
2018-03-27 16:37:41 -07: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
d4477edaf3 Merge "Add tests where only auth or crypt are enabled" 2018-03-23 17:25:10 +00:00
Fyodor Kupolov
9636bf48f8 Allow cleartext traffic for the test app
Test: HostsideRestrictBackgroundNetworkTests
Bug: 75978847
Change-Id: I8962a0e30120ffb4e98b1fb661df277236715656
2018-03-22 15:19:52 -07:00
Benedict Wong
f8ccb00aa6 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
Change-Id: I656d9c4a86c13ce4928d6bd68a9e0d48cf805191
2018-03-22 20:58:21 +00: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
Benedict Wong
0ce11669ab Merge "Add tests for IPsec SPI expiration timer changes" 2018-03-16 17:45:20 +00:00
Benedict Wong
b84436977a 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.
Change-Id: Ib4776322bd5df772a3700b6e7ed1b5e7ed6b4637
2018-03-15 23:42:39 -07: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