The interface index is only propagated if there is an A/AAAA
record in the response. Since the responses here are not entirely
controlled in the test, we just want to verify that we get a
response with the target we expect.
Verified by running the test 1400 times via --runs_per_test flag.
Bug: 254155029
Fix: 255922416
Test: atest MdnsSocketClientTests#startDiscovery_andPropagate\
InterfaceIndex_includesInterfaceIndex --iteration 100
Change-Id: Icb0fe7a58a1e626b7f781ff24c2389a3095d4dc6
This allows clat to initialize properly when VPNs are configured
with "Block connections without VPN", rather than to error out with
"no IPv6 addresses were available for clat".
This issue primarily affects particular mobile networks configured
with NAT64 (without direct IPv4 connectivity).
Bug: 255040839
Change-Id: I4a8ee0295e0f5d1e330f7529856347b8bd10360c
shouldIgnoreValidationFailureAfterRoam will incorrectly return
true in the first few seconds after boot even if the network
never roamed. This is extremely unlikely to happen, but add a
check for that just in case.
Fix: 230450214
Test: new unit test
Change-Id: I0789d9bdaa0bd9e78673e8f4248a2ca610052f1e
- Confirm that the default network switches to cell for the right
reason.
- Test the behaviour on T as well (always disabled).
- Minor code cleanups.
Bug: 216567577
Test: test-only change
Change-Id: Idf4cf74aec3d40246f67519d211dbd45e739a6dc
For Matter, in addition to the InetAddress and port, we also need
to know the associated NetworkInterface index. With this change,
the interface index is propagated from the MdnsSocketTypeClient
through to MdnsServiceInfo based on a flag (defaulting to -1 for
unspecified, if the flag is disabled).
Validated end-to-end against a commissioned Matter device,
enabling the flags, verifying the returned network index against
an adb shell 'ip link show' output.
Bug: 254155029
Test: atest FrameworksNetTests
Change-Id: I96e804b32cdeeff3ed22da35a030df4d5dbb179a
RFC 6763 defines that TXT value can accept both utf-8 string and
binary data. Current implementation will always cast the TXT
value to a utf-8 string and will cause data lose when there are
non-utf-8 chars in the TXT value. This commit fixes this by
having the browser passing the TXT values back as byte[].
Also fixed the TXT key&value parsing issues per RFC 6763
section 6.5: accept cases of no '=' and reject empty key.
Bug: 254155029
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I4b755e60ad6e59db19faa41556dd214993d73896
Before this patch, ConnectivityServiceTest#TestNetworkCallback
relies on TestableNetworkCallback calling this overridden methods
for all expectCallback calls. This is very confusing :
- The code for TestableNetworkCallback might be refactored so it
no longer calls this, we'd lose the checks and nobody would
notice.
- Anyone using TestableNetworkCallback instead of
TestNetworkCallback would get a different behavior but would
not notice as the interface for these two classes is exactly
the same
This is also bad for performance because all callback checks will
always look whether it's a check for LOSING, which is rare.
This patch also only generates the error message when the error
actually happens.
Test: ConnectivityServiceTest
Bug: 157405399
Change-Id: Ic9566b815dc4f9b001986ed1376d31a1b97ac8c5
Currently, the stats returned by getNetworkStatsUidDetail()
does not filter iface for mUidOperations, it will cause this
API returns the stats that might contain data with unexpected
iface. Thus filter iface for mUidOperations before combining
it into the return stats.
Bug: 235444141
Test: FrameworksNetTests
Change-Id: I81aaacb5682d69022e521a793516373037510742
This will be useful for diagnosing default network changes.
Logs may look like, for example :
Update capabilities for net 100 : -NET_CAPABILITY_OEM_PAID+NET_CAPABILITY_TRUSTED
Or :
Update score for net 100 : -POLICY_EVER_EVALUATED+POLICY_IS_VPN+POLICY_IS_DESTROYED
Test: FrameworksNetTests
manual
Change-Id: Ic4788c599573aae9daeca995b8853800aaaba0b8
Add code to verify which networks are passed in, and check that
the default interface appears in the LinkProperties of one of the
snapshots.
Test: test-only change
Change-Id: I3c1a483b89564b1c994b8e644ece5b903f549475
* 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
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
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
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
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
This replaces testNetworkRequest_linkPropertiesUpdate in
EthernetNetworkFactoryTest.
Test: atest EthernetManagerTest
Change-Id: Ib27b18a153a1866765378753baa9046aff9636f3
Test: FrameworksNetTests
adb shell device_config put connectivity actively_prefer_bad_wifi
+ check that dumpsys updates
Test: at this patchset tests fail with :
Permission denial: reading from settings requires:android.permission.READ_DEVICE_CONFIG
Change-Id: Icfe1e64b8313921ff1dc8e4cbd45f967692e1c4a
The removed test cases already have coverage in EthernetManagerTest and
are therefore removed. The removed tests should all be covered by
testNetworkRequest_withSingleExistingInterface.
Test: atest EthernetManagerTest
Change-Id: I5e23fc17ab10429dfb10477ff9ba546db37727ea
This is necessary so that MultinetworkPolicyTracker can see
DeviceConfig. It will also allow removing reflection from
this file to address a long-standing TODO.
Test: build
Change-Id: I968bf67e0e0189b01515242371599c02bc9e2ca2
ClatCoordinator should not rely on the caller Nat464Xlat to
avoid dumping when clat is not started. It is safer to dump
information after ClatCoordinator has checked its status.
Only dumping ClatCoordinator with clatd started reduces the null
pointer check of dumped elements as well.
Test: atest ClatCoordinatorTest
Change-Id: Ia0be9a593cd75fd34f647230d642b0dcf84aaf3b