Commit Graph

4439 Commits

Author SHA1 Message Date
android-build-team Robot
2cdfa3ea3b Snap for 6461449 from 9c3108c681 to rvc-release
Change-Id: I3168f4a26a9726dec9508222dd91e3414f084058
2020-05-05 01:10:08 +00:00
Hai Zhang
9c3108c681 Merge "Declare MANAGE_EXTERNAL_STORAGE for test apps." into rvc-dev 2020-05-04 23:33:47 +00:00
android-build-team Robot
8e80260a48 Snap for 6453963 from 28ff52e32efbff9fad525c95291007e13ad5fe76 to rvc-release
Change-Id: I26cbfacc4a5dc3f30f31d88914c2eb7c81e7075c
2020-05-02 01:06:18 +00:00
evitayan
120a7db874 Initial CL for testing IkeSession creation
This commit:
-Extend TunUtils for processing IKE packets
-Add IkeSessionBaseTest containing common functionality for all IkeSession tests
-Add end-to-end test for IKEv2 PSK verifying creating IKE SA, creating child SAs
 and closing sessions
-Add basic tests for error scenarios

Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: Ie6c18591ffcc883abbf0484d9a59dfda61b33257
Merged-In: Ie6c18591ffcc883abbf0484d9a59dfda61b33257
2020-05-01 11:52:28 -07:00
Sudheer Shanka
e5f59b07cf Merge "Fix error message in RestrictBackgroundNetworkTest" into rvc-dev 2020-05-01 05:25:57 +00:00
Dominic Lemire
e4a9287bfe Fix error message in RestrictBackgroundNetworkTest
Fixed the error message when the expected number of broadcasts is exceeded.

Bug: 147139427
Test: atest hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I7e69dca81abdb29a9eb7d110266edbe483e17a01
Merged-In: I7e69dca81abdb29a9eb7d110266edbe483e17a01
2020-04-30 19:38:34 -07:00
android-build-team Robot
0e85674ae7 Snap for 6449986 from b620aa3fcd1ffeaabf6054ce0bf5e35b2b6d01e9 to rvc-release
Change-Id: Ia2b79c3a0cabf2eb136b40a095d1f77fdd062ffe
2020-05-01 01:03:38 +00:00
Remi NGUYEN VAN
6163ee36c5 Merge "Add test for internet availability on portals" into rvc-dev 2020-05-01 00:32:35 +00:00
Remi NGUYEN VAN
320104e7cc Merge "Force reconnect in connectToWifi" into rvc-dev 2020-04-30 07:42:08 +00:00
Remi NGUYEN VAN
33a88fbf5f Force reconnect in connectToWifi
There is no guarantee that Wifi will automatically reconnect after
enabling, especially in cases where no internet access was detected on
the access point the last time it was connected.

Use WifiManager#reconnect to force wifi to reconnect to the access
point. The API is deprecated for general use, but system apps are
documented as exempted from the deprecation.

Bug: 152280218
Test: atest --rerun-until-failure 200 CtsNetTestCases:CaptivePortalTest
Merged-In: Ia7d83337ee0ffad9414031711cf7e937b14f968d
Change-Id: Ia7d83337ee0ffad9414031711cf7e937b14f968d
2020-04-30 06:22:04 +00:00
Chenbo Feng
70285ea6d9 Add a test to check getUidStats binder call
Check the apps cannot get the per uid stats of another uid by directly
calling the getUidStats binder interface call provided by
networkStatsService.

Bug: 129151407
Test: NetworkStatsBinderTest

Change-Id: Iabca53a8b37b259cf7e232d603676dbc9887084c
2020-04-30 13:53:47 +08:00
Remi NGUYEN VAN
388f7240c7 Add test for internet availability on portals
Add a test verifying that when the device has detected a captive portal,
or when the user is trying to login to a captive portal, the captive
portal network does not become the default network if another network
can provide internet access.
This follows R CDD requirements.

Test: atest CtsNetTestCases:android.net.cts.CaptivePortalTest
Bug: 152280218
Merged-In: I6a97ed26dba665efdc67abb2371e0fc30ede020c
Change-Id: I6a97ed26dba665efdc67abb2371e0fc30ede020c
2020-04-28 07:53:16 +00:00
android-build-team Robot
860d9d184b Snap for 6436225 from 99662c49a7 to rvc-release
Change-Id: Iadf40d09372a9e039fdd2394f630a0c7338d5072
2020-04-28 01:08:49 +00:00
Yan Yan
99662c49a7 Merge "Add test for IkeIdentification" into rvc-dev 2020-04-27 21:51:04 +00:00
Yan Yan
b921f9ead6 Add test for IkeIdentification
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: Ieda584446c37d121fc16a212e2c6c60b934b0f53
Merged-In: Ieda584446c37d121fc16a212e2c6c60b934b0f53
(cherry picked from commit 923f59a282)
2020-04-27 17:02:35 +00:00
Yan Yan
fe6c2565da Test configuring digital-signature-based auth
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: Ieaceaadf116cb2885cbf22ae48579cec88268416
Merged-In: Ieaceaadf116cb2885cbf22ae48579cec88268416
(cherry picked from commit ca5515626c)
2020-04-27 04:23:21 +00:00
Yan Yan
913ce19d40 Test building IkeSessionParams with EAP
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: Iea7f4d14502f4b204c7a0d7357e1aaec99954e1f
Merged-In: Iea7f4d14502f4b204c7a0d7357e1aaec99954e1f
(cherry picked from commit 5ad4adaff6)
2020-04-27 04:21:47 +00:00
Yan Yan
5d8b8a1f71 Add initial CTS test for IkeSessionParams
This commit adds tests for building IkeSessionParams with PSK. It
also tests configuring SA lifetimes, retransmissions and PCSCF
server requests

Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: I16fdc1ff9a22acb82b376211e0f187c4ead4cae5
Merged-In: I16fdc1ff9a22acb82b376211e0f187c4ead4cae5
(cherry picked from commit c98c75308f)
2020-04-27 04:21:22 +00:00
Yan Yan
2b2db7a57f Make a copy of TunUtils and PacketUtils
Temporarily make copies. Eventually will statically include the
source files in CtsIkeTestCases

Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: I7dd5c8b849f0d987fa6d76bc5a0bc1a7eed49b0d
Merged-In: I7dd5c8b849f0d987fa6d76bc5a0bc1a7eed49b0d
(cherry picked from commit 52716ec0e6)
2020-04-27 04:20:30 +00:00
Yan Yan
35b779fd5a Merge changes I98979758,I1c49711d into rvc-dev
* changes:
  Create base class that sets up test network
  Create TestNetworkUtils for IKE and IPsec CTS
2020-04-27 02:53:29 +00:00
Yan Yan
323ec3a4f5 Merge "Add CTS for EapSessionConfig" into rvc-dev 2020-04-27 02:53:12 +00:00
android-build-team Robot
107302f1af Snap for 6431357 from 82661c7936457b3a8ef92349025dad9d8326fd0f to rvc-release
Change-Id: I7a5c2e7400958223b604cd79537e64937fea986d
2020-04-25 23:13:05 +00:00
android-build-team Robot
69383003b1 Snap for 6429305 from 8f7ecee94ddd65f74539e1484a2ab5a81592446f to rvc-release
Change-Id: Id449f9f36c60775fe1651d796907be7d85bb7c69
2020-04-25 01:13:37 +00:00
Yan Yan
7db1b713ba Add CTS for EapSessionConfig
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: I54dedff0555bdfcaae390ddde7b05d24dfabe9b0
Merged-In: I54dedff0555bdfcaae390ddde7b05d24dfabe9b0
(cherry picked from commit b6dff21134)
2020-04-24 22:30:04 +00:00
Yan Yan
de7f511bd1 Create base class that sets up test network
This class will be extended by both IkeSessionParamsTest and
IkeSessionTestBase

Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: I98979758a7a684219e35c02ded93224ea172d44f
Merged-In: I98979758a7a684219e35c02ded93224ea172d44f
(cherry picked from commit 50908b9266)
2020-04-24 22:20:57 +00:00
markchien
668dfa5998 Add testTetheringUpstream cts test
If cellular is the mobile network, tethering should select it as
upstream. If DUN is required, tethering should use DUN as its upstream.

Bug: 153614366
Bug: 150644305
Test: atest CtsTetheringTest

Change-Id: Ief9c745322e8705c0e50185e749a81c5a9d20743
Merged-In: Ief9c745322e8705c0e50185e749a81c5a9d20743
2020-04-24 22:31:01 +08:00
markchien
a6b3b70278 Test legacy tether/untether API and onError callback
Test legacy tether/untether API behavior. tether() rely on downstream
setup ready for tethering. Currently the only user is bluetooth
tethering. For other tetherings, there is no guaranteed that calling
tether() can always switch given interface to tethered. Tethering
may callback with onError depend on the interface status. Caller
should use startTethering/stopTethering API instead of these
legacy APIs.

This change also change the precondition verification of startTethering.
If tethering interface got error last time, such interface would not
be reported as tetherable.

Bug: 150632712
Test: atest CtsTetheringTest
Change-Id: Ifb3a0618208ffd0ff224c60f377036bc22ba0565
Merged-In: Ifb3a0618208ffd0ff224c60f377036bc22ba0565
2020-04-24 22:23:23 +08:00
TreeHugger Robot
25cd61eb7e Merge "Move DhcpInfoTest to FrameworksNetCommonTests" into rvc-dev 2020-04-24 06:15:12 +00:00
android-build-team Robot
15984d9e86 Snap for 6424828 from 6e56c29e8d8d4dc8780640d65d53c1ebf2ad441c to rvc-release
Change-Id: Ifa15d610637210d36e7b8c3a9f0d807ffc2fb201
2020-04-24 01:14:27 +00:00
Mark Chien
f46d6a1e8d Test enable tethering permission and stopAllTethering
1. Test whether start tethering is gated by suitable permission.
2. Test stopAllTethering

Bug: 153613718
Test: atest CtsTetheringTest

Merged-In: I38702886ea355e1aec8eb8ac404fdd46a44582e3
Change-Id: I38702886ea355e1aec8eb8ac404fdd46a44582e3
2020-04-23 14:48:03 +00:00
Paul Hu
11fec376f5 Add TetheringCommonTests to CtsTetheringTest
Bug: 153614365
Bug: 153613717
Test: atest CtsTetheringTest
Change-Id: I26c06d522ef2935deb2b1abbd3c5b6be97a48a27
Merged-In: I26c06d522ef2935deb2b1abbd3c5b6be97a48a27
(cherry picked from commit 9903c8a61b, aosp/1292434)
2020-04-23 05:44:02 +00:00
Chiachang Wang
0d39e96477 Merge "Update logic for checking NetworkSpecifier" into rvc-dev 2020-04-23 02:27:03 +00:00
Remi NGUYEN VAN
203e783ccd Merge "Fix test initialization errors on Q" into rvc-dev 2020-04-23 02:10:04 +00:00
android-build-team Robot
6beea0843a Snap for 6420265 from 4c4aa9723c79debdcaeae0e192a34b54f2ac39db to rvc-release
Change-Id: I6c3794bc03e6eb725cb36e30a4799c456b424097
2020-04-23 01:12:20 +00:00
Treehugger Robot
36e4781181 Update logic for checking NetworkSpecifier
We cannot test using WifiNetworkSpecifier, because the matching
behaviour for null WifiNetworkSpecifier changed between Q and R.
Replace WifiNetworkSpecifier with MatchAllNetworkSpecifier and
TelephonyNetworkSpecifier that behave the same in both Q and R
to verify.

Bug: 154451660
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkRequestTest
      on aosp and internal build
Change-Id: I14e2a5e629051e243f3b892b608cb1c6195cd8ed
Merged-In: I14e2a5e629051e243f3b892b608cb1c6195cd8ed
(cherry picked from commit 902d572ca8)
2020-04-23 00:40:37 +00:00
Hai Zhang
59b9da9907 Declare MANAGE_EXTERNAL_STORAGE for test apps.
That has requested legacy external storage and targets R or
beyond. TestDevice automatically grants the app op during test app
installation but the permission declaration should still be there.

Also added some other missing app op permission declarations according
to test failure.

Fixes: 149765004
Test: Ensure the same set of tests pass with the following command:
Test: atest ExternalStorageHostTest StorageHostTest
Test: Ensure apps printed in the following command targets below R:
Test: find . -type f -exec grep -q 'android:requestLegacyExternalStorage' {} \; -not -exec grep -q 'MANAGE_EXTERNAL_STORAGE' {} \; -print
Test: presubmit
Exempt-From-Owner-Approval: This CL just adds a <uses-permission> line
                            across a number of test apps. Storage team
                            and most owners have approved this change.
Change-Id: I839a23b28b29118baae7a8c309f7bd4de698419b
2020-04-22 21:20:40 +00:00
Chiachang Wang
1136e51d55 Check target transport type for meterness change
When test case updates the wifi network from unmetered to
metered, test case will wait for wifi network reconnect.
However, if other metered networks are also connected at
the same time, test case may mis-take the network as the
target network. Thus, add transport type check to ensure
the transport type of the network is the expected one.

Bug: 153400606
Test: atest CtsNetTestCasesLatestSdk:\
      android.net.cts.ConnectivityManagerTest#\
      testGetMultipathPreference
Change-Id: I75dab1a00bbe1a1c75b548a6ce4ae3eacd325d92
Merged-In: I75dab1a00bbe1a1c75b548a6ce4ae3eacd325d92
(cherry picked from commit 495971d7b6abc65e6d506072038f499682f59f4d)
2020-04-22 07:52:57 +00:00
android-build-team Robot
ca63aaf99a Snap for 6416172 from 6c6036dc2514e211561688a3640a1dc470b269fd to rvc-release
Change-Id: I3b7ef99ac89f9e3e63d210b01b43d0e8bc27e445
2020-04-22 01:13:53 +00:00
Remi NGUYEN VAN
e96bd02054 Fix test initialization errors on Q
ConnectivityDiagnosticsManagerTest, MultinetworkApiTest,
NetworkAgentTest crashed before the runner could start them:
 - Ignore ConnectivityDiagnosticsManagerTest on Q: it tests an API that
   was introduced in R.
 - Build JNI libraries used by MultinetworkApiTest against the NDK to
   avoid errors loading the libraries on older platforms, when
   transitive dependencies have been added.
 - Do not attempt to override Handler#getLooper() (which is final) in
   NetworkAgentTest; it appears to have been overridden by accident by
   specifying "val looper" in the TestableNetworkAgent definition, which
   generates a getter.

Test: atest CtsNetTestCasesLatestSdk:ConnectivityDiagnosticsManagerTest
      atest CtsNetTestCasesLatestSdk:MultinetworkApiTest
      atest CtsNetTestCasesLatestSdk:NetworkAgentTest
Bug: 150918852
Merged-In: I262b54c6897ed755adaeb2b118c638320634f7a1
Change-Id: I262b54c6897ed755adaeb2b118c638320634f7a1
2020-04-21 13:40:28 +00:00
Junyu Lai
6f8e612264 Remove upper bound check of getTotal* APIs in TrafficStatsTest
Currently, this cause flakiness since some background traffic
was counted when performing tests, or the traffic generated by
adb over network. While there is no good way to filter out all
reasonable cases, disable the upper bound checks.

Test: atest TrafficStatsTest
Bug: 142978584

Change-Id: I22edc46039bf35e544d9ce8a9f3a00b713478e05
Merged-In: I22edc46039bf35e544d9ce8a9f3a00b713478e05
Merged-In: I8140310c9caeff6069d1f55590bf40f83bf211e4
(cherry picked from commit 8accc6aa11213a7a8287a2ec0f75f17a02173f99)
2020-04-21 04:32:05 +00:00
Chiachang Wang
3ee47d4233 Update network object when wifi meterness is changed
The new wifi disconnect behavior is introduced. When wifi
network is changed from unmetered to metered, the wifi
network will disconnect and reconnect. Update the test to
verify the same SSID wifi is connected and also update the
target network to verfiy the metered preference.

Bug: 153400606
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest\
      #testGetMultipathPreference
Change-Id: Ic298d3d85d8c6b77c8df7614a945f2c22dcdff38
Merged-In: Ic298d3d85d8c6b77c8df7614a945f2c22dcdff38
(cherry picked from commit 37d5d4387cce865d159e80e5101685b4c2a13731)
2020-04-21 01:35:49 +00:00
Remi NGUYEN VAN
958e8d1ceb Skip new UrlQuerySanitizer tests on Q
The tests verify behavior that was only fixed on R, but
UrlQuerySanitizerTest is part of MTS which needs to pass on Q.

Test: atest CtsNetTestCasesLatestSdk:UrlQuerySanitizerTest
Bug: 150904735
Change-Id: I214b2fd8a45732a41e8604db70c83a8e3f4a45e4
2020-04-20 18:51:17 +09:00
android-build-team Robot
b019acb6a0 Snap for 6408188 from bdf90ec24f0c94fe157ea78b1851320edd8074eb to rvc-release
Change-Id: I843fb3226c47c0d96addcfcc3837266b76d00e8e
2020-04-18 23:10:56 +00:00
android-build-team Robot
16f11031d7 Snap for 6406367 from e95b4e14eaf7454da527925d842d0914f70a3212 to rvc-release
Change-Id: I42229501cfc4d2c649861dd2b233b0b5c4e25f5d
2020-04-18 01:15:44 +00:00
Aaron Huang
170e873442 Move DhcpInfoTest to FrameworksNetCommonTests
Move to frameworks/base/tests/net/common so that it can
be run in cts test and presubmit test.

Bug: 154299158
Test: atest CtsNetTestCasesLatestSdk:android.net.DhcpInfoTest
Change-Id: I1052c2b46ce427102429c3c7d8cf25f3e79f2789
Merged-In: I8d70565fe3388fd8351002f2ed87c43343879e57
2020-04-17 17:39:18 +00:00
Aaron Huang
d1e528ae9c Add test for NetworkRequest#getRequestorUid()
Add test for new API.

Bug: 151110379
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkRequestTest
Change-Id: I9602cac142b3e45d12e66a6f3f35ab594e6590c1
Merged-In: I9602cac142b3e45d12e66a6f3f35ab594e6590c1
2020-04-17 14:32:26 +00:00
Aaron Huang
dacbdaa378 Add tests for NetworkRequest API
This change inculdes coverage of NetworkRequest#Builder().clearCapabilities()
and NetworkRequest#getRequestorPackageName()

Bug: 153614623
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkRequestTest
Change-Id: Id4e31013cfae78c25abd27b557da4e3e9487870c
Merged-In: Id4e31013cfae78c25abd27b557da4e3e9487870c
2020-04-17 14:31:31 +00:00
TreeHugger Robot
301d2c4f10 Merge "Add EntitlementResult CTS tests" into rvc-dev 2020-04-17 08:02:21 +00:00
Treehugger Robot
685f072bfd Add more tests to CtsTetheringTest
Add TetheringIntegrationTests into CtsTetheringTest

Bug: 148636687
Test: atest CtsTetheringTest
      atest TetheringIntegrationTests
Change-Id: I606097a8db9ed3d2b3eaf933bb1d904e437ab27d
Merged-In: I606097a8db9ed3d2b3eaf933bb1d904e437ab27d
(cherry picked from commit 1f7305c9740a7a1a724c4023f8c55ce827391f73, aosp/1280233)
2020-04-17 07:22:24 +00:00
Treehugger Robot
8d10ebe3d7 Add EntitlementResult CTS tests
Test APIs below:
requestLatestTetheringEntitlementResult(int, boolean,
  java.util.concurrent.Executor,
  android.net.TetheringManager.OnTetheringEntitlementResultListener)
requestLatestTetheringEntitlementResult(int,
  android.os.ResultReceiver, boolean)
OnTetheringEntitlementResultListener.onTetheringEntitlementResult(int)

Bug: 152829363
Test: atests CtsTetheringTest
Change-Id: Icf0d9cacd97eeaa7ceb78f4924c5a6be6e588b30
Merged-In: Icf0d9cacd97eeaa7ceb78f4924c5a6be6e588b30
(cherry picked from commit 4bed8dff67d4a6824098188cd9602668d8705a7e, aosp/1272946)
2020-04-17 07:20:06 +00:00