Add owners to approve xTS changes that are cherry-picks
of changes already merged in aosp/master, as suggested
by current owners.
Also add LAST_RESORT_SUGGESTION to everyone except
lorenzo@, as only lorenzo@ is expected to approve the
original changes, so suggesting other reviewers would
most of the time not be helpful.
Change-Id: I3d04eab6dc5070e09840b9b9563d8955ed18669d
Test: m
The ro.radio.noril system properties is not used anymore. Tests
that require to check if device supports wifi but not telephony
should verify it via PackageManager.hasSystemFeature(). Also
remove the systemProperties mocking since the only need for the
mocking is removed.
Bug: 242647857
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: Ie34e87394458e64a9363678a863d6d977834958f
Test fails on MTS but works fine on Eng atest.
Ideally, save one DiscoveryItem, the size should be 1, save two items,
the size should be 2.
But in Eng atest, the result shows that there seems to be an extra DiscoveryItem stored in the
database. After investigation, found that the extra one is from another test case: saveRetrieveInfo, where another DiscoveryItem was saved to the database.
Since tests can be run in parallel, sometimes one test may run before or after another. So, it may have different test results.
Combining the two tests into a single test and letting them run sequentially solved the problem.
Bug: 238394647
Test: unit test
Change-Id: I9536ce6ad4fff78188f0ceb325d275b05aa47da4
Merged-In: I9536ce6ad4fff78188f0ceb325d275b05aa47da4
Used to avoid flaky test because upstream changed events
order can't be guaranteed. Once tethering choose non-test
upstream {wifi, ..}, test network wont't be chosen.
Fix flaky tests which are using initTetheringTester():
testIcmpv6Echo
testTetherClatUdp
testTetherUdpV4_VerifyBpf
testTetherUdpV4
testTetherUdpV4Dns
testTetherUdpV6
Moreover, add permission ACCESS_WIFI_STATE to AndroidManifest.xml
to avoid nested runAsShell while using CtsNetUtils to access WIFI.
STACKTRACE:
java.lang.IllegalStateException: adoptShellPermissionIdentity calls must not be nested
at com.android.testutils.TestPermissionUtil.runAsShell(TestPermissionUtil.kt:49)
at com.android.testutils.TestPermissionUtil.runAsShell(TestPermissionUtil.kt:70)
at com.android.testutils.TestPermissionUtil.runAsShell$default(TestPermissionUtil.kt:65)
at com.android.testutils.TestPermissionUtil.runAsShell(Unknown Source:16)
at android.net.cts.util.CtsNetUtils.disconnectFromWifi(CtsNetUtils.java:293)
at android.net.cts.util.CtsNetUtils.disconnectFromWifi(CtsNetUtils.java:255)
at android.net.cts.util.CtsNetUtils.toggleWifi(CtsNetUtils.java:160)
Bug: 243314243
Test: atest EthernetTetheringTest
Change-Id: I814899ae71f5c302d490a0dd81d7210ac138faa5
This is a preparation for the upcoming CL that will add the test for
BpfNetMaps#dump.
Bug: 217624062
Test: dumpsys connectivity trafficcontroller, atest BpfNetMapsTest
Change-Id: I79aa6f6153dc94f806411c642d72f4801915a588
Add test to verify converting Ikev2VpnProfile to Vpnprofile with
IkeTunnelConnectionParams set. Some fields like server should
not be set since the information should contain in the assigned
IkeTunnelConnectionParams.
Bug: 243718982
Test: atest FrameworksNetTests
Change-Id: Ie019ea98932a6d079f213e3bff45f21b44d3fa4e
* changes:
Move Interface index name map dump to NetworkStatsService
Move stats map A/B dump to NetworkStatsService
Add BpfInterfaceMapUpdater#getIfNameByIndex
Previously, the hiddenapi*-tiramisu.txt files that were created as part
of the work for creating framework-connecvity-t were just added to the
list of hidden API files on the bootclasspath_fragment. Unfortunately,
that made it impossible to exclude those when generating an sdk
snapshot for S which cannot include framework-connectivity-t.
This change moves those files to be part of framework-connectivity-t
instead of the bcpf so that they will only be used in an sdk snapshot
when the library is part of the snapshot.
Bug: 240406019
Test: packages/modules/common/build/mainline_modules_sdks.sh
# Ran the previous command with and without this change to make
# sure that this change does not change the sdk snapshot
# contents. A follow up change will exclude the
# framework-connectivity-t library from the S sdk snapshot.
Change-Id: Ib5c5c6046d96b911c8e9e5ac3729ce963f1b6907
A wifi network that is still evaluating, i.e. that doesn't know
yet if it's behind a captive portal, should not be preferred
to a network that yields to bad wifi because the stack doesn't
know yet if it's bad.
To rank the networks correctly, the ranker will therefore need
to know whether a network is still being evaluated. This patch
adds the time when this happened first to the NAI (as a
timestamp for debuggability) and the corresponding flag in
FullScore.
This doesn't have new tests because it doesn't yet expose
new behavior. Tests will come with the behavior.
Test: FrameworksNetTests
Change-Id: I737f314760356926fc07e6eef52f3c8abba2248b
For cuttlefish before T, TetheredInterfaceRequester may be responded
to over 200ms. That causes tests to become flaky. Using ethernet
manager to check available tethering interface instead of repeated
increases TetheredInterfaceRequester timeout
AVAILABLE_TETHER_IFACE_REQUEST_TIMEOUT_MS.
Bug: 243314243
Test: atest EthernetTetheringTest
Change-Id: I9cfab19adf1a54be82040da225c89b6570a36d4c
The clearance of the weak reference to TetheringManager can't be a
confirmation check of the completion running of its finalization.
The weak references to a weakly-reachable object will be cleared
before it becomes eligible for finalization. Calling of
System.runFinalization() method doesn't guarantee finalizers are
executed synchronously. In fact, finalizer of TetheringManager is
running in a different thread in this test.
GCs and finalizers behaviors could be vary on different JVMs.
Due to the unsynchronization, besides the weak reference of
TetheringManager, we need to add retries to the checking of
unregister Tethering internal callback as well.
Bug: 243340454
Test: atest TetheringServiceTest#testTetheringManagerLeak --iterations 10000
Change-Id: I8231146f26deb0825dadb70d8d0dbdc963989558
Map status dump will do access check if map is null.
This could show different message from the current dump output.
Information in map content dump does not change
$ dumpsys connectivity trafficcontroller
....
mIfaceIndexNameMap:
ifaceIndex=5 ifaceName=ip6_vti0
ifaceIndex=19 ifaceName=r_rmnet_data3
ifaceIndex=17 ifaceName=r_rmnet_data1
ifaceIndex=18 ifaceName=r_rmnet_data2
ifaceIndex=23 ifaceName=wifi-aware0
....
$ dumpsys netstats
....
BPF map content:
ifaceIndex=5 ifaceName=ip6_vti0
ifaceIndex=19 ifaceName=r_rmnet_data3
ifaceIndex=17 ifaceName=r_rmnet_data1
ifaceIndex=18 ifaceName=r_rmnet_data2
ifaceIndex=8 ifaceName=rmnet_ipa0
....
Bug: 217624062
Test: dumpsys netstats, atest
com.android.server.net.BpfInterfaceMapUpdaterTest
Change-Id: If182bd97f72713b6347028668cf7bd4676b8aea4
The DscpPolicyTest needs to be merged into CTS13 R2, so it cannot
always use APIs that were introduced after the T cutoff.
Run the test when the new APIs are available, but skip it otherwise as
the feature is known to be broken unless the device is using a newer
connectivity module.
DO NOT MERGE: should not be used for U+ tests.
Test: atest DscpPolicyTest
Bug: 243891394
Bug: 243120975
Change-Id: I86eeb7a008c6e299fdf7cb709844bc336f09bdfa
This switches the DscpPolicyTest to use a tap interface rather than a
tun interface. This should now test the same bpf code path that is used
in production and the raw ip version should be able to be removed.
Test: atest DscpPolicyTest
Bug: 243891394
Bug: 243120975
Change-Id: I1633b85810838afde6191f0a5094269e45c15ae4
Revert submission 1387135-st02
Reason for revert: Usage of TYPE_CNAME in a library shared among
modules does not interact well with current module release process
Reverted Changes:
Ib5616c65c:[ST02.2] Use the getters of DnsHeader
I5e58f99b0:[ST02.1] Add TYPE_CNAME constant to DnsResolver
I0c1547cbc:[ST02] Add methods for synthesizing DNS packets
Change-Id: I5aa9f28f1268f966f62041193ceb7c8bef994579
Revert submission 1387135-st02
Reason for revert: Usage of TYPE_CNAME in a library shared among
modules does not interact well with current module release process
Reverted Changes:
Ib5616c65c:[ST02.2] Use the getters of DnsHeader
I5e58f99b0:[ST02.1] Add TYPE_CNAME constant to DnsResolver
I0c1547cbc:[ST02] Add methods for synthesizing DNS packets
Change-Id: Ia35cb3e21cd90e036a07018e2d9c1ee662ce86a2
This flag conflates these two things, but it's a lot clearer
if they are separate and evaluated at the end.
Moreover, a new policy will make use only of one of them,
so having them separate is also useful going forward.
Test: FrameworksNetTests
Change-Id: Ia47b3974277cf76153a53d7e8a0e969c90ba78f4
The system feature depends on device, it will not change at runtime
basically. So do the system feature check once on NetworkAgentInfo
constructor.
Test: FrameworksNetTests CtsNetTestCases
Change-Id: I03fb8b87f5fda93286bd68ccbb23210066b0611b
- Netd's statusFromErrcode is return the ServiceSpecificException.
In S, the exception was ignored by NetworkManagementService.
But in T, the service is deprecated and netd binder call is used.
The exception is not handled and crashing the system.
In this case, NetworkStats is crashed and android system crashed also.
Change-Id: If906346fc3fccaec850e9d5cad166d7f29e4ca8e
Change upstream address prefix range from "10.0.0.0/8" to
"10.0.0.1/24" for reducing the flaky rate which caused by the
downstream address prefix conflict with upstream address.
Especially, "10.0.0.0/8" is one of downstream address prefix
range candidate. See PrivateAddressCoordinator.
Bug: 243314243
Change-Id: If995f1d20ac52b84757ac3dec198cae1ebb7e272
Test: atest EthernetTetheringTest
Per Mike's finding in aosp/2185522, inet_ntop() doesn't return
an error when converting a IPv4 string from an IPv6 network address.
That means that using expectAnswersValid(.., AF_INET, ..) to check
IPv6 RRs will pass. extractIpAddressAnswers() fails to check the
address family.
Check the RR type to make sure the RR contains the expected address
family type.
Bug: 242681575
Test: atest CtsNetTestCasesLatestSdk:MultinetworkApiTest
Change-Id: Ieb67513afac0d97971ba4ddab8ceff03eddf6f45