Commit graph android_packages_modules_Co.../staticlibs
Message SHA1
Merge "Fix missing function in NetworkStaticLibHostPythonTests" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-18 01:47:31 -07:00
d492666256
Merge changes from topic "vpn-type-oem-enterprise" into main
* changes:
  Treat new OEM VPN types like the corresponding non-OEM types.
  Add more NativeVpnType AIDL constants for OEM-specific VPNs.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2025-03-18 00:50:13 -07:00
944a1d2855
Fix missing function in NetworkStaticLibHostPythonTests
This change corrects a missing function error, which was renamed in aosp/3545962.

Test: atest NetworkStaticLibHostPythonTests
Change-Id: I2f51702adfa48f2207ef4dd79f641c8f57d15ac7

Jimi Chen   commited 2025-03-17 23:56:23 -07:00
e6c9b28c2b
Merge "Add carrier privilege utils to CarrierConfigRule" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-17 23:35:22 -07:00
ab6342b70e
Add more NativeVpnType AIDL constants for OEM-specific VPNs.
Test: m
Bug: 389829981
Change-Id: If39e012dcf6388f2d4e7f8d2eebf01410e3f1543

Lorenzo Colitti   commited 2025-03-18 13:13:31 +09:00
d731b8136e
Add carrier privilege utils to CarrierConfigRule
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 Luong   commited 2025-03-18 13:05:01 +09:00
a620310e9c
Use non-tentative IPv6 addresses in multi-device test
This update ensures multi-device offload tests retrieve only non-tentative IPv6 addresses,
preventing test caused by tentative addresses undergoing duplicate address detection.

Test: atest NetworkStaticLibHostPythonTests
Change-Id: Id2f61a34eda01a6e8e0457647229fe438a85c232

Jimi Chen   commited 2025-03-17 06:31:46 +00:00
2bfe2654d1
Merge changes I0b3ac7b4,I90385146 into main
* changes:
  Add Abstract Class for RealtimeScheduler
  Implement RealtimeScheduler in DiscoveryExecutor

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-16 09:27:17 -07:00
7d1b5b56ce
Add Abstract Class for RealtimeScheduler
Because some APIs in RealtimeScheduler are higher than the min
SDK version for the standalone MDNS build, an abstract class is
required to allow the standalone MDNS build to pass.

Bug: 366373064
Test: atest FrameworksNetTests NsdManagerTest
      m service-connectivity-mdns-standalone-build-test
Change-Id: I0b3ac7b4f8dfceeb3dd81e6a5f368b5d57927c41

Paul Hu   commited 2025-03-16 14:46:14 +00:00
b84bb3b448
Merge "Use NLM_F_REQUEST_ACK in createGetLinkMessage()" into main
Chuwei He   authored and   Gerrit Code Review   commited 2025-03-13 17:43:25 -07:00
9981725b18
Merge "Add at_least_B() decorator to restrict multi-device tests to Android B+ capable device." into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-13 12:01:33 -07:00
d5dd81741c
Add at_least_B() decorator to restrict multi-device tests to Android B+ capable device.
Test: TH
Change-Id: Id5fde8c59560bb84bed062331121c3524f362c7b

Jimi Chen   commited 2025-03-13 14:05:09 +00:00
476552a7ae
Use NLM_F_REQUEST_ACK in createGetLinkMessage()
This rtnl message is used with sendOneShotKernelMessage() which expects
that kernel returns an ACK. We need to set NLM_F_ACK explicitly for
that.

Bug: 379021505
Test: Manually run and no more exception with EAGAIN.
Change-Id: Iba21fedf60f5eca63eceee9362e252952bb805c1

Chuwei He   commited 2025-03-12 18:30:04 -07:00
03a10fd14d
Merge "Invoke tcpdump with -l" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2025-03-12 02:18:14 -07:00
ca91ebdcab
Merge "Use non-extended mockito for net-tests-utils" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2025-03-11 19:00:20 -07:00
ec2a5cc5c5
Invoke tcpdump with -l
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

Junyu Lai   commited 2025-03-10 23:41:50 -07:00
2685014bf7
Use non-extended mockito for net-tests-utils
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

Remi NGUYEN VAN   commited 2025-03-10 17:59:19 +09:00
05c376a4c5
Merge changes I6d0e5d34,I55af0796 into main
* changes:
  Inline tetherInterface and untetherInterface
  Separate route modification and update linkproperties

Junyu Lai   authored and   Gerrit Code Review   commited 2025-03-06 22:43:51 -08:00
75551afe7a
Merge "Stop using Mockito static mocking in BpfDumpTest" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2025-03-06 19:50:26 -08:00
1d1cc3a36d
Inline tetherInterface and untetherInterface
This is a no-op refactoring which inline the functionalities
to IpServer, enabling subsequent changes to move
networkAddInterface part to ConnectivityService when the
tethering is enabled.

Test: atest TetheringTests:android.net.ip.IpServerTest
      atest NetdStaticLibTests:com.android.net.module.util.NetdUtilsTest
Bug: 349487600

Change-Id: I6d0e5d349691df7a15bee852d5fd1dd19f5da6f6

Junyu Lai   commited 2025-03-07 10:43:17 +08:00
eff5782b0a
Separate route modification and update linkproperties
This is a no-op, preparatory refactoring to isolate route
modification functionality, enabling subsequent changes to move
routing control to ConnectivityService.

Test: atest TetheringTests:android.net.ip.IpServerTest
      atest NetdStaticLibTests:com.android.net.module.util.NetdUtilsTest
Bug: 349487600
Change-Id: I55af07968567b173dd9f97795600390439f1b927

Junyu Lai   commited 2025-03-07 10:43:17 +08:00
d85d3c5e80
Merge "Use 'ip link' to prevent permission errors in non-root environments" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2025-03-06 16:31:21 -08:00
a7b9afbbfa
Use 'ip link' to prevent permission errors in non-root environments
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

Jimi Chen   commited 2025-03-07 00:25:34 +00:00
c471fc945c
Merge "Revert^2 "Use timerfd to improve the accuracy of query timing"" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-06 12:52:13 -08:00
c23d94f2cc
Revert^2 "Use timerfd to improve the accuracy of query timing"
This reverts commit a481dc184f.

Reason for revert: Update this change to ensure proper closure of the timerfd object.

Change-Id: I14530ba77a39c77b4c7af6855ec77ba4907ab9f9

Paul Hu   commited 2025-03-06 15:13:12 +00:00
a3a34058fe
Stop using Mockito static mocking in BpfDumpTest
Test: NetworkStaticLibTests
Bug: 399571370
Bug: 397721725
Change-Id: I0d183378b08261ff24485aff4ad636cdae1851c9

Motomu Utsumi   commited 2025-03-06 09:00:18 +09:00
d27097f585
Merge "Revert^2 "Allow collecting diagnostics from shell commands"" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-05 15:57:46 -08:00
d1713458a8
Revert^2 "Allow collecting diagnostics from shell commands"
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 VAN   authored and   Gerrit Code Review   commited 2025-03-04 02:54:50 -08:00
83af0f15dd
Merge "Enable TETHER_FORCE_RANDOM_PREFIX_BASE_SELECTION by default on 25Q2+" into main
Patrick Rohr   authored and   Gerrit Code Review   commited 2025-03-03 08:45:58 -08:00
dd9451b465
Enable TETHER_FORCE_RANDOM_PREFIX_BASE_SELECTION by default on 25Q2+
Since the feature was fully rolled out via experiment without
regression, this commit removes the flag and the corresponding
logic in PrivateAddressCoordinator. The flag is no longer
necessary and simplifies the code.

Test: atest ConnectivityCoverageTests:PrivateAddressCoordinatorTest
Fix: 312647670
Change-Id: I8781f98b7e99ed0856e9e04112056df5adca2527

Junyu Lai   commited 2025-03-03 16:55:03 +08:00
44f2eb6e42
Enable Bluetooth before running testReserveL2capNetwork
Bug: 397740298
Test: TH
Change-Id: If35a4b83ab8f96d0c98b3bf2ecb8b0e68420c4fe

Patrick Rohr   commited 2025-02-26 13:50:06 -08:00
d1cca845e2
Revert "Allow collecting diagnostics from shell commands"
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 Review   commited 2025-02-26 12:20:26 -08:00
3eec0163fc
Allow collecting diagnostics from shell commands
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

Remi NGUYEN VAN   commited 2025-02-26 11:39:51 +09:00
47b6619fa8
Reverse pollingCheck arguments to be more kotlin friendly
Test: TH
Change-Id: Ibe52ccd9eec619ced5f8b84896d2a1efc6c0fefc

Patrick Rohr   commited 2025-02-25 15:30:52 -08:00
7f9469e808
Move pollingCheck to testutils
Test: TH
Change-Id: I7d9362dcda095f8037467baf3602911fc3a3c072

Patrick Rohr   commited 2025-02-25 15:30:51 -08:00
b4809fdd08
Add method to destroy UDP socket
Upcoming CL adds feature to close quic connection which requires to
close UDP socket.

Bug: 311792075
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I63b7eb9c31cca9d00297a7a67c0cb18d0aa97a59

Motomu Utsumi   commited 2025-02-25 13:23:38 +09:00
7197820b15
Move SkDestroyListener to under staticlibs
Upcoming CL use SkDestroyListener from ConnectivityService

Bug: 311792075
Test: atest FrameworksNetTests
Change-Id: I96dec7e13aaa574b90e7caf3b559ee5172848e51

Motomu Utsumi   commited 2025-02-21 09:26:11 +09:00
1135975109
Merge "Support Paramerized in SetFeatureFlagsRule" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-02-20 00:10:15 -08:00
154cfdc40e
Support Paramerized in SetFeatureFlagsRule
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

Chalard Jean   commited 2025-02-20 15:46:39 +09:00
1c0939c365
Do not expect validated when connect to Wi-Fi for upstream type None
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 Lai   authored and   Paul Hu   commited 2025-02-17 21:22:19 -08:00
d16aa5538e
Populating local addresses to local_net_access_map
Whenever LinkProperties is added/modified/removes, we are updating local
network prefixes for the modified interface/addresses. These prefixes
are used by BPF egress and ingress cgroup hooks to disallow local
network packets if the calling application do not have required
permission.

Bug: 369815823
Test: Manually tested
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSLocalNetworkProtectionTest
Change-Id: Ie592ecb948ae05a0a73f47d0573560eb705f6bcf

Sarup Dalwani   commited 2025-02-17 20:34:41 +00:00
18b7262f60
Merge "Use netlink to set MTU in IpClient(1/2)" into main
Chuwei He   authored and   Gerrit Code Review   commited 2025-02-12 17:44:20 -08:00
4940e0b869
Use ErrnoException for handling exceptions in JNI functions
This commit updates the timerfd JNI function calls to use
ErrnoException instead of IOException to handle exceptions
correctly.

Bug: 393169546
Test: m
Change-Id: I56385a0e9f20c778eb2c2d2c4fe43cbf12753d93

Paul Hu   commited 2025-02-12 05:35:53 +00:00
57ab9bf806
Add constant for IPv6 node-local scope all nodes multicast address
Bug: 394689846
Test: TH
Change-Id: I0481fd56b70acbcf1dfe5c49fd083ff96c99e588

Jimi Chen   commited 2025-02-08 09:53:01 +00:00
76c7775121
TcUtils: allow ignoring netlink error code ENOENT
Ignore this error code during DEL operations.

It is returned when the specific thing to be deleted
is not found and is therefore a valid response.

Gets rid of 30+ logs worth of:
  E TcUtils : NLMSG_ERROR message return error: -2
during netd startup (cleanup phase).

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie542f8ff418dbed604eea5b31b87f9b974ccdbcb

Maciej Żenczykowski   commited 2025-02-06 12:56:09 -08:00
f31a45416c
Wait for carrier config to apply in tests
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

Remi NGUYEN VAN   commited 2025-02-05 15:42:54 +09:00
b9ac4c8fe2
Deprecating PERMISSION constants that are not used in aidl
PERMISSION_INTERNET, PERMISSION_UPDATE_DEVICE_STATS,
PERMISSION_UNINSTALLED and NO_PERMISSIONS are used only internally
and don't need to be maintained as part of the public interface.

Bug: b/326383676
Test: PermissionMonitorTest
Change-Id: If906382965c8593f9078278af37cb0bc2825117f

Melisa CZ   commited 2025-02-03 22:50:42 +00:00
0d08a89d86
Use NLM_F_REQUEST_ACK in createSetFlagsMessage()
This rtnl message is used with sendOneShotKernelMessage() which expects
that kernel returns an ACK. We need to set NLM_F_ACK explicitly for
that.

Bug: 390722214
Bug: 392491075
Test: Manually run the affected test, no more exception with EAGAIN.
Change-Id: I7ef9497461a8e89e9f7f7fe399562b2d8ede14a9

Jie Jiang   commited 2025-01-27 22:10:31 +09:00
b61913bbb6
Merge "Revert^2 "Fix flakes due to tests resetting CarrierConfig"" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2025-01-24 03:29:10 -08:00
0e2102069e
Revert^2 "Fix flakes due to tests resetting CarrierConfig"
This reverts commit 19a936d3ab.

Reason for revert: revert^2 to verify if this CL really break TH.

Change-Id: I8600883785881d857b7e79cf16459e33080fa82b

Yuyang Huang   authored and   Gerrit Code Review   commited 2025-01-23 18:56:11 -08:00
6f99275476