Now that the system server has a queue doing this job,
the queue on the network agent side can be removed.
Test: ConnectivityCoverageTests, CtsNetTestCases
Change-Id: Idf0435f447cfdd28d829a867d1085771837c6f9b
Move the existing helper methods to acquire carrier privileges in
NetworkAgentTest.kt to CarrierConfigRule where it can be reused by other
CTS tests. Also reset the carrier service package override in the rule
cleanup.
Bug: 216524590
Test: atest NetworkAgentTest
Change-Id: Id907a2d641aa61838119e2be65654b9796464498
Quang Anh Luongcommited 2025-03-18 13:05:01 +09:00
Currently ConnectivityDiagnosticsCollector invokes tcpdump with -U,
which would causes the collector failed to log ending packets due to
packet buffering.
Test:
android.net.cts.TrafficStatsTest#testTrafficStatsForLocalhost
Bug: 393471251
Change-Id: Ibe2977097bdeeef9546ce9c83b1dfd695c31f6d1
Mockito extended tends to cause all kinds of issues due to the way it
injects itself into the bytecode of framework classes instead of
creating subclasses.
Use non-extended mockito as it is not actually necessary for current
tests.
Test: atest
Change-Id: Id2874309cce2778c4405b852df9a3ae816c4abcb
The 'ip link show' requires root permissions, causing errors.
This change replaces 'ip link show' with 'ip link'.
Bug: 401123634
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I82b219ae9179f23e3233f797aeb4aa3740e6d3ec
This reverts commit 3eec0163fc.
Reason for revert: Failures in b/399299587 are flakes and not related
Original message:
Allow adding output from any shell command to the test diagnostics file,
instead of just dumpsys.
This introduces a new ShellUtil that can also help run more complex
commands, with pipes and redirects or as root for example.
Bug: 317602748
Test: atest with tests using this util
Change-Id: I609469864dfa5d520c055b648f9cac2f4443c5c6
Remi NGUYEN VANauthored and Gerrit Code Reviewcommited 2025-03-04 02:54:50 -08:00
This reverts commit 47b6619fa8.
Reason for revert: DroidMonitor: Potential culprit for http://b/399299587 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Change-Id: Id7717258b960ac18a27575fdc2b0852b42ef4e7b
Liana Kazanova (xWF)authored and Gerrit Code Reviewcommited 2025-02-26 12:20:26 -08:00
Use the shell to open the output file instead of FileOutputStream. This
allows test to use ConnectivityDiagnosticsCollector even if they do not
have storage permissions.
getOutputStreamViaShell is a method of the base class
BaseMetricListener.
Bug: 317602748
Test: atest
Change-Id: I127bb6711d14fdee059a31a8a3cfddc44b1d7800
Allow adding output from any shell command to the test diagnostics file,
instead of just dumpsys.
This introduces a new ShellUtil that can also help run more complex
commands, with pipes and redirects or as root for example.
Bug: 317602748
Test: atest with tests using this util
Change-Id: I0a0b5c7be5afd9e592dd820bfdbcee39ade418f8
Make Parameterized compatible with SetFeatureFlagsRule. If both
are used, the method names seen by SetFeatureFlagsRule may
be followed by [\d+] in Parameterized style, leading to a method
not found exception in SetFeatureFlagsRule. With this patch, both
can be used at the same time.
Test: add a Parameterized rule to CaptivePortalLoginActivityTest
see how it fails with MethodNotFoundError without this patch
see how it works as expected with this patch
Change-Id: I3fe1e63600dd792bc290ed130b8598b49f2b95e1
Currently, upstream network validation is always required, even
for type None. This is unnecessary for APF and mDNS tests, as
they can be executed on local networks. Additionally, some
devices lack the ability to perform network validation when the
hotspot is enabled due to hardware limitations. Therefore, remove
the validation check for upstream type None.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Bug: 335368434
Bug: 396551848
Change-Id: If2a96cf9d62e37fc27be6193f9ce9b9cfc8613df
Junyu Laiauthored and Paul Hucommited 2025-02-17 21:22:19 -08:00
TetheringManagerTest#testRequestLatestEntitlementResult in particular
set carrier config overrides without waiting for the override to be
applied, which caused flakes.
Wait for the override to be applied when adding and clearing them.
This makes the logic to wait for the update in NetworkAgentTest
unnecessary.
Bug: 391966043
Test: atest
Change-Id: I371ff5742627ca0b1b6eb6be5f0fd19a0487ae83
Some tests use CarrierConfigManager#overrideConfig(subId, bundle) to set
some configs, and then overrideConfig(subId, null) to reset the
override. However this also resets overrides that may have been set by
the instrumentation, such as ConnectivityTestTargetPreparer /
CarrierConfigSetupTest.
Avoid this by providing a common utility to set and tear down carrier
config, which reset the overrides to the original setting value instead
of clearing all overrides.
Test: atest
Bug: 253698734
Change-Id: Ia25b28d551b62205c52f91e0ffad1b94710c0828
This change adds missing dependancies of CtsNetTestCases to the automotive-general-tests zip
Change-Id: Iba2da89b380214ad785d504a484b0b72b508814d
BUG: 382649664
Flag: TEST_ONLY
Filip Zakrzewskicommited 2025-01-16 15:25:33 -08:00
IWLAN on U 24Q2 release may cause this test to fail, but this was
supposed to be addresed by CarrierConfigSetupTest already.
Add diagnostics on failure to figure out if the IWLAN config is as
expected.
Test: atest
Bug: 253698734
Change-Id: Iddc8975bb473979f9c2769cd178ef75644b82aa7
Instead of only waiting for an IPv6 address, wait for global IPv6
addresses to be routable.
This mirrors the check used for AI_ADDRCONFIG in DnsResolver. Without
this, the later call to network.getAllByName may only return IPv4
addresses if IPv6 global addresses are not reachable.
Test: atest
Change-Id: I2cedd58431eb8abeb5ffd9fb8daedb061586373b
Since the requestId is generated by CS, the only way to get a hold of it
is by intercepting the onNetworkNeeded() callback.
Test: TH
Change-Id: I8d66d287633151f9cfe7053c2b934121d2c96dbc
Some tests may disable wifi when testing, for example,
tests which setup cellular default network.
Reconnect to wifi to prevent from flaky.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Bug: N/A
Change-Id: Ic0e27efc0e82698618c651c0a78b000c0ffe2131
Instead of using recursive search in test directories to find
ConnectivityTestPreparer.apk, only search for it in the dependencies of
net-tests-utils-host-common.
The default strategy for finding test files is to do a recursive search
in test directories, which may find wrong files in wrong directories.
In particular, if some MTS test includes the checker APK, and that test
is linked to a module that boards the train at a version different from
this target preparer, there could be a version difference between the
APK and the host-side preparer.
Follow-up changes will remove ConnectivityTestPreparer.apk from the
dependencies of each test case so it does not appear multiple times in
test suites like android-mts.zip, but this change makes the process
more deterministic.
Test: mts-tradefed run mts-dev -m CtsTetheringTest
Bug: 377716515
Change-Id: I3b00ef9a0bd1d29e8734f44413be4ff16879c574
Add support for dumping tcpdump on test failure into the conndiag
artifact, and apply it to testUidTagStateDetails.
testUidTagStateDetails has recently been flaking due to unidentified
extra traffic, and this may help identify that traffic. Having an easy
way to collect tcpdump on test failure should help diagnose flakes going
forward as well.
Bug: 345322466
Test: atest
Change-Id: Ib2881be3df82b3b31b3a524987f775fa03279f63