Similarly to NetworkMonitorTest, terminate NetworkMonitor threads and
ExecutorServices after each test case in integration tests.
This should fix flakes where the HTTP probe from testValidation could
finish after mock probe responses are cleared in tearDown.
The utils used in NetworkMonitorTest are factored out to ConcurrentUtils
to achieve that.
Fixes: 292481238
Test: atest --rerun-until-failure 50
Change-Id: I5cdeee8d4f06ea40e338dd2cb1fdcc2fe0907a7d
Refactor the test case to support listen custom DNS/HTTP port.
Avoid binding system restricted port (<1024).
Bug: 322113686
Test: atest NetworkStackIntegrationTests:android.net.NetworkStatsIntegrationTest
Change-Id: I5d3b966cdadc9321ca2ee0d04a5b8f71ee79bd8a
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.
For more details please refer to the link below,
<add g3 doc link>
Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Memory leak was observed and inline mock is one of the reasons.
This CL updates DevSdkIgnoreRunner to clear mock state if there is no
thread leak.
Test: TH
Bug: 321603955
Change-Id: I50fd03f14c6703bd38b5729f577d7ea516cd5b44
This test is conducting two physical devices: a device
acting as the hotspot and a separate client device. The test
assesses whether the client can connect to the hotspot and utilize
its internet connection.
This test verifies the basic functionality of the hotspot feature
by exercising the entire system without mocking any component.
This is crucial because various system components, like cellular,
Wi-Fi, routing rules, tethering, and hardware offload, can have
regressions or design changes that impact the basic functionality.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases
(2 physical devices near each other are needed
to perform this test)
Bug: N/A
Change-Id: Ib97495c48f313889cedae03d59762482da10cfd8
Instead of (wrongly) looking at the DNS message flags for the Query
Unicast bit, look at the flag in the question record.
The previous bug means that all queries would be replied multicast
instead of sometimes unicast. The fix is flagged off as this is a
behavior change that may affect performance and latency.
Bug: 289482497
Test: atest
Change-Id: I08e30c4ffa747c9073d631e8addca1278ea40648
Consider below scenario:
Internal address: 1.2.3.4
External address: 5.6.7.8
Remote address: 8.8.8.8
When a packet was sent from 1.2.3.4 to 8.8.8.8, the current design
translate it to a packet from 8.8.8.8 to 5.6.7.8 and foward it
to the external interface. However, when the response is received
from the external interface, there is a need to remember what is
the original address to forward to. Thus, an address translation
mechanism was introduced in current design.
This change simplify PacketForwarder by removing the address
translation.
Consider, if the 2 interfaces are using the same address.
Internal address: 1.2.3.4
External address: 1.2.3.4
Remote address: 8.8.8.8
When a packet was sent from 1.2.3.4 to 8.8.8.8, simply swap
source and destination and and foward it to the external
interface. When there is a response from the external interface,
the same process can be done, this removes the need of address
translation.
Test: atest NetworkStackIntegrationTests:android.net.NetworkStatsIntegrationTest
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideVpnTests
Bug: N/A
Change-Id: I86f2e774e9112905e5255b5a28c927562a42ab84
This change only outputs thread count differences instead of
listing all threads. Additionally, it ignores threads with 1
count, which effectively filter out threads created
by the test runner or other system components, such as
hwuiTask*, queued-work-looper, SurfaceSyncGroupTimer,
RenderThread, and Time-limited test.
Sample Output:
[1122/3060] android.net.connectivity.com.android.server.CSLocalAgentCreationTests#ThreadLeakMonitor: FAILED (1ms)
STACKTRACE:
java.lang.IllegalStateException: Unexpected thread changes: removed=[] added=[] updated=[TestAlarmManager=25,CSTestHandler=25]
Test: atest ConnectivityCoverageTests
(with shouldThreadLeakFailTest set to true)
Bug: 310581973
Bug: 307693729
Change-Id: I085799ebbd69c29f833335684de208105302e012
A helper class to *read* java BpfMaps. This is designed to
provide direct bpf access in the caller process through
ConnectivityManager APIs.
The change also removes any statical link to
net-utils-device-common-struct from service-connectivity.
This is because net-utils-device-common-struct is already
included in framework-connectivity. Including it again in
service-connectivity would create a r8 build fail by circular
dependency.
Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.StructTest
Test: atest FrameworksNetTests:android.net.connectivity.android.net.BpfNetMapsReaderTest
Bug: 297836825
Change-Id: I7a6d2eb816d0dc7343167bddd672806b199f44fe
Mainline no longer supports Q.
These files were recently moved into p/m/C as part of a refactor.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0f06ace921db6c79d63c0048bdb73d167ff606cf
Maciej Żenczykowskicommited 2023-09-19 23:22:58 +00:00
Tests are sometimes run on hardware devices with wrongly configured wifi
or cell data. Ensure that this is reported as an infra error, and not a
test error, so the root cause is easier to identify.
Bug: 264170054
Test: atest
Change-Id: I4f964fbd4ee497e8ac92f7729375b75b6c4594a3
eventuallyExpect methods should print the received callbacks since
poll() was called for better debugging.
Test: atest EthernetManagerTest
Change-Id: Ia08abf2436b050a7e319b9f70694ce3d132b4fc3
UnboundedSdkLevel stopped working on Q as it now depends on Set.of,
which is an R+ API. Arguably this should be fixed as its minSdk is still
29, but long-term UnboundedSdkLevel may drop Q support as modules now
only need to support R+.
Avoid using UnboundedSdkLevel on Q- in DevSdkIgnoreRule: this avoids the
above problem, and also makes it compatible with even older builds,
which may happen in GTS.
Bug: 292868272
Test: all tests using this rule
Change-Id: I5e1559d841398a6c6763283f32c9f766a3661e21
This change adds a backtrace() method which returns a list of events
that were received since the last time a user called poll() on a
ReadHead. This is particularly useful for logging observed events while
a poll was in progress that did not end up matching an event.
Test: atest EthernetManagerTest
Change-Id: If019cf9eb5e3e9268c5e6b74edbd8f49959cc71c
Fix kotlin nullable errors that were exposed by setting the retention
of android.annotation.NonNull and android.annotation.Nullable to
class retention.
Bug: 294110802
Test: builds
Change-Id: I2a2c91188b64619fca190a9bd7812d32f9610abd
On devices that do not have always active mobile data, it needs
to be requested for onAvailable to be called.
Change-Id: Ic814684bcd06389c013a6e6636487d9b47627901
Test: TH
This will typically be used in mainline-presubmit TEST_MAPPING
configuration to exclude some tests.
This is necessary as some tests are flaky in mainline configurations
(when running on older devices), and they need to be disabled to meet
SLO requirements, but they are not flaky on presubmit using the latest
platform builds.
Test: m
Change-Id: Ia532d6d3f9833ddec613d79c0eb517d20a1c529a
This annotation can be used to mark a test case that requires
the latest resolv module. Tests that don't run with the latest
resolv module (for example CtsNetTestCasesLatestSdk) can exclude
the testcases being flaky due to some known issues in old resolv
module.
Bug: 279846955
Test: TreeHugger
Change-Id: Ie19eed1c4aa17645c4eec45493e7999027a01205
This annotation can be used to exclude the testcases which requires the
latest NetworkStack module in the CTS/MTS suite.
Bug: 283200648
Test: atest CtsTetheringTestLatestSdk
Change-Id: Idaffed93af077c2998081142af7b3bfa311dcd90
The exception is thrown in some normal cases e.g. interrupt()
called when Os.read is blocked and waiting for the input.
Ignore such events.
Test: 1. atest NetworkStackCoverageMtsConfigTests on S device
2. atest com.android.cts.net.HostsideVpnTests
3. atest NetworkStatsIntegrationTest
Bug: 259632210
Change-Id: Ibff41312d9c7431c2b19f780844ab3a81b48f9e8