- Add comments clarifying the use cases of
net-utils-framework-connectivity and net-utils-service-connectivity
- Apply stricter visibility for the staticlibs
Bug: 357803496
Test: CI
Change-Id: I0d13b436976c3194c0fe350a905a8edf3e4df73a
`net-utils-connectivity-apks` has the dependency on
`net-utils-non-bootclasspath-aidl`, to make sure the CaptivePortalLogin
apk module still can use `net-utils-connectivity-apks`, expand the
`net-utils-non-bootclasspath-aidl` to support apk module in platform.
Bug: 329361366
Test: TH
Change-Id: I6d2f723fdc28037ed40072565d93b4307d7f5a45
"Shrinked" should actually be "shrunk" or "shrunken"; in any case
"minimized" is simpler and possibly more accurate (it's the minimum size
required to hold the values).
Test: atest
Change-Id: If787d3f3d6e1046338d4e89ed924bce183e74bd6
To avoid filling the binder buffers, and sending unnecessary callbacks
when apps are unfrozen (for example successive LinkProperties changes or
onAvailable+onLost are not useful), queue and aggregate callbacks for
apps that are suspended.
Test: atest
Bug: 327038794
Bug: 279392981
Change-Id: I6de357ac2834f1f7e960dfbaa63adfc3825f2a82
CaptivePortalLogin module also require the static lib
net-utils-tethering, rename it to net-utils-connectivity-apks for more
usage scope.
Bug: 329361366
Test: TH
Change-Id: Id68255fec9b1586f445bbd7bf290df3403e4ca11
This is a no-op refactoring, which is preparation for follow-up
changes to add more apf tests.
This includes:
1. Add a method to send packet and expect counter increases.
2. Inline the packet construction code in the test method.
Test: atest NetworkStaticLibHostPythonTests
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases
Bug: 350880989
Change-Id: Iadcfd97740033306af1b6a474004cbf0699ddd1b
This is a no-op refactoring, which is preparation for follow-up
changes to add more apf test classes.
This includes:
1. Move initialization code to a base class, which setup a hotspot
and a client connects to it, and enable doze mode to
activate the apf.
2. Check whether send raw packet is supported before testing.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases
Test: atest NetworkStaticLibHostPythonTests
Bug: 350880989
Change-Id: I6376935883653182728e473e2f5533407d993d7b
This is a no-op refactoring, which is preparation for follow-up
changes to add more apfv4 tests.
This includes:
1. Add a entry point for multi-device tests to collect
test cases from different files.
2. Move multi-device initialization code to a base class.
3. Make different test classes inherit the base class.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases
Bug: 350880989
Change-Id: I294c85d8e09633bbf02ba1543b9f2ea3e988e20d
* changes:
Use AutoCloseTestInterfaceRule in NsdManagerDownstreamTetheringTest
Add auto close rule for test interfaces
Add finalizer to check whether destroy was called
Wrap use of test interface in EthernetTestInterface
Add a class to properly manage ethernet test interfaces
Patrick Rohrauthored and Gerrit Code Reviewcommited 2024-07-31 20:36:45 +00:00
DefaultNetworkRestoreMonitor sometimes fails since the CapabilitiesChanged callback is not called within the timeout.
This CL fixes the issue by increasing the timeout.
Bug: 356132243
Test: TH
Change-Id: Id36d9166538070933fd62a03c6dd18bc84053bd8
This allows subclasses to override the destructor and perform additional cleanup.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic962202ad7406759dacd7371b87ef92f0249ab84
Maciej Żenczykowskicommited 2024-07-24 19:17:54 +00:00
Currently there's no mechanism to subscribe to changes in a BpfRingbuf,
and the existing wait() method can only block on a single bpf
ringbuffer.
Hence, add methods to interface with epoll_ctl() system call.
Also in code review of previous patchsets it came to light
that the constructor is needlessly 'private', thus change it
to 'protected' so that it can be subclassed.
Bug: 350094404
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4d9b841f5e984c42acab629a723e69920c00b356
Isak Evaldssonauthored and Maciej Żenczykowskicommited 2024-07-24 07:31:05 +00:00
This rule proxies calls to TestNetworkManager, keeps track of all
interfaces created by it, and closes them after running the test.
Test: builds
Change-Id: I01810b54929fea6e9c929a49bbf5e5268c6793af
3 seconds were too short to wait the network validation.
This CL also updates error message to include more information that
helps investigation.
Test: TH
Bug: 354475907
Bug: 354475880
Bug: 354104252
Change-Id: I513a5bd8af44df47f18773f8fa49323986757e0d
Updated methods in DnsUtils to convert DNS labels to uppercase instead
of lowercase to ensure compatibility with APF requirements.
Test: TH
Change-Id: I4b585f875b29b9e508d9a5eb73a073587510faab
Moved common DNS label comparison functions from MdnsUtils.java to
DnsUtils.java within the staticlib to facilitate reuse by both
Connectivity and NetworkStack modules.
Test: TH
Change-Id: Ie839c5621d2c4b74e41987a0c6d1141d0d6e24f8
Some tests reconnect wifi and don't wait wifi is validated.
So default network is changed while later tests are running.
This CL adds RestoreDefaultNetwork annotation to monitor default network
changes and wait to default network is restored to previous state.
If the default network is not restored within timeout, test fails.
Bug: 328870515
Test: atest MultinetworkApiTest NetworkAgentTest
Change-Id: I01e858109ac274ff60769bd558b91654298290ff
The class will be used to build memory-efficient objects (int arrays)
used to queue ConnectivityService callbacks while an app is frozen.
This is very similar to an ArrayList<Pair<Short, Short>>, but avoids
object boxing which would use a lot more memory.
This is intended to be used by ConnectivityService both as a builder,
and as a utility to read lists of callbacks that it stores. Long-lived
references to the CallbackQueue would not be kept to minimize memory
usage; only the array returned by toArray needs to be stored.
Test: atest
Bug: 327038794
Bug: 279392981
Change-Id: I187ea15d14dfd160e577e9e9e87b1aded27b1938
The mDNS test should be conducted with an SDK version higher
than Android T (align with NsdManagerTest CTS, as NsdManager is
only updatable on T+). Add an SDK version precondition check to
ensure both devices are available for testing.
Bug: 343311941
Test: atest CtsConnectivityMultiDevicesTestCases
Change-Id: Id5505b5d0746515689dc1646116a16fcfb8ece64
On Android R, IpServer uses netd to set up tethering while on S+ it uses
RoutingCoordinator.
This CL lets Tethering own a RoutingCoordinatorService when the SDK
version <= R so IpServer can always use RoutingCoordinator instead of
netd.
Bug: 350699020
Test: CI
Change-Id: I0ed33fb050260c26be87079bed0e189716cd8782
This utility reads output of cmd network_stack apf ${iface_name}
capabilities. This is needed for the tests to skip if the apf
version is too old.
Test: atest NetworkStaticLibHostPythonTests
Bug: 352132428
Change-Id: I1f8b523c3e6f687c2e919993bc18392dc25dbbf7
net-utils-services-common used to include modules-utils-build as a
static lib, but this has the issues of forcing lib depending on it to
also have the modules-utils-build.
When trying to add this lib to a framework library within the same apex,
it fail the StrictJavaPackagesTest.
By moving the responsibilities to link it to the caller we no longer
have the initial issue
Bug: 343121936
Test: Build target using net-utils-services-common
Test: atest StrictJavaPackagesTest
Flag: Exempt simple dependency fix
Change-Id: I96137c177e9c38d39243eedd1729e7626b4cdcdf
William Escandecommited 2024-07-10 14:26:50 -07:00
Without lock, it's not guaranteed that the methods see values
populated by the constructor
Bug: 349952743
Test: TH
Change-Id: I5c98766a22047f49ad3338bfe620d3b8f4ef477e
This is not used outside core networking modules and because it's not
jarjar'd, is not safe to use outside core networking modules anyway.
Change-Id: I1d8dfb0191b94e64ba3e7062f3a547348d9b0403
Test: TH
Lorenzo Colitticommited 2024-07-05 08:34:37 +00:00
- This CL puts RoutingCoordinator into staticlibs to make it usable by
both Tethering and ConnectivityService on R.
- This CL also changes the return type of
ConnectivityInternalApi#getRoutingCoordinatorManager() to IBinder so
it has fewer dependencies.
Bug: 350699020
Test: CI
Change-Id: Iba096e940795cd33e61c5141721394ad39e5ce6d
This CL introduces net-utils-framework-connectivity, net-utils-tethering
and net-utils-service-connectivity as staticlibs.
- net-utils-framework-connectivity will be used by
framework-connectivity-pre-jarjar.
- net-utils-service-connectivity and net-utils-tethering are the
static liraries used by service-connectivity-pre-jarjar and Tethering
respectively.
Bug: 350699020
Test: CI
Change-Id: I4dbb2b0de905a576cfcf24d2d5d1f1a261d2bd68
For tests that register multiple callbacks, like ConnectivityService
tests, this can make it easier to figure out which callback is getting
called in logs.
Test: atest CtsNetTestCases (tests using this callback)
Bug: 327038794
Bug: 279392981
Change-Id: Ifea5a8180f9667feaadf94c8b927469bafe29590
This is now derived from the passed packet data by
NetworkStack.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: Ida06c00e6f499b782cb903c9fa0a4154c2d8cf84