Commit Graph

2267 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Anton Hansson
4cfa3beb5c resolve merge conflicts of 1381b1d9a77260d78a3a67359e16c06ee388d37b to oc-mr1-dev-plus-aosp
am: 0c02379ec1  -s ours

Change-Id: I8bc040bea87ffb581568eae69cafb2c65fca9412
2018-02-26 17:08:31 +00:00
Anton Hansson
0c02379ec1 resolve merge conflicts of 1381b1d9a77260d78a3a67359e16c06ee388d37b to oc-mr1-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Merged-In: I5afdfc8e1e523768db9065dd3571cb31bc1dfac5
Change-Id: I5c5b85f516dba0d403eeee06055953931d2198aa
2018-02-26 15:36:28 +00:00
Anton Hansson
fed17889c7 Merge "cts: Set LOCAL_SDK_VERSION where possible." 2018-02-26 13:57:25 +00:00
Anton Hansson
505cbf0342 cts: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: I687153389dd4bfab1c83df5d9af83d89bed76fd4
Merged-In: I5afdfc8e1e523768db9065dd3571cb31bc1dfac5
2018-02-26 12:09:09 +00:00
Anton Hansson
9a9ceeff6a cts: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: I5afdfc8e1e523768db9065dd3571cb31bc1dfac5
2018-02-23 11:11:11 +00:00
Sudheer Shanka
2bf68eba3a Update the battery charging status when turning battery on/off.
Bug: 72656089
Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests

Change-Id: Ida6d3ff4a78c91e656b49a26006603973753c808
2018-02-13 15:59:28 -08:00
Sudheer Shanka
dc134af7aa Update netpolicy tests to not assume DUT will be plugged-in.
Bug: 73037837
Bug: 72656089
Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests

Change-Id: I79aaaf083255626896901fcfdade70b4705cfc06
2018-02-10 15:43:59 -08:00
jdesprez
48f31fac64 Replace TestIdentifier by TestDescription
Large scale update of our test interface.

Test: build all targets
Bug: 70543295
Change-Id: I1600b8b950fe34bf4656e7769b8f7d3f365e3c0b
2018-02-07 16:37:13 -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
Adam Vartanian
3c22d6bea8 Merge changes from topic "am-325cd506-a538-4cb7-a65c-bc30576c59e9" into oc-dev
am: fb27c032ff

Change-Id: I459897b291fff063091f4d5e64330df4ade47c0c
2018-02-01 23:31:51 +00:00
Etan Cohen
4fa2e9968e Merge "[AWARE] Remove "Respond to ANY" API - dummy tests deprecated" 2018-01-31 16:05:05 +00:00
Ricky Wai
12a04fc52d Merge "Add CTS for verifying ConnectivityManager.getNetworkWatchlistConfigHash()" 2018-01-31 15:54:48 +00:00
Android Build Merger (Role)
ea75ff0609 [automerger] Add CTS test for URI fix. am: 85156429a2 am: 27914625b1 am: 662ce9724a am: 67ae9d3245 am: ad9fa4877c am: 2f52ceef6f am: 3bc75c3136 am: 1e65404eb8 am: 330b09b8a8 am: 119bbb1cdb
Change-Id: Ib52e5a020d679328e9d91534e636f6f89abb8781
2018-01-31 11:17:54 +00:00
Android Build Merger (Role)
330b09b8a8 [automerger] Add CTS test for URI fix. am: 85156429a2 am: 27914625b1 am: 662ce9724a am: 67ae9d3245 am: ad9fa4877c am: 2f52ceef6f am: 3bc75c3136 am: 1e65404eb8
Change-Id: I0232e8093dd78ed98e9d89ec0c062593b38a12a1
2018-01-31 11:17:45 +00:00
Android Build Merger (Role)
1e65404eb8 [automerger] Add CTS test for URI fix. am: 85156429a2 am: 27914625b1 am: 662ce9724a am: 67ae9d3245 am: ad9fa4877c am: 2f52ceef6f am: 3bc75c3136
Change-Id: I3e58d87b69ba1f32474550364e04324e6fc8fd88
2018-01-31 11:17:39 +00:00
Android Build Merger (Role)
3bc75c3136 [automerger] Add CTS test for URI fix. am: 85156429a2 am: 27914625b1 am: 662ce9724a am: 67ae9d3245 am: ad9fa4877c am: 2f52ceef6f
Change-Id: I164c155385cef9ca2ed8bb810d1c1e7be65e4458
2018-01-31 11:17:34 +00:00