testGetMultipathPreference assumes that wifi will auto-reconnect after
changing its metered status, but this is not necessarily the case if the
BSSID has been blocklisted after it failed validating too many times.
Call ensureWifiConnected to force wifi to reconnect before waiting for
it to become metered.
Bug: 190913510
Test: atest ConnectivityManagerTest
Change-Id: Iafe9837b97e4d654bb0f3962d48a94c1f31bbebc
qtaguid is long dead - test is thus a no-op
New test logs:
Running Tests...
x86 CtsNativeNetTestCases
-------------------------
CtsNativeNetTestCases (1 Test)
[1/1] BpfTest#bpfStructSizeTest: PASSED (0ms)
Summary
-------
x86 CtsNativeNetTestCases: Passed: 1, Failed: 0, Ignored: 0, Assumption Failed: 0,
All tests passed!
Test: atest CtsNativeNetTestCases, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9ff784dbfda0ce981904d53eacb7bc831cbe81da
This test is required to ensure that the system is compatible
with future updates of the tethering mainline module, which
updates BPF .o files on device.
This test must already be passing on OEM devices because otherwise
the offload.o program in the Tethering mainline module would bootloop
the device.
Bug: 190519702
Test: atest CtsNativeNetTestCases, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1756440
Merged-In: Ibaedb8fcb28591ffba1506514f2305d55712a26b
Change-Id: Ibaedb8fcb28591ffba1506514f2305d55712a26b
This test is required to ensure that the system is compatible
with future updates of the tethering mainline module, which
updates BPF .o files on device.
This test must already be passing on OEM devices because otherwise
the offload.o program in the Tethering mainline module would bootloop
the device.
Bug: 190519702
Test: atest CtsNativeNetTestCases, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibaedb8fcb28591ffba1506514f2305d55712a26b
Connect can error with BUSY if the framework is busy when connect is
called. Add retries so that if this happens, the connection can succeed
after the framework stops being busy.
Also log the level of scan results when several configurations are
available, and clarify the legacy broadcast assert.
Bug: 188077861
Test: atest CtsNetTestCases
Change-Id: I99ce72bd2604489cb419ea9984643b6985728461
The internal structure backing getAllNetworks is updated after
invoking lost callbacks, so the test needs to wait for the handler
to be idle before calling getAllNetworks.
Also avoid assertions in finally clauses, as it causes confusing
error messages.
Bug: 185081944
Change-Id: I8ad5ab45a3e65b0031672e6f594b1a6d6ad5abcb
Test: atest ConnectivityServiceTest
The test relied on waitForIdle to ensure diagnostics callbacks were called,
but as this may require several iterations in the handler queue, this makes
the test unreliable.
Use mockito timeouts on the verify() calls instead.
Bug: 192651465
Change-Id: Iae1704af7ae3649eae301c6aee223ac753629d55
Test: atest ConnectivityServiceTest
* changes:
Apply jarjar rules on coverage tests
Re-skip connectivity unit tests before S
Move ConnectivityCoverageTests to general-tests
Fix ConnectivityManagerTest initialization on Q
Move test_mainline_modules to AndroidTest.xml
Add ConnectivityCoverageTests to postsubmit
Add connectivity coverage tests
Make tests compatible with mockito-extended
Fix KeepalivePacketDataUtilTest crash on eng build
Update connectivity TEST_MAPPING
Address a TODO to use WifiManager#connect to reconnect wifi, instead of
WifiManager#reconnect. #connect also clears the BSSID denylist; that
list has caused flakyness due to tests that cause the network not to
validate such as captive portal or invalid private DNS behavior tests,
causing wifi to ignore the access point in reconnect attempts.
Bug: 188077861
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I5a11a802db8a4881c161e6038c1c183d2ac23a05
DEVICE_INITIAL_SDK_INT does not exist in older SDKs: use the pre-rename
field, FIRST_SDK_INT instead.
Fixes: 185731191
Test: atest ConnectivityManagerTest#testSocketKeepaliveLimitTelephony
Change-Id: I1fbc0f714d539a664c053cb9cf1f86c3e651c5a2
Merged-In: I1fbc0f714d539a664c053cb9cf1f86c3e651c5a2
Replace all FIRST_SDK_INT usage in Connectivity because it has
been renamed to DEVICE_INITIAL_SDK_INT.
Bug: 184735771
Test: m CtsNetTestCases
Merged-In: I2f155592b08cdbf259a00b035cacb37ca9847e72
(clean cherry-pick)
Change-Id: I2f155592b08cdbf259a00b035cacb37ca9847e72
Apply their respective jarjar rules on tethering and general
connectivity tests, then merge both into the coverage tests suite.
This is necessary to ensure that classes covered by tests have names
matching classes used in code.
Also fix IpConnectivityLogTest to use the module utility instead of the
hidden BitUtils, as the test would fail after internal utils are
jarjared.
Bug: 187935317
Test: atest ConnectivityCoverageTests TetheringCoverageTests
Original-Change: https://android-review.googlesource.com/1749680
Merged-In: Ib95b58dab93f7adebc445b662a6d15db1ce0e7c2
Change-Id: Ib95b58dab93f7adebc445b662a6d15db1ce0e7c2
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.
This applies a previous change, this time using DevSdkIgnoreRunner,
as SdkSuppress does not work as expected in branches that have a
codename 2 versions above the SDK version, as is the case in AOSP.
Bug: 187935317
Test: atest ConnectivityCoverageTests on R
atest FrameworksNetTests on S
Original-Change: https://android-review.googlesource.com/1749684
Merged-In: I5808d34459a4c19238baf8873afa7cf942828460
Change-Id: I5808d34459a4c19238baf8873afa7cf942828460
The test suite is not signed with any particular key so
can be in general-tests. This is also required for TEST_MAPPING.
Bug: 187935317
Original-Change: https://android-review.googlesource.com/1749025
Merged-In: I9dbf98eaa28172a172e707091ea75ffdddd4971b
Change-Id: I9dbf98eaa28172a172e707091ea75ffdddd4971b
Test: TH for test mapping
The test can't have TetheringManager as an argument to methods or a
field, otherwise the test runner will crash when scanning the class for
tests because TetheringManager did not exist in Q. Although
testFactoryReset is already skipped on Q, the test runner would fail
at initialization time, before starting the run.
Use CtsTetheringUtils instead. This ensures that TetheringManager does
not have method signatures or members that reference classes that do not
exist on Q, so the test runner can scan the class successfully before
starting the run.
Bug: 188851796
Test: atest ConnectivityManagerTest on Q
Original-Change: https://android-review.googlesource.com/1740779
Merged-In: I87488d0f23628a1ef2d7af0242513fcc5401d598
Change-Id: I87488d0f23628a1ef2d7af0242513fcc5401d598
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
Original-Change: https://android-review.googlesource.com/1748157
Merged-In: Ie0aca0c64646825175769cd375bcecf65de4b4c8
Change-Id: Ie0aca0c64646825175769cd375bcecf65de4b4c8
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
Original-Change: https://android-review.googlesource.com/1736506
Merged-In: I9a05d6a300c5f777497e867d0456bc59b06eee80
Change-Id: I9a05d6a300c5f777497e867d0456bc59b06eee80
The coverage tests will allow measuring code coverage for all
Connectivity+Tethering code.
This is a combination of the current TetheringCoverageTests, and
FrameworksNetTests.
Adding min_sdk_version to the test prevents it from using deprecated
IoUtils utilities. Replace it with the non-deprecated alternative.
Bug: 187935317
Test: atest ConnectivityCoverageTests
Original-Change: https://android-review.googlesource.com/1731232
Merged-In: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
Change-Id: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
- Some applications are installed on external storage and they
are unavailable until exernal storage installed them
completely. And their permission need update after becoming
available. Thus, listen EXTERNAL_APPLICATIONS_AVAILABLE intent
and update those package whose is listed in chaged package
list.
- Remove user argument on buildPackageInfo() because the uid on
ApplicationInfo is based uid.
Bug: 145234989
Test: atest FrameworksNetTests
Merged-In: Ia11ca4a7ba6fc1b87c27c0c40e36c91d9cdb322a
Change-Id: Ia11ca4a7ba6fc1b87c27c0c40e36c91d9cdb322a
Certain network types, like the VCN, have underlying
networks for the purpose of data usage, but do not want to
propagate the underlying network capabilities.
Allow these networks to set underlying networks, but continue
not to propagate the capabilities.
Bug: 190620024
Test: new unit test
Original-Change: https://android-review.googlesource.com/1753619
Merged-In: I53d6080f48707ff3c37fbfbef534284ba77a7432
Change-Id: I53d6080f48707ff3c37fbfbef534284ba77a7432
Certain network types, like the VCN, have underlying
networks for the purpose of data usage, but do not want to
propagate the underlying network capabilities.
Allow these networks to set underlying networks, but continue
not to propagate the capabilities.
Bug: 190620024
Test: new unit test
Change-Id: I53d6080f48707ff3c37fbfbef534284ba77a7432
This change adds relevant tests for the migrateTun functionality in
NetworkStats.
Bug: 190620024
Test: atest NetworkStatsTest
Change-Id: I33f14f2d0f71013a594fd4c8c3914a590d30ea06
The utilities are part of com.android.internal.util, but were
historically tested as part of the services.net tests. They were then
mistakenly moved to packages/modules/Connectivity with the rest of the
networking code, but actually belong in coretests.
Bug: 187935317
Test: atest FrameworksCoreTests
Change-Id: I74702f6a4d9bed5985d2a830dacd78129a7854a8
Skip tests that cannot run in instant mode, as WifiManager is not
available, and the test cannot bind to sockets in instant mode.
Bug: 192284219
Test: atest CtsNetTestCases -- --enable-parameterized-modules \
--abi arm64-v8a --module-parameter instant_app
Original-Change: https://android-review.googlesource.com/1753823
Merged-In: I7a7b0169a3a495bb359dc1f72e56937dcdc5b8a8
Change-Id: I7a7b0169a3a495bb359dc1f72e56937dcdc5b8a8