Commit graph android_packages_modules_Co.../staticlibs
Message SHA1
Address aosp/3541181 leftover comments
Test: atest TetheringTests CtsTetheringTest
Change-Id: Iee9c1eec33403c95e29656b3dfb1bfefea81108e

Paul Hu   commited 2025-03-25 10:02:37 +00:00
3f81aec099
Merge "Make sure tests know to handle both early creation true and false" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 05:02:06 -07:00
a0fa137d85
Merge changes I7fae1964,Ic7cc9e1d into main
* changes:
  Add carrier-privileged app bypass for start/stopTethering
  Fix CarrierConfigRule#setHoldCarrierPrivilege race

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 03:47:22 -07:00
d5743b9795
Make sure tests know to handle both early creation true and false
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

Chalard Jean   commited 2025-03-21 19:29:06 +09:00
0cc8d81cc7
Fix CarrierConfigRule#setHoldCarrierPrivilege race
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 Luong   commited 2025-03-21 18:13:37 +09:00
d3058d5ffe
Merge "Use scapy to generate ARP packet in multi-device test" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2025-03-20 16:58:58 -07:00
4703e17d98
Merge "Revert "Skip multi-device tests instead of abort if device is non-B+ devices"" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-20 06:11:49 -07:00
23cfd04e9b
Use scapy to generate ARP packet in multi-device test
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I30adfe7ca2fef83ed4ef2ea3e5bc2291b9016530

Jimi Chen   commited 2025-03-20 12:25:57 +00:00
f0343a65d1
Revert "Skip multi-device tests instead of abort if device is non-B+ devices"
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

Jimi Chen   commited 2025-03-20 04:33:43 -07:00
a27bbe9eea
Delay test for APF activation after screen-off
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

Jimi Chen   commited 2025-03-20 00:41:07 -07:00
d9b49c6938
Merge "Skip multi-device tests instead of abort if device is non-B+ devices" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2025-03-19 23:56:23 -07:00
c049f61372
Merge "Add apf_ram_at_least decorator to restrict multi-device tests to the given minimum apf ram size capable device." into main
Jimi Chen   authored and   Gerrit Code Review   commited 2025-03-19 23:56:15 -07:00
681b11eeac
Merge "Add get exclude all host IPv6 multicast addresses function to apf_utils" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2025-03-19 23:56:06 -07:00
b3add265bc
Merge "Don't crash the system server when a misconfigured agent adds a DSCP policy" into main
Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2025-03-19 11:04:57 -07:00
51ac9ff7c4
Don't crash the system server when a misconfigured agent adds a DSCP policy
Additionally, when calling isEthernet(null), throw NPE instead of
SIGSEGV.

Test: New test in this patch
Change-Id: Ie80b860d4befe65a1777d0ebeb18d1807c6375d0

Chalard Jean   authored and   Patrick Rohr   commited 2025-03-19 08:24:45 -07:00
fd3ab6b212
Skip multi-device tests instead of abort if device is non-B+ devices
Test: TH
Change-Id: Ib27dea9197d5230313944777abb958f68425b213

Jimi Chen   commited 2025-03-19 14:38:06 +00:00
372a15220a
Add apf_ram_at_least decorator to restrict multi-device tests to the given minimum apf ram size capable device.
Test: TH
Change-Id: I1042fd0662695e9bc71833eb24311f4436b2676c

Jimi Chen   commited 2025-03-19 14:35:15 +00:00
8f712c6ed9
Add get exclude all host IPv6 multicast addresses function to apf_utils
Test: atest NetworkStaticLibHostPythonTests
Change-Id: Ib05eaf6ac94e9511a43b4b494eb5935746f50aa7

Jimi Chen   commited 2025-03-19 13:41:41 +00:00
ceefdceafd
Merge "Force TETHER_ENABLE_SYNC_SM to be enabled by default on 25Q2+" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-18 23:56:52 -07:00
811db343cd
Remove the queue on the NetworkAgent side
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

Chalard Jean   commited 2025-03-18 19:23:57 +09:00
391ec5d99c
Merge "Collect diagnostics without storage permission" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2025-03-18 02:05:21 -07:00
899737e0e0
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
Force TETHER_ENABLE_SYNC_SM to be enabled by default on 25Q2+
Test: atest TetheringTests CtsTetheringTest
Change-Id: Id63b4535aaebe90d5fa663ad4584cfd987c3b06b

Paul Hu   commited 2025-03-13 08:44:37 +00:00
133d806627
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