EthernetManagerTest#testCallbacks() should not enforce up/up/down/up
callbacks, so this bug can be fixed in mainline without breaking CTS13.
Test: atest EthernetManagerTest
Bug: 234314411
Change-Id: I1650bbc2a5883a874b92ecf2bcc7a56d01f4a905
Merged-In: I1650bbc2a5883a874b92ecf2bcc7a56d01f4a905
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
Qin Wangauthored and Krzysztof Kosińskicommited 2022-09-14 05:50:51 +00:00
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
Hungming Chenauthored and Nucca Chencommited 2022-09-14 04:03:24 +00:00
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
* changes:
Move Interface index name map dump to NetworkStatsService
Move stats map A/B dump to NetworkStatsService
Add BpfInterfaceMapUpdater#getIfNameByIndex
Motomu Utsumiauthored and Gerrit Code Reviewcommited 2022-09-14 01:27:49 +00:00
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
Hungming Chenauthored and Nucca Chencommited 2022-09-13 09:37:36 +00:00
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