Commit graph

66,589 commits

Message SHA1
Merge "Make unregisterAfterReplacement tear down CONNECTING networks."
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-10-13 07:17:17 +00:00
d29ee042cf
Merge "Add test for NetworkStats.clearInterfaces"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-10-13 06:54:04 +00:00
b7978193d1
Keep primitive members used by MessageUtils.
This includes in particular {Full,Network}Score.POLICY_* members
which were removed recently.

Before :
  Policies : 55&62&63
After :
  Policies : EVER_EVALUATED&EVER_VALIDATED&IS_VALIDATED

This patch also unifies the directives under Tethering/ for
simplicity.

Test: adb logcat & dumpsys connectivity & dumpsys tethering
Change-Id: I3d231fbaaebe233b2633da8bb880b5ad1613a32f

Chalard Jean   commited 2022-10-13 13:11:53 +09:00
88edc35da6
Add test for NetworkStats.clearInterfaces
Test: FrameworksNetTests:NetworkStatsTest
Change-Id: Ic8ff1c3213e53a043ebbd3d7ddfeb295a198675d

Aaron Huang   commited 2022-10-12 18:57:43 +00:00
4c3159d3a7
Merge "Test MOBIKE trigged while VPN data stall"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-10-12 14:04:39 +00:00
98a35775cd
Merge "Update uiautomator references in packages/modules/Connectivity"
Daniel Peykov   authored and   Gerrit Code Review   commited 2022-10-12 06:57:49 +00:00
10f347c067
Merge "Increase timeout for waiting a validated network"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-10-12 04:01:39 +00:00
49d3626346
Increase timeout for waiting a validated network
testDefaultNetworkActiveListener expects Wifi network to be
the system default network. This requires Wifi to be validated
since the cellular network may be connected in the devices that
support telephony. The original timeout was only set to 5
seconds. The timeout may not be enough in some poor environment
cases, so increase the timeout would be helpful to reduce the
flaky rate.

Bug: 250250617
Test: atest android.net.cts.ConnectivityManagerTest
Change-Id: Iaef307e72dcd7a74cd5fdc6a406443eed6b412a6

chiachangwang   commited 2022-10-11 10:21:55 +00:00
ca1f00762c
Make unregisterAfterReplacement tear down CONNECTING networks.
Bug: 245823767
Test: new test coverage
Change-Id: Icb47e8375f3f8bff4ac8d0833c9efd8d0ba7cda0

Lorenzo Colitti   commited 2022-10-11 17:38:38 +09:00
82350ea269
Merge "Clear DNS cache after every network access."
Sudheer Shanka   authored and   Gerrit Code Review   commited 2022-10-09 19:12:24 +00:00
fb63db00c4
Clear DNS cache after every network access.
If the app tries to make a network connection in the
foreground immediately after trying to do the same when
it's network access was blocked, it could receive a
UnknownHostException due to the cached DNS entry.
So, clear the dns cache after every network access for
now until we have a fix on the platform side.

Bug: 237549250
Bug: 238064333
Bug: 237556596
Bug: 238962235
Bug: 238833668
Bug: 239262832
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: Will be cherrypicked to aosp later
Change-Id: Ic603b1bd9da24ee3724054c4a91794ee569e97f6
Merged-In: Ic603b1bd9da24ee3724054c4a91794ee569e97f6

Sudheer Shanka   commited 2022-10-08 15:19:04 +00:00
1de4209887
Merge changes Ifb7305be,I74d9d074,Ia0f6b67c,Ib14f444b
* changes:
  ethernet: fix interface state callbacks ignoring restricted permission
  ethernet: cleanup ethernet state listener interaction
  ethernet: fix IpClient restart when link is down
  ethernet: ignore NUD failures for static ip configurations

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-10-07 18:30:08 +00:00
cfc74d42b4
ethernet: fix interface state callbacks ignoring restricted permission
Test: atest EthernetManagerTest
Change-Id: Ifb7305bec20e72f8354227b1cb0708fe9c07ed06

Patrick Rohr   commited 2022-10-07 09:01:12 -07:00
f7b850a48f
ethernet: cleanup ethernet state listener interaction
Add a addEthernetStateListener() function that works just like
addInterfaceStateListener(). Make sure ethernet state listeners are
added to addedListeners, and addedListeners are removed from both
ethernet and interface state listeners on tearDown. This is safe even if
a given listener was not registered as one or the other.

Test: atest EthernetManagerTest
Change-Id: I74d9d0747b94b7d34a2fe7630e840acd34f1a500

Patrick Rohr   commited 2022-10-07 09:01:12 -07:00
5f6a50cf15
ethernet: fix IpClient restart when link is down
Do not restart IpClient when link is down after calling
updateConfiguration().

Test: atest EthernetManagerTest
Bug: 249897651

Change-Id: Ia0f6b67cde63747a608d35b8bec6ad37bcabb110

Patrick Rohr   commited 2022-10-07 08:57:12 -07:00
ae3ace4433
ethernet: ignore NUD failures for static ip configurations
Bug: 245064497
Test: atest EthernetManagerTest
Change-Id: Ib14f444b219e744226f5b58f5f61e38318d2f9a0

Patrick Rohr   commited 2022-10-07 08:57:12 -07:00
53c84a8f1f
Merge "Use BpfDump#dumpMapStatus in NetworkStatsService"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-10-07 10:27:14 +00:00
fe7f60bd8e
Merge "Move Interface stats map dump to NetworkStatsService"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-10-07 10:27:04 +00:00
480ddf35f4
Merge "Partially enforce permission when calling getNetworkInfoForUid"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-10-07 04:38:30 +00:00
d577c39663
Merge "Allow jchalard@, maze@ and reminv@ to approve fixes for flaky tests."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-10-06 12:09:58 +00:00
4173b8f699
Merge "Ensure validated networks connected before applying test URLs"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-10-06 09:59:23 +00:00
6c409cefac
Merge "Validate NetworkCapabilities on unparceling"
Jean Chalard   authored and   Gerrit Code Review   commited 2022-10-06 09:26:45 +00:00
f955700755
Allow jchalard@, maze@ and reminv@ to approve fixes for flaky tests.
Change-Id: I3ebd4e721add97d7911167c49dad3ffe7bcf577b
Test: None

Lorenzo Colitti   commited 2022-10-06 09:06:20 +00:00
aca4658bf8
Partially enforce permission when calling getNetworkInfoForUid
Test: atest ConnectivityServiceTest#testGetNetworkInfoForUid
Change-Id: Ie0ac289e77a865cf3cc98a6a2bbd5b25cf402622

Junyu Lai   commited 2022-10-06 10:40:57 +08:00
163cb98751
Merge "Note that TP1A.221005.003 is merged (aosp/2160462)"
Xin Li   authored and   Gerrit Code Review   commited 2022-10-05 22:20:15 +00:00
6557144b32
Merge "Fix the test flake on ConnectivityServiceTest"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-10-05 11:23:32 +00:00
bc5a46e564
Use BpfDump#dumpMapStatus in NetworkStatsService
Bug: 217624062
Test: dumpsys netstats, atest NetworkStatsServiceTest
Change-Id: Ibac95e53449fa48c02388d5f280f6b7475c21196

Motomu Utsumi   commited 2022-10-05 17:34:20 +09:00
a9c4dee9c8
Move Interface stats map dump to NetworkStatsService
Bug: 217624062
Test: dumpsys netstats, atest NetworkStatsServiceTest
Change-Id: Ie0357a79925c0bbb34aa05442f727c776f434f88

Motomu Utsumi   commited 2022-10-05 17:33:02 +09:00
809a316035
Merge "Move partial train MTS tests to presubmit"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-10-05 07:49:42 +00:00
d87e99cf59
Merge "Mark QosCallbackExceptionTest ConnectivityModuleTest"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-10-05 05:49:24 +00:00
388787b8fd
Merge "Move ownerMatch config dump to BpfNetMaps"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-10-05 04:11:43 +00:00
b2832afa9a
Merge "Move current StatsMap dump to BpfNetMaps"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-10-05 04:11:11 +00:00
1e003b4c9a
Merge "Move uidOwnerMap dump to BpfNetMaps"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-10-05 04:10:13 +00:00
2f17ade211
Merge "Move uidPermissionMap dump to BpfNetMaps"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-10-05 04:07:46 +00:00
bd4a2d0cee
Ensure validated networks connected before applying test URLs
Some tests use internal http server to mock the network
validation test URLs. The test URLs are expected to apply on
specific network only, like Wifi. However, the network may
sometimes unexpectedly reconnect due to network issues. If a
network is connecting while applying the test URLs, the network
will get the same mock validation result and carry the result
to the follow up tests. This will fail the tests after it.

Thus, verify the supported networks to be connected and validated
before changing the validation URLs to prevent the URLs using in
unexpected networks.

Bug: 248251876
Test: atest android.net.cts.ConnectivityManagerTest
Change-Id: I39428abe05ab4336ca49beec33b2f9973f14f239

chiachangwang   commited 2022-10-05 03:26:39 +00:00
f281fd0f5c
[automerger skipped] ethernet: wait for the interface listener to be registered am: 83b95f6bab -s ours
am skip reason: Merged-In Iefccc9318a9ea2f929d34a52b7b275bf7a23f443 with SHA-1 ef61c582f5 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2239824

Change-Id: I0f7061790c0556a379ab2916b773cd4ec3e2f792
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Patrick Rohr   authored and   Automerger Merge Worker   commited 2022-10-04 23:15:11 +00:00
9cb4c13f79
Update uiautomator references in packages/modules/Connectivity
* Replace "androidx.test.uiautomator" (v2.2.0) with
  "androidx.test.uiautomator_uiautomator" (v2.3.0).

Bug: 247008528
Test: presubmit
Change-Id: Ic274f81492d5a11b73de0a6d6a11c5cb16ddedea

Daniel Peykov   commited 2022-10-04 21:59:30 +00:00
2bf3a3831b
Merge changes Ic3d0a22e,I6d295bce,I40c38a1f,Ib27b18a1,I5e23fc17, ...
* changes:
  ethernet: further cleanup updateConfiguration tests
  ethernet: add test for updateConfiguration on untracked interface
  ethernet: fix updateConfiguration expectations
  ethernet: add LinkPropertiesChanged coverage in EthernetManagerTest
  ethernet: remove unit test cases that have end-to-end coverage
  ethernet: temporary mitigation for test that uses TUNSETCARRIER

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-10-04 15:44:20 +00:00
e376f2fc72
Fix the test flake on ConnectivityServiceTest
This test need a connected enterprise Network before setting
a profile network preferences. If there is no enterprise network
after setting no fallback preference, it will get lost callback
from cell network because it's not matched current preference.
The test fails sometimes because the enterprise network agent is
not fully connected yet. Thus, make sure the agent is fully
connected before settting a profile network preferences.

Fix: 242833379
Test: atest FrameworksNetTests:com.android.server.Connectivity\
      ServiceTest#testPreferenceForUserNetworkUpDownWithNo\
      FallbackWithAlreadyConnectedWorkAgent \
      --rerun-until-failure 100 on cf target
Change-Id: I040b9f31c29834f90f4ca62c512e392141a3244d

Paul Hu   commited 2022-10-04 08:13:15 +00:00
bdd7fe48e4
Move ownerMatch config dump to BpfNetMaps
Information in the dump does not change
....
current ownerMatch configuration: 516 DOZABLE_MATCH OEM_DENY_1_MATCH
....

Bug: 217624062
Test: dumpsys connectivity trafficcontroller, atest BpfNetMapsTest
Change-Id: I5f7b56e4ba03256414f49d0e82d65477fb97f05a

Motomu Utsumi   commited 2022-10-04 15:02:43 +09:00
372c9b45ee
Move current StatsMap dump to BpfNetMaps
Information in the dump does not change
....
current statsMap configuration: 0 SELECT_MAP_A
....

Bug: 217624062
Test: dumpsys connectivity trafficcontroller, atest BpfNetMapsTest
Change-Id: I42a844227f258b91ba5b368d8e8abf82a773a801

Motomu Utsumi   commited 2022-10-04 15:02:43 +09:00
c675d6fc01
Move uidOwnerMap dump to BpfNetMaps
Before this CL
....
mUidOwnerMap:
10050  IIF_MATCH LOCKDOWN_VPN_MATCH 0
10061  HAPPY_BOX_MATCH
10091  HAPPY_BOX_MATCH IIF_MATCH LOCKDOWN_VPN_MATCH 0
....

After this CL
....
sUidOwnerMap:
  10050 IIF_MATCH LOCKDOWN_VPN_MATCH 0
  10061 HAPPY_BOX_MATCH
  10091 HAPPY_BOX_MATCH IIF_MATCH LOCKDOWN_VPN_MATCH 0
....

Bug: 217624062
Test: dumpsys connectivity trafficcontroller, atest BpfNetMapsTest
Change-Id: I0e2358e462824273a89fcba6e19e75a233f9fe18

Motomu Utsumi   commited 2022-10-04 15:02:41 +09:00
956d86ccdf
Move uidPermissionMap dump to BpfNetMaps
Also remove the dump of mPrivilegedUser because this is not used now and
the information is duplicated with uidPermissionMap dump.

Before this CL
....
mUidPermissionMap:
10049 PERMISSION_NONE
10027  BPF_PERMISSION_INTERNET BPF_PERMISSION_UPDATE_DEVICE_STATS
1041  BPF_PERMISSION_UPDATE_DEVICE_STATS
....

After this CL
....
sUidPermissionMap:
  10049 PERMISSION_NONE
  10027 PERMISSION_INTERNET PERMISSION_UPDATE_DEVICE_STATS
  1041 PERMISSION_UPDATE_DEVICE_STATS
....

Bug: 217624062
Test: dumpsys connectivity trafficcontroller, atest BpfNetMapsTest
Change-Id: I416501d5a28a5443f954f9c8c58ea255e5cdc897

Motomu Utsumi   commited 2022-10-04 15:00:34 +09:00
310850f210
[automerger skipped] TestOnly: add setEthernetEnable support to EthernetManagerTest am: 88f253679b -s ours
am skip reason: Merged-In I6650c028c121d932f10219d04d40d1ad60d9d4d8 with SHA-1 bd5745effa is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2238193

Change-Id: I4c612624794f531fc5ec928d3ac1182912f480c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Mark   authored and   Automerger Merge Worker   commited 2022-10-04 00:00:13 +00:00
d98a02985b
ethernet: wait for the interface listener to be registered
If an interface is created before the interface state listener is
registered with the ethernet service, callbacks can get missed.
Specifically, createInterface() expects a down before an up callback. If
the listener registration executes after the event, the listener only
receives the final state event (up in this case).

This was a common source of flakiness in the EthernetManagerTests.

Test: EthernetManagerTest
Bug: 243120665
Merged-In: Iefccc9318a9ea2f929d34a52b7b275bf7a23f443
Change-Id: Iefccc9318a9ea2f929d34a52b7b275bf7a23f443
(cherry picked from commit ef61c582f5)

Patrick Rohr   commited 2022-10-03 23:47:01 +00:00
83b95f6bab
ethernet: further cleanup updateConfiguration tests
Moving NetworkCapabilities to a global removes a bunch of boilerplate
code. In addition, eventuallyExpectCapabilities() now checks for the
(non-exlusive) presence of all specified capabilities.

Test: atest EthernetManagerTest --iterations 10
Change-Id: Ic3d0a22ec45c8be8d9a719c4d9f2291e63437578

Patrick Rohr   commited 2022-10-03 15:31:12 -07:00
6a5d467e67
ethernet: add test for updateConfiguration on untracked interface
The automotive team has confirmed that updating IpConfiguration /
NetworkCapabilities should succeed independent of the interface state
(absent, client mode, server mode). This ensures updateConfiguration
works when the interface is absent, and the configuration is applied to
the interface once it gets added.

Test: atest EthernetManagerTest --iterations 10
Bug: 236312641
Change-Id: I6d295bce4575daca2061f46313732a9e4600a2ee

Patrick Rohr   commited 2022-10-03 15:31:12 -07:00
3a79bee701
ethernet: fix updateConfiguration expectations
Since the mainline module is required to pass CTS, expectations that
test implementation details need to be removed from tests. For
updateConfiguration specifically, this means removing the expectLost() /
expectAvailable() expectation that is a symptom of the current
implementation but does not affect that actual outcome of this API.

Test: atest EthernetManagerTest --iterations 5
Change-Id: I40c38a1fe847eb4166e75535cf70db9ba569bc43

Patrick Rohr   commited 2022-10-03 15:31:12 -07:00
9c85c597d9
ethernet: add LinkPropertiesChanged coverage in EthernetManagerTest
This replaces testNetworkRequest_linkPropertiesUpdate in
EthernetNetworkFactoryTest.

Test: atest EthernetManagerTest
Change-Id: Ib27b18a153a1866765378753baa9046aff9636f3

Patrick Rohr   commited 2022-10-03 15:31:09 -07:00
6d49728122
Note that TP1A.221005.003 is merged (aosp/2160462)
Merged-In: I1706ceb129ef95f44d45754665b9dbcf9b6fdfd4
Change-Id: I3c4a819bf450f1e2ae0891536f1f4266c543f692

Xin Li   commited 2022-10-03 13:37:05 -07:00
663c852791