Commit graph android_packages_modules_Co.../tests
Message SHA1
Merge changes from topic "trackrecord-backtrace" into main
* changes:
  ethernet: use TrackRecord backtrace for better failure logs
  ethernet: correctly report tethering interface state
  ethernet: add missing assert in eventuallyExpect helper

Patrick Rohr   authored and   Gerrit Code Review   commited 2023-08-18 14:10:21 +00:00
c45928b35b
Merge "Report resolution stop" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-18 09:30:26 +00:00
aa4db9753b
Report resolution stop
Report the nsd metrics event of resolution stop.

Bug: 287546772
Test: atest FrameworksNetTestCases
Change-Id: I2e6de22c946d58a3410f16b2f2689fd3ffc635a4

Paul Hu   commited 2023-08-18 11:59:06 +08:00
6014905672
Merge "Stop the created handler threads on the tests" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-08-18 02:40:45 +00:00
a436faf92d
Add tests in Ikev2VpnTest back to presubmit
Those tests are no longer flaky after fix being merged, so add
them back to presubmit.

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

chiachangwang   authored and   Chiachang Wang   commited 2023-08-18 00:41:55 +00:00
739f3c7ae9
Merge "Stop the created handler threads" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2023-08-17 09:40:05 +00:00
033ca4c8cf
Stop the created handler threads on the tests
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: Id5faceec341578f1c9757194c91a433fbb3f657f

Paul Hu   commited 2023-08-17 06:53:16 +00:00
f6e1867963
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 "Use isTetheringFeatureNotChickenedOut for kill switch" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-08-17 06:13:21 +00:00
23b0bab6b1
Merge "Report resolution metrics data" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-08-17 02:57:45 +00:00
69a18c6f90
Use isTetheringFeatureNotChickenedOut for kill switch
Following CLs remove the default value from isFeatureEnabled since the
default value was difficult to use correctly.
For example, there was a code that use isAtLeastT() as default value and
expect feature is always enabled on T+ devices.
However, default value is used only when the device does not have the
flag value or flag value is 0.
So the expectation that the feature is always enabled on T+ devices is
not correct if flag is pushed to the device by mistake or the device is
upgraded from S to T but the flag value is not cleared.
If the feature should be always enabled on T+ devices, `isAtleastT() ||
isFeatureEnabled()` should be used instead of `isFeatureEnabled(
isAtleastT() /* defaultValue*/ )`

After the default value argument is removed from isFeatureEnabled,
isFeatureEnabled is used for default false flag and
isTetheringFeatureNotChickenedOut is used for default true kill switch flag.

automatic_on_off_keepalive_version flag is not configured and devices
don't have this flag value.
So updating to use isTetheringFeatureNotChickenedOut should not have any
behavior change.

Test: m
Bug: 279108992
Change-Id: I43ceab6cc5234bd5a43af3acbd7bd7344844c5a6

Motomu Utsumi   commited 2023-08-16 20:15:52 +09:00
0a50c65f75
Merge "Report discovery metrics data" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-16 09:28:25 +00:00
238efa1070
Report resolution metrics data
Collect information on resolution success and failure events,
then use this data to build metrics and report them.

Bug: 287546772
Test: atest FrameworksNetTestCases NsdManagerTest
Change-Id: I373ce91fea9d5a278f53fc0c505be90dd39b2d5b

Paul Hu   commited 2023-08-16 15:53:06 +08:00
a6bc463155
Report discovery metrics data
Collect information on discovery start, failure, and stop events,
then use this data to build metrics and report them.

Bug: 287546772
Test: atest FrameworksNetTestCases NsdManagerTest
Change-Id: I2f6a718024870f9658cfeabe8995624a3ad81f05

Paul Hu   commited 2023-08-16 15:09:17 +08:00
812e9217b9
Merge "Add tests for conflicts" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2023-08-16 04:01:30 +00:00
0f30ec683f
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
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
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
Add tests for conflicts
Add end-to-end testing for conflicts happening during and after probing.

This includes making sure that interfaces have a usable IPv6 address
before starting each test, as mdnsresponder would not probe on the
interface if the address is not present, and would go straight to
advertising otherwise.

Bug: 266151066
Test: atest NsdManagerTest
Change-Id: Ie1a1e888afbcd5c1bafaf218a98ac4c2f5fe63ee

Remi NGUYEN VAN   authored and   Paul Hu   commited 2023-08-14 15:02:54 +08:00
0d75d977a2
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 "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
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
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
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
ethernet: use TrackRecord backtrace for better failure logs
Test: atest EthernetManagerTest
Change-Id: Ifcc038281164b0d840bfc52524e7ac4d32c640a0

Patrick Rohr   commited 2023-08-09 05:46:46 -07:00
dbe0fd3f53
ethernet: correctly report tethering interface state
EthernetNetworkFactory does not track interfaces in server mode; use
EthernetTracker#getInterfaceState() instead.

Bug: 241070589
Test: atest EthernetManagerTest
Change-Id: Id68f2ae8b30dd5bacef09b828692a9692c6dba75

Patrick Rohr   commited 2023-08-09 05:45:52 -07:00
4dc2533986
ethernet: add missing assert in eventuallyExpect helper
eventuallyExpect(CallbackEntry) was missing an assertNotNull, which
essentially made it a no-op.

Bug: 241070589
Test: atest EthernetManagerTest
Change-Id: I0ebf54bc9b7ae8a5de59f2bc302b06747174d4ea

Patrick Rohr   commited 2023-08-09 02:46:44 -07:00
a189e9eae0
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
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
Disable data saver mode in AbstractRestrictBackgroundNetworkTestCase setup
This test assumes the data saver mode is initially disabled, but WearOS enables the mode on boot. This change fixes the precondition in the setUp method.

Test: run cts -m CtsHostsideNetworkTests
Bug: 280542664
(cherry picked from https://android-review.googlesource.com/q/commit:2cdeffc7e97a915a847cfc40d89e091aeadf20b3)
Merged-In: Ibcceaf0f44821100c861ef7b3c61d0888ae30481
Change-Id: Ibcceaf0f44821100c861ef7b3c61d0888ae30481

Kefan Tu   authored and   Android Build Cherrypicker Worker   commited 2023-08-04 22:02:25 +00:00
f17e3349ba
Add callbacks for service offload
Components that can provide offload like IpClient (packet
filter offloading) can use the API to register a callback to be notified
when offload is necessary.

Bug: 269240366
Test: atest CtsNetTestCases
Change-Id: I8080702f5b530001b88e79e504f4722ac01bc576

Yuyang Huang   commited 2023-08-04 19:22:15 +09:00
33fa4d268c
Merge "Add version control for packet address translation design" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2023-08-03 06:58:28 +00:00
89b25779e3
Add version control for packet address translation design
This commit adds the version control for keepalive packet address
translation design to prevent device crash if the network stack
is not updated to a newer version. This commit also adds a
DeviceConfig to control the design in newer module version.

Bug: 291870956
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: Id4efbf51dae9154d2bc3a1ee405e2139d5c91e36

chiachangwang   commited 2023-08-02 12:16:31 +00:00
144dd51761
Merge "Address comments at aosp/2658225" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-01 09:19:12 +00:00
87d66ebd59
Merge "Deduplicate items after clear interface in NetworkStats" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-08-01 07:40:57 +00:00
865bfacab7
Address comments at aosp/2658225
Test: This
Bug: 269409485
Change-Id: I6bfde26939e7cb5970f90fe5c663bcb55d3700d9

Junyu Lai   commited 2023-08-01 14:12:55 +08:00
a0991ebbfc