Commit graph

74,998 commits

Message SHA1
Stop the created handler threads
The created handler thread will stay there for a while until
all the tests are finished. This is considered as a leakage
which will take the resource from the devices. In low end
devices, this may possibly impact the performance. The created
threads should be closed explicitly.

Test: atest FrameworksNetTests
Change-Id: I332d55d8effdb975fd9a8953b19910a7fb25e426

chiachangwang   commited 2023-08-17 06:18:46 +00:00
8d336eb1a3
Merge "Restore presubmit of testSetOemNetworkPreferenceForTestOnlyPref" into main
Mark Chien   authored and   Gerrit Code Review   commited 2023-08-16 02:17:58 +00:00
eb4e92c45d
Merge "Add testMobileDataPreferredUids back to presubmut" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-08-16 01:26:54 +00:00
290530b591
Restore presubmit of testSetOemNetworkPreferenceForTestOnlyPref
Mark fixed this test in aosp/2709233

Bug: 295829521
Test: Dashboard will stop showing this failure
Change-Id: I439d4b65b2fc5981af924fb1f1155273bdd52e7a

Chalard Jean   commited 2023-08-15 18:17:51 +09:00
fa6ab01471
Add testMobileDataPreferredUids back to presubmut
The testMobileDataPreferredUids was disabled from presubmit
because of flaky test. It's no longer flaky now, so add the test
back to presubmit.

Fix: 292174275
Test: atest android.net.cts.ConnectivityManagerTest\
      #testMobileDataPreferredUids --iterations 1000
Change-Id: I191888069a00942aa4c82f62bd1d62b7fc70b4fa

Paul Hu   commited 2023-08-15 08:46:11 +00:00
504e488e51
Merge "Fix testSetOemNetworkPreferenceForTestOnlyPref flaky" into main
Mark Chien   authored and   Gerrit Code Review   commited 2023-08-15 08:20:15 +00:00
3a8ed26686
Merge "Ensure test network being torn down" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2023-08-15 07:21:41 +00:00
29d3ea96f3
Merge "Add connectivity pre-check for CtsNativeNetDnsTestCases" into main
Mike Yu   authored and   Gerrit Code Review   commited 2023-08-15 06:28:33 +00:00
ededcdcf88
Fix testSetOemNetworkPreferenceForTestOnlyPref flaky
There may be additional CapabilitiesChanged callbacks before
the test network is torn down. To verify ON_LOST, use
eventuallyExpect instead of expect.

Bug: 295829521
Test: atest ConnectivityManager#testSetOemNetworkPreferenceForTestOnlyPref
Change-Id: I24bb11bf2c2da08e5757c845beeb35b7004f25a4

Mark   commited 2023-08-15 05:53:28 +00:00
113e5a977a
Ensure test network being torn down
Ikev2VpnTest uses TestNetworkRunnable to start test networks
to perform VPN related tests. In some low performance devices,
such as cuttlefish, the request to disconnect test network
at the end of the previous test may not be executed completely
yet. It results in the disconnect-pending network being used
by the follow-up test and fail the test. To fix this, the utility
method should wait for onLost callback before performing next
test.

Bug: 293239828
Test: atest CtsNetTestCases:android.net.cts.Ikev2VpnTest \
      --rerun-until-failure 100
Change-Id: I6f3c4f45d3dbadc7e8783c05d6cf67f0896ffa95

chiachangwang   authored and   Chiachang Wang   commited 2023-08-15 05:21:29 +00:00
c9b03fa9ed
Merge "Import RFC7421_PREFIX_LENGTH from NetworkStackConstants." into main
Xiao Ma   authored and   Gerrit Code Review   commited 2023-08-15 02:24:26 +00:00
48ee6ad08f
Merge "Add remoteauth to API owners" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2023-08-15 01:55:11 +00:00
0a49f9619f
Add connectivity pre-check for CtsNativeNetDnsTestCases
This test is run by resolver MTS and it should pre-check device
connectivity before running. The reason why the test never or
seldom failed in the past is probably that it usually ran after
CtsNetTestCasesLatestSdk DnsResolverTest (which is also run by
resolver MTS) that already pre-checked the connectivity.

Bug: 291495329
Test: atest CtsNativeNetDnsTestCases
Change-Id: I20159029c7e68e9c21dcb6e7bbf221cda39117a5

Mike Yu   commited 2023-08-15 01:46:01 +00:00
784ff2fb9a
Import RFC7421_PREFIX_LENGTH from NetworkStackConstants.
RFC7421_PREFIX_LENGTH is being removed from NetworkConstants and import
it from NetworkStackConstants instead.

Bug: 290885904
Test: TH
Change-Id: I35e785be3f1a278c76b0810cad844710254b0f15

