In the future, we could consider adding an ICMPv6 base class that
implements common functionality between NaPkt and RaPkt. However, given
that checksumming is not currently supported, the common functionality
is limited to only a couple of lines.
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Id45f2ed43f45778e80b303bd356babcc93de1c3f
This change introduces a set of generic packet builder utility classes
that can be used in tests. The API surface aims to be similar to scapy
with a focus on ease of use.
Test: TH
Flag: EXEMPT mainline
Bug: 1
Change-Id: I9c751cece7bbad6bc38953cb52e9ab42393bab89
executeShellCommandRwe is U+. Use executeShellCommandRw which is S+
instead, and annotate methods accordingly. stderr is not used in any
instrumentation at the moment.
Bug: 405109522
Test: atest
Change-Id: I8212cb340cfb7e5ee5d0da314613b474e4f155fc
This is necessary to pass tests whatever the values of the features are.
NetworkAgentTest was updated assuming the feature was true, so
this patch revives the old code for when it's false.
TestableNetworkAgent reads the feature directly from
ConnectivityManager when it's not mocked.
Test: CtsNetTestCases
Change-Id: Ia556fbb1d1b6a38a4995b021981e2693d778bfff
CarrierConfigRule#setHoldCarrierPrivilege will try to acquire/drop the
carrier privilege, but does not wait for the result of the operation. If
a test immediately calls an API that requires carrier privilege before
the operation completes, then it will fail.
Fix this by waiting for the operation to succeed before returning.
Bug: 295979433
Test: presubmit
Change-Id: Ic7cc9e1dbc206fbc0c3b79058b5782d93e89f1d7
Quang Anh Luongcommited 2025-03-21 18:13:37 +09:00
This reverts commit 372a15220a.
Reason for revert: this is Android B+ CTS and shouldn't be run with previous release, this can help to catch human error.
Change-Id: I867c63511d4f640e07b8317506291de284efcef3
CTS tests screen-on device in the beginning, but APF is not activated after screen-off in the test setup.
This change adds 3 secs delay to ensure APF activation before test execution.
Bug: 402667362
Test: ./cts-tradefed run cts-on-gsi -m CtsConnectivityMultiDevicesTestCases -t ApfV4Test --shard-count 2
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV4Test
Change-Id: I067ce792b5f89e2f0051933982ebc734607fbf98
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