Commit Graph

1863 Commits

Author SHA1 Message Date
Chiachang Wang
5fcc5f375e Merge "Use local defined NetworkSpecifier to verify test" am: c23b2ac096 am: 85f6412866
Change-Id: Ib642615535f81c99e7548e36f9d77048f3bc3c4b
2020-05-11 14:45:53 +00:00
Chiachang Wang
c23b2ac096 Merge "Use local defined NetworkSpecifier to verify test" 2020-05-11 14:19:34 +00:00
Chiachang Wang
a495965c67 Use local defined NetworkSpecifier to verify test
Test will be affected by logic modification from different
NetworkSpecifiers. Since this test tries to test the behavior
of NetworkRequest but not NetworkSpecifier, use local defined
NetworkSpecifier to test to prevent repeating noisy breaks.
Also update test for testing invariant.

Bug: 154451660
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkRequestTest
Change-Id: I7e357c75a68244432231d59646ddf67c8d969c6d
2020-05-11 20:24:47 +08:00
lucaslin
5d57ec4a8f Refine NetworkCallbackTest
In R, to avoid data overages due to apps not detecting a
meteredness change, when a wifi network changes from unmetered
to metered the network will go down and will be replaced with a
new network. It will make NetworkCallbackTest fail because the
original design is getting the active network in setUp(). So once
the wifi reconnects, the network which is got in setUp() will be
meaningless and make the test fail due to network mismatches.
The new changes are:
1. Moving some initial pre-configurations into setUp().
2. Override the onCapabilitiesChanged() to check if network has
   changed to metered or not.
3. Add unregisterNetworkCallback() into iMyService.aidl so that
   NetworkCallbackTest can call it to unregister the network
   callback.
4. Enlarge the timeout of connecting network and receiving
   callback to prevent network cannot reconnect in time or
   callback cannot be received in a short time.

Bug: 153485744
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Change-Id: I1aa0e107cf6797b06dee4a15896c63321d822156
Merged-In: I1aa0e107cf6797b06dee4a15896c63321d822156
2020-05-08 08:01:34 +00:00
Lucas Lin
c06ab57a8d Merge "Refine NetworkCallbackTest" into rvc-dev 2020-05-08 05:33:29 +00:00
lucaslin
63203afe0e Refine NetworkCallbackTest
In R, to avoid data overages due to apps not detecting a
meteredness change, when a wifi network changes from unmetered
to metered the network will go down and will be replaced with a
new network. It will make NetworkCallbackTest fail because the
original design is getting the active network in setUp(). So once
the wifi reconnects, the network which is got in setUp() will be
meaningless and make the test fail due to network mismatches.
The new changes are:
1. Moving some initial pre-configurations into setUp().
2. Override the onCapabilitiesChanged() to check if network has
   changed to metered or not.
3. Add unregisterNetworkCallback() into iMyService.aidl so that
   NetworkCallbackTest can call it to unregister the network
   callback.
4. Enlarge the timeout of connecting network and receiving
   callback to prevent network cannot reconnect in time or
   callback cannot be received in a short time.

Bug: 153485744
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Change-Id: I1aa0e107cf6797b06dee4a15896c63321d822156
2020-05-08 11:02:46 +08:00
Mark Chien
a25d852b12 Tag CtsTetheringTest for sim card required
Bug: 155598732
Test: atest CtsTetheringTest
Merged-In: I79f841682049707d7cc26bf1ecc3e5affc86d196
Change-Id: I79f841682049707d7cc26bf1ecc3e5affc86d196
2020-05-07 10:32:38 +00:00
Kweku Adams
627f2b69ef Merge "Test that idle apps get network when device charges." into rvc-dev 2020-05-07 01:25:28 +00:00
markchien
f941ae9c03 Tag CtsTetheringTest for sim card required
Bug: 155598732
Test: atest CtsTetheringTest
Change-Id: I79f841682049707d7cc26bf1ecc3e5affc86d196
2020-05-06 14:55:29 +08:00
Hai Zhang
9c3108c681 Merge "Declare MANAGE_EXTERNAL_STORAGE for test apps." into rvc-dev 2020-05-04 23:33:47 +00:00
Kweku Adams
efb1857443 Test that idle apps get network when device charges.
This is a partial revert of the change that removed the parole
(Icd7b6eff8777f9b53a10eca521b73988f58f2d84).

Bug: 151802309
Test: atest --rerun-until-failure 10 com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: I65f5ff20cdd342905e1afd1f4897017aa60682d3
2020-05-04 13:34:29 -07: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
Yan Yan
2e10c55003 Merge "Initial CL for testing IkeSession creation" 2020-05-01 05:58:18 +00: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
evitayan
653d7ebb44 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
2020-04-30 18:56:12 -07: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
Dominic Lemire
cae5079d9d Fix error message in RestrictBackgroundNetworkTest
Fixed the error message when the expected number of broadcasts is exceeded.

Bug: 147139427

Change-Id: I7e69dca81abdb29a9eb7d110266edbe483e17a01
2020-04-30 05:47:29 +00: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
Remi NGUYEN VAN
6c63b1eaac Merge "Force reconnect in connectToWifi" 2020-04-28 07:10:15 +00:00
Remi NGUYEN VAN
412c8a9f53 Merge "Add test for internet availability on portals" 2020-04-28 05:49:08 +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
Remi NGUYEN VAN
71cfc79527 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
Change-Id: Ia7d83337ee0ffad9414031711cf7e937b14f968d
2020-04-27 22:47:12 +09:00
Remi NGUYEN VAN
ecb661016f 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
Change-Id: I6a97ed26dba665efdc67abb2371e0fc30ede020c
2020-04-27 22:47:10 +09: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
Yan Yan
c910917fd2 Merge "Test configuring digital-signature-based auth" 2020-04-27 02:34:46 +00:00
Yan Yan
4f532038f1 Merge "Test building IkeSessionParams with EAP" 2020-04-26 21:29:31 +00:00
evitayan
bba019dc40 Test configuring digital-signature-based auth
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: Ieaceaadf116cb2885cbf22ae48579cec88268416
2020-04-24 19:01:24 -07:00
evitayan
e800e95037 Test building IkeSessionParams with EAP
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: Iea7f4d14502f4b204c7a0d7357e1aaec99954e1f
2020-04-24 19:01:11 -07:00
Yan Yan
609d48cc11 Merge "Add test for IkeIdentification" 2020-04-25 01:56:17 +00:00
Yan Yan
f839aaad8c Merge "Add initial CTS test for IkeSessionParams" 2020-04-25 01:53:15 +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
evitayan
9dcef40023 Add test for IkeIdentification
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: Ieda584446c37d121fc16a212e2c6c60b934b0f53
2020-04-24 18:16:18 +00:00
evitayan
b9438336c7 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
2020-04-24 10:30:30 -07:00
Treehugger Robot
6aa8f074d0 Merge "Add testTetheringUpstream cts test" 2020-04-24 15:36:21 +00:00
Treehugger Robot
c31694df4c Merge "Test legacy tether/untether API and onError callback" 2020-04-24 15:29:44 +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
0420e692a7 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
2020-04-24 22:29:43 +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
markchien
1a54afc5b1 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
2020-04-24 21:16:06 +08:00