Xiao Ma   commited 2023-08-14 20:08:19 +09:00
c32e37f0b2
Add remoteauth to API owners
Similarly to Nearby, remoteauth is expected to regularly need to change
the API files.

Import the existing owners file for that purpose.

Test: m
Change-Id: I4b900481df3bf505a8209e5370dc4bc4c928dbee

Remi NGUYEN VAN   commited 2023-08-14 20:06:03 +09:00
a2009eaeec
Merge "Revert "Enable NewApi lint checks on service-connectivity"" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2023-08-14 06:11:06 +00:00
9597ea86f3
Revert "Enable NewApi lint checks on service-connectivity"
This reverts commit a1145a1fd3.

Reason for revert: fix build failure
Bug: 295779471

Change-Id: Id481aa628e1a1173b8b2c79006843025439b5901

Woody Lin   authored and   Gerrit Code Review   commited 2023-08-14 04:47:03 +00:00
7704e695bf
Merge "Enable NewApi lint checks on service-connectivity" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2023-08-14 02:46:28 +00:00
e250d24da1
Enable NewApi lint checks on service-connectivity
This should help find changes that do not do proper NewApi checks
in presubmit, and when building with RUN_ERROR_PRONE=true

Test: m
Change-Id: I87ce56d9df2eb27dafd2ec8d2c814c83098a979f

Remi NGUYEN VAN   commited 2023-08-14 02:45:42 +00:00
a1145a1fd3
Merge "Add tests for OffloadHardwareInterface" into main
KH Shi   authored and   Gerrit Code Review   commited 2023-08-14 02:13:23 +00:00
839cc0b455
eliminate unused tcp{Rx,Tx}Packets
(next step is to replace use of Stats struct with
 identical (except field order) StatsValue struct)

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

Maciej Żenczykowski   commited 2023-08-12 08:20:39 +00:00
15b63b308e
Merge "Revert "KNOWN BAD CHANGE - it should cause lint failures (but doesn't??)."" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-11 13:23:56 +00:00
9cc1d765ab
Merge "Import RFC7421_PREFIX_LENGTH from NetworkStackConstants." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-10 13:07:20 +00:00
b8ea09efd7
Merge "update bpf_existence_test to enforce minimum kver" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-10 13:04:47 +00:00
713cb071e0
Merge "bpf tethering offload - add src subnet to upstream ipv6 direction" into main
KH Shi   authored and   Gerrit Code Review   commited 2023-08-10 09:50:51 +00:00
d932cd828c
Merge "Fix flaky test: testNsdManager_registerOffloadEngine" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-10 09:35:33 +00:00
6f1da9b479
Merge "Fix NullPointerException on NsdService" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-08-10 09:03:41 +00:00
d45bf5499f
bpf tethering offload - add src subnet to upstream ipv6 direction
This patch is based on aosp/2535559 from maze@.

Add source prefix into the upstream key such that only packets which
source IPv6 address matches it will be forwarded to the upstream
interface.

In this patch, the source prefix is set to zero so there is no
behavior changes. Next CL in patch series will use the real source
prefixes retrieved from upstream interface.

Test: atest TetheringTests
Bug: 261923493
Change-Id: I43d068a29b937c7dfeb6fab632a8effb47ee2263

KH Shi   commited 2023-08-10 16:01:21 +08:00
c8fb1a2530
Fix flaky test: testNsdManager_registerOffloadEngine
Fix flaky test by only catch relevant the AddOrUpdateEvent and
RemoveEvent.

Bug: 294685851
Test: atest CtsNetTestCases
Change-Id: Ia12e51a6527f1e23610fdb0bea1068ebb5b80a73

Yuyang Huang   commited 2023-08-10 16:30:09 +09:00
40f958b90d
Add tests for OffloadHardwareInterface
NativeHandles shouldn't be closed in OffloadHardwareInterface after
passing them to initOffload() of AIDL service, because their owner
will be changed to ParcelFileDescriptor by libbinder.

Add test cases to verify that NativeHandles are closed correctly.
NativeHandles should be closed after initOffload if:
  - Init with HIDL HAL interface
  - Has null NativeHandle, any non-null NativeHandles should be closed

Bug: 277834236
Test: atest OffloadHardwareInterfaceTest
Change-Id: Icbe74da73d3bdc582d1816b314fdfce9661465fc

KH Shi   commited 2023-08-10 14:56:09 +08:00
f5390a9d8f
Merge "Fix bug for failing to init Offload AIDL HAL service" into main
KH Shi   authored and   Gerrit Code Review   commited 2023-08-10 06:37:58 +00:00
cf0cc72629
Fix NullPointerException on NsdService
The NsdService will throw a NPE if a new client is registered
with a null INsdManagerCallback object. To avoid this, perform
a null check before registering a new client and throw an
IllegalArgumentException if the callback is null.

Bug: 293285797
Test: atest FrameworksNetTests
Change-Id: Id61e27873591031c3fe383879aee0d40eebc08b3

Paul Hu   commited 2023-08-10 14:19:01 +08:00
101dbf5262
Merge "Update the implementation for sent_query_count" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-08-10 05:27:06 +00:00
09b1ef0a3a
Update the implementation for sent_query_count
The nsd metrics implementation needs to be updated to support
the new field sent_query_count on NetworkNsdReported.

Bug: 287546772
Test: m
Merged-In: Ie1d8d5f2cce4f6040dcfb980db6ab11dfe01fb72
Change-Id: Ie1d8d5f2cce4f6040dcfb980db6ab11dfe01fb72

Paul Hu   commited 2023-08-10 02:10:57 +00:00
600bd89258
update bpf_existence_test to enforce minimum kver
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibcb4fd53b0bbb04dc52f9fcbb5ab6bdae9efe02c

Maciej Żenczykowski   commited 2023-08-09 21:48:51 +00:00
c71dfae7df
Import RFC7421_PREFIX_LENGTH from NetworkStackConstants.
Remove the dependency on services-connectivity-shared-srcs
filegroup gradually.

Bug: 290885904
Test: TH
Change-Id: I6474563a3a0b521945e6467a2832862764ad4770

Xiao Ma   commited 2023-08-09 20:02:15 +09:00
1f993309c6
Merge "Fix flaky test: testDataMigration_differentFromFallback" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-08-09 08:53:46 +00:00
ef0afdef0e
Merge "Allow VPN lockdown UID ranges to stack properly" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-09 08:05:20 +00:00
b15f7d1e68
Fix flaky test: testDataMigration_differentFromFallback
Test main thread mocked settings object but use that on the handler
thread as well, which is not thread-safe.
Create a real object instead of mocking it instead.

Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest#testDataMigration_differentFromFallback \
      --rerun-until-failure 500
Fix: 289705810
Change-Id: Ibfb722818467fdf2b69a4b8fa87b4ac04a713573

Junyu Lai   commited 2023-08-09 14:44:23 +08:00
353ec97c64
Merge "Use destroyLiveTcpSocketsByOwnerUids for frozen apps" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-09 05:17:14 +00:00
b7d3f3fd77
Merge "Add VpnTest back to presubmut" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2023-08-08 08:39:21 +00:00
f574524c0b
Add VpnTest back to presubmut
These tests were disabled from presubmit because of flaky test.
It's no longer flaky now, so add these tests back to presubmit.

Bug: 293233390
Test: atest FrameworksNetTests
Change-Id: I7f1f36385d2ca6ed210e1d9b7399b6509fd26519

chiachangwang   commited 2023-08-07 08:47:34 +00:00
1a72396be6
Merge "Fix flake : testVpnSetUnderlyingNetworks" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-07 05:22:20 +00:00
8ba50ae30f
Merge "Obtain the MTU from a socket to the destination" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-08-07 05:21:57 +00:00
f8732eb2ce
Fix flake : testVpnSetUnderlyingNetworks
When the device is very slow to run this test, cell might end
its lingering period in the middle of the test while wifi is
the default. VPN will then ignore it as an underlying network,
causing the test to fail.

Test: testVpnSetUnderlyingNetworks
      Added sleep in a strategic place to make sure the problem
      was correctly identified, and observed the test failing.
      After the fix, the test passes with the sleep.
Fixes: 280627836
Fixes: 293844384
Change-Id: Iaf56de963eb17845c1d76a0310b55f7f9321f7e4

Chalard Jean   commited 2023-08-07 14:20:13 +09:00
9033477aa7
Replace usage of android.util.Log to SharedLog
Bug: 294326360
Test: atest FrameworksNetTests
Change-Id: I9a3a84f907362260bdcf6be19e2c4d5345788d2e

Yuyang Huang   commited 2023-08-06 17:34:50 +09:00
7ddf2935f9
Move scheduling logic into MdnsQueryScheduler class
Move scheduling logic into a standalone MdnsQueryScheduler class to
simplify the MdnsServiceTypeClient class.

Bug: 292470176
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I31130c239bc54f6dc0efde2921ce51df35076a74

Yuyang Huang   commited 2023-08-06 15:02:55 +09:00
2501678e74
Merge "Disable data saver mode in AbstractRestrictBackgroundNetworkTestCase setup" into main
Kefan Tu   authored and   Gerrit Code Review   commited 2023-08-05 00:52:30 +00:00
e30a605361
Merge "Add method for reading stats by iface index" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-04 23:43:10 +00:00
8cd07eda29
Merge "Explicitly initialize Stats fields" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-04 23:32:39 +00:00
76f43866a8