Commit Graph

36708 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
8b2a47c867 Move test_mainline_modules to AndroidTest.xml
When an AndroidTest.xml is used, configuration needs to be in the
AndroidTest.xml file, not in the Android.bp.

This currently causes tests not to be run in TEST_MAPPING as they should
be.

Test: TH needs to test
Bug: 187935317
Change-Id: Ie0aca0c64646825175769cd375bcecf65de4b4c8
2021-06-28 10:55:15 +09:00
Remi NGUYEN VAN
ef34fd2e21 Merge "Skip connectivity unit tests before S" 2021-06-25 05:43:30 +00:00
Remi NGUYEN VAN
86b39c8c34 Merge "Update TetheringTests for new connectivity shims" 2021-06-25 05:42:14 +00:00
Remi NGUYEN VAN
05dd1ba540 Skip connectivity unit tests before S
The tests are packaged together with other tests in a common coverage
suite, so need to be individually annotated so that they are skipped
before S.

They do not need to pass on platforms older than S, because such
platforms will not updated with the code that is tested.

Bug: 187935317
Test: atest ConnectivityCoverageTests on R
Change-Id: I10da45ae023e7f1e8cd11ec857b84346892a3fa8
2021-06-25 10:10:12 +09:00
Junyu Lai
a6cb322d00 Merge changes from topic "sp31"
* changes:
  [SP35] Pass data warning to tethering offload
  [SP34] Adapt onSetWarningAndLimit
  [SP33] Adapt ITetheringOffloadCallback V1.1
  Address comments on ag/14486203
2021-06-24 10:21:07 +00:00
junyulai
991433d8c8 [SP35] Pass data warning to tethering offload
This is supported by:
  1. Utilize the new API from both NetworkStatsProvider
     and IOffloadControl to send data warning quota to hardware.
     And pass the warning reached notification back to NPMS.
  2. Disable software solution introduced in R release for
     V1.1+ hardware, since now we can fully offload data warning
     and limit notification to hardware.

Test: atest TetheringTests
Fix: 149467454
Merged-In: Ie49461694d77ab7f25a549433b01b5b0167bd489
Change-Id: Ie49461694d77ab7f25a549433b01b5b0167bd489
  (cherry-picked from ag/13981692)
2021-06-24 08:33:28 +00:00
junyulai
da52dab266 [SP34] Adapt onSetWarningAndLimit
This is a no-op change that just adapt new API from
NetworkStatsProvider to get warning and limit bytes at the same
time. This change also stores them locally for subsequent
patches to set warning bytes to hardware.

Test: Will be included in the subsequent patch.
Bug: 149467454
Merged-In: Iec01cb01fd1ce481ce0bd736762baddde1e38084
Change-Id: Iec01cb01fd1ce481ce0bd736762baddde1e38084
  (cherry-picked from ag/13981691)
2021-06-24 08:33:28 +00:00
junyulai
37a7e620b4 [SP33] Adapt ITetheringOffloadCallback V1.1
This is a no-op change that redirect both V1.0 and V1.1 callback
events to the same handling function. Since the V1.1 callback
is extended from V1.0 callback, we can safely use V1.1
callback for both V1.0 and V1.1 control.

The change also provides interface for subsequent
OffloadController changes to set warning and limit at the
same time.

Test: atest TetheringTests
Bug: 149467454
Merged-In: I6505a04de8c57357dd1fa9ce898c13395e497816
Change-Id: I6505a04de8c57357dd1fa9ce898c13395e497816
  (cherry-picked from ag/13973147)
2021-06-24 08:33:28 +00:00
Chalard Jean
20c7cad598 Address comments on ag/14486203
Bug: 186458024
Test: comment-only change
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: I7b086abbb57354086e8fb1a41c63140f2227173f
Change-Id: I7b086abbb57354086e8fb1a41c63140f2227173f
  (cherry-picked from ag/14540395)
2021-06-24 08:33:27 +00:00
Remi NGUYEN VAN
11e5cf0b0b Update TetheringTests for new connectivity shims
The stable connectivity shims are updated to now contain S API, so
tethering tests that assumed that compatibility R behavior was used need
to be updated.

To avoid such failures Tethering tests should have a test target using
updated shims (TetheringNextTests), but this was not done in S
timeframe.

Bug: 189581241
Test: atest TetheringTests
Merged-In: Ibc04e64a1e9d82b67aff10d1a6d77f9e6b1bbdfb
Change-Id: Ibc04e64a1e9d82b67aff10d1a6d77f9e6b1bbdfb
2021-06-24 17:17:54 +09:00
Junyu Lai
d4c644cf4d Merge changes Ib8637100,I33612650
* changes:
  Make yield-to-bad-wifi behavior backward compatible with R
  Add more unit tests for ConnectivityManager S APIs
2021-06-24 08:13:46 +00:00
Remi NGUYEN VAN
09d3a75357 Merge "Add ConnectivityCoverageTests to postsubmit" 2021-06-24 06:32:36 +00:00
Chalard Jean
6b2f09272c Make yield-to-bad-wifi behavior backward compatible with R
Yielding cell wins to exiting wifi (whether good or bad).
It loses to bad wifi that's not exiting.

In R, yielding to bad wifi only affects wifis that are
unvalidated, but a wifi that is exiting should still be
dropped in favor of a cell that yields to bad wifi.

I had misunderstood the policy and implemented it wrong.
Now it's implemented right, and has careful tests.

Test: new tests for this
Bug: 186458024
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: Ib8637100d491e72a2edb837584ce55b7dda58524
Change-Id: Ib8637100d491e72a2edb837584ce55b7dda58524
  (cherry-picked from ag/14486203)
2021-06-24 03:33:05 +00:00
Junyu Lai
92c29c56d7 Add more unit tests for ConnectivityManager S APIs
Test: atest android.net.ConnectivityManagerTest
Bug: 188657173
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: I33612650eb89486a14fcfc440ba0c357f4bb513c
Change-Id: I33612650eb89486a14fcfc440ba0c357f4bb513c
  (cherry-picked from ag/14640282)
2021-06-24 03:20:39 +00:00
Lorenzo Colitti
7325c86c26 Merge "Add CTS for BatteryStatsManager new API" 2021-06-24 02:26:53 +00:00
Treehugger Robot
8691f3c286 Merge "Remove TEST_MAPPING duplicate imports" 2021-06-24 01:18:42 +00:00
Aaron Huang
f52a30b605 Add CTS for BatteryStatsManager new API
Bug: 189308158
Test: This test and
      run testReportNetworkInterfaceForTransports
      with --rerun-until-failure 500
Change-Id: I654b8920d6ea1dada782a618776b13870f7f98df
2021-06-24 07:19:33 +08:00
Paul Hu
33b4929cfe Merge "Add test for CSM#[get|set]UidsAllowedOnRestrictedNetworks" 2021-06-23 16:30:57 +00:00
Chiachang Wang
13549792e2 Merge "Add test for CM#setAvoidUnvalidated" 2021-06-23 09:19:51 +00:00
Remi NGUYEN VAN
8b23feb10e Add ConnectivityCoverageTests to postsubmit
Add the tests to both postsubmit and mainline-postsubmit.

This should allow moving the tests to presubmit in the near future,
after they have been verified to pass in postsubmit.

Bug: 187935317
Test: treehugger needs to test
Change-Id: I9a05d6a300c5f777497e867d0456bc59b06eee80
2021-06-23 18:02:22 +09:00
paulhu
d266285172 Add test for CSM#[get|set]UidsAllowedOnRestrictedNetworks
Bug: 185149952
Test: atest ConnectivityManagerTest
Change-Id: Ie9391d9332ded58cf1e63c8c5c6f5ba85c950bc6
2021-06-23 08:01:00 +00:00
Chiachang Wang
481040b43a Add test for CM#setAvoidUnvalidated
Bug: 186061922
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I77dc5556458c2e824f7abd5a7b79e8aeed8dabf3
2021-06-23 13:54:04 +08:00
Remi NGUYEN VAN
8ce48fe117 Merge "Added tests for QosCallback" 2021-06-23 05:34:46 +00:00
Remi NGUYEN VAN
eb0a4b41f8 Merge "Add basic tests for InvalidPacketException" 2021-06-23 05:32:52 +00:00
Luke Huang
0c20c4901f Merge "Fix the comments from aosp/1719018" 2021-06-23 03:36:02 +00:00
Remi NGUYEN VAN
bf44f6200e Add basic tests for InvalidPacketException
The test simply verify the constructor. They only apply on S+ as
InvalidPacketException is not updatable before S.

Bug: 187935317
Test: atest InvalidPacketExceptionTest
Change-Id: I33f1ee1702672204a46063e6e75c3880d5e7600b
2021-06-23 11:33:10 +09:00
Remi NGUYEN VAN
ef21082033 Merge "Move ConnectivityDiagnosticsManagerTest to common" 2021-06-23 02:31:03 +00:00
Frank Li
a8a7cfd668 Merge "Ignore some ConnectivityManagerTest CTS tests that can't be run in the instant app mode" 2021-06-23 01:58:59 +00:00
Paul Hu
6160d60b2e Merge "Add ConnectivitySettingsManagerTest" 2021-06-23 01:36:16 +00:00
Remi NGUYEN VAN
6214f82c04 Added tests for QosCallback
Tests for the newly added QosCallback functionality

Bug: 155176305
Test: Added to cts/NetworkAgentTest
Change-Id: I29769fc8be074a5105bfe4ac34e30980c5f8744a
2021-06-23 09:51:14 +09:00
Chiachang Wang
38e8c2c94b Merge "Provide a way to override the avoid bad wifi configuration" 2021-06-23 00:48:17 +00:00
Remi NGUYEN VAN
307cb41ade Merge "Add tests for duplicate PendingIntent requests" 2021-06-22 23:35:42 +00:00
Junyu Lai
69bc4fede1 Merge "[SP32] Try to get 1.1 OffloadControl hardware if available" 2021-06-22 20:31:18 +00:00
Yan Yan
010ec2cddd Merge "Test updating underlying network of IpSecTunnelInterface" 2021-06-22 17:27:11 +00:00
lifr
279a8ee8f7 Ignore some ConnectivityManagerTest CTS tests that can't be run in the instant app mode
1. testIsPrivateDnsBroken: It requires the
   permission:android.permission.WRITE_SECURE_SETTINGS. But the
   WRITE_SECURE_SETTINGS permission can't be granted to instant
   apps.
2. testSetOemNetworkPreferenceForTestOnlyPref: Instant apps can't
   create test networks.
3. testSetOemNetworkPreferenceForTestPref: Instant apps can't
   create test networks.

Bug: 191678254
Bug: 191680108
Test: atest android.net.cts.ConnectivityManagerTest --instant
      atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest --instant
Change-Id: Ice43bcf7a1dc34f4a54fefba7f408767f0a4341e
2021-06-23 00:49:25 +08:00
Remi NGUYEN VAN
489275e84e Add tests for duplicate PendingIntent requests
Add tests for requestNetwork and registerNetworkCallback with
PendingIntents that are equal as per PendingIntent.intentFilterEquals.

In such situations, the first request is documented to be automatically
unregistered. This means that the PendingIntent should only be fired
once, instead of being fired for both requests.

Currently this behavior is broken for network callbacks (not for network
requests).

Test: atest ConnectivityManagerTest
Bug: 174237997
Change-Id: Ic636c731c71474ef09043d7a26ccfd6e2bb5c39f
2021-06-22 18:24:52 +09:00
Chiachang Wang
6eac9fb787 Provide a way to override the avoid bad wifi configuration
ConnectivityManager.setAvoidUnvalidated only works if the
config_networkAvoidBadWifi configuration is set to 0 and the
NETWORK_AVOID_BAD_WIFI setting is unset. There is no easy way
for a testing app to temporary set a test value to verify the
behavior of the API. Thus, add a mechanism to allow test app
to set a period of time to temporary unstrict the resource
configuration, i.e. Temporary simulate config_networkAvoidBadWifi
configured to 0.

Bug: 186061922
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: If772078c61a9b12926f104d5dfc9c9071e844732
2021-06-22 14:54:02 +08:00
paulhu
236a992cd0 Add ConnectivitySettingsManagerTest
- Add tests for ConnectivitySettingsManager.
- Also address leftover javadoc comments.

Bug: 182538166
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases
Change-Id: I8161c1bca84b41964578d59ee5d6ab07b2380707
2021-06-22 03:00:51 +00:00
Paul Hu
5440e0b8e8 Merge "Add test for CSM#[get|set]MobileDataPreferredUids" 2021-06-22 01:33:49 +00:00
Lucas Lin
3f565a44b0 Merge "Add CTS for isUidNetworkingBlocked & isUidRestrictedOnMeteredNetworks" 2021-06-21 23:58:49 +00:00
Lucas Lin
56055496f3 Merge "Use assertEquals instead of assertTrue to compare the vpn type" 2021-06-21 23:35:16 +00:00
Lucas Lin
7e2a491835 Merge "Add CTS for systemReady() & getIpSecNetIdRange()" 2021-06-21 20:52:46 +00:00
Lucas Lin
c12550b9f4 Merge "Call ConnectivitySettingsUtils to set/get private DNS related settings" 2021-06-21 19:12:33 +00:00
James Mattis
420072651d Merge "Updating timeout for Per-App CTS" 2021-06-21 17:17:13 +00:00
lucaslin
b781a94ccf Add CTS for systemReady() & getIpSecNetIdRange()
Bug: 182963354
Test: 1. atest CtsNetTestCases:ConnectivityManagerTest
      2. atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Change-Id: I0b286f32389501402e552010546c62f3e56833d6
2021-06-21 19:37:43 +08:00
Treehugger Robot
aa397809e2 Merge "Add a test for ConnectivityFrameworkInitializer" 2021-06-21 11:23:11 +00:00
Treehugger Robot
bccd97f0b3 Merge "Add test for setHttpProxyConfiguration" 2021-06-21 10:59:12 +00:00
Junyu Lai
f92979bd5b Merge "Add CTS for registerNetworkOffer" 2021-06-21 10:58:04 +00:00
Mark Chien
cec294d1b4 Merge changes I270ff43c,Ifc7eee24
* changes:
  Add enable and disable ip serving common functions
  Allow to use ncm function for usb tethering
2021-06-21 10:56:45 +00:00
Remi NGUYEN VAN
cc79d7c0f8 Merge "Add connectivity coverage tests" 2021-06-21 10:55:33 +00:00