Commit Graph

4429 Commits

Author SHA1 Message Date
Patrick Rohr
efa4039d01 Add null checks to RateLimitTest#tearDown improves error reporting
An NullPointerException in tearDown is a symptom of an initialization
error and should not be reported in the test failure result.

Test: atest RateLimitTest
Change-Id: I9c1d6294678cdc9cdf4beae597f8373b92b52077
2022-02-28 14:59:03 +01:00
Patrick Rohr
445884242e Merge "Move assumptions out of BeforeClass annotated method" am: d239146987
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1996910

Change-Id: I631120863f975a1940d6cdb756128cff1a343f29
2022-02-28 11:34:35 +00:00
Patrick Rohr
d239146987 Merge "Move assumptions out of BeforeClass annotated method" 2022-02-28 11:07:04 +00:00
Lorenzo Colitti
c7d509be56 Update tests for NetworkStats code move. am: 3d52172838
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1987451

Change-Id: Ifb36b812940bda0c4addc690befd2ffe52f7e198
2022-02-28 06:26:52 +00:00
Remi NGUYEN VAN
97edc959c2 Add JNI stats libraries to connectivity am: d95048929c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1987449

Change-Id: Ibae3c96be03017135b9aff4caf6f3f5f1a86075a
2022-02-28 06:26:45 +00:00
Lorenzo Colitti
cebdfba1bb Merge changes from topic "ms52-movenetstats"
* changes:
  Update API files to unhide MATCH_PROXY.
  Update tests for NetworkStats code move.
  Add setPollForce to module API
  Add JNI stats libraries to apex Android.bp
  Add JNI stats libraries to connectivity
  [MS62.2] Add NetworkStatsService into service initializer
  [MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp
  [MS54.3] Move NetworkStats to updatable sources
2022-02-28 05:32:23 +00:00
Lorenzo Colitti
3d52172838 Update tests for NetworkStats code move.
NetworkStatsFactory is moving from services.core to
service-connectivity-tiramisu. Update FrameworksNetSmokeTests and
FrameworksNetIntegrationTests to depend on the latter instead of the
former.

Test: atest FrameworksNetSmokeTests FrameworksNetIntegrationTests
Ignore-AOSP-First: part of large internal topic to avoid merge conflicts
  (cherry-picked from ag/16786005)
Change-Id: Ie48dac421decf83440b7c88adea18152e05f03bb
Merged-In: Ie48dac421decf83440b7c88adea18152e05f03bb
2022-02-28 04:17:13 +00:00
Remi NGUYEN VAN
d95048929c Add JNI stats libraries to connectivity
Add new symbols to libservice-connectivity loaded on T only, and the
framework libraries to apex and tests.

Bug: 197717846
Test: atest FrameworksNetTests
  (cherry-picked and splitting apex Android.bp to aosp/1994130)
Change-Id: Iae44344701a3267110e5cbf271120201134d59e5
Merged-In: Iae44344701a3267110e5cbf271120201134d59e5
2022-02-28 04:16:17 +00:00
Taras Antoshchuk
cb60692e1f Merge "Fix HostsideVpnTests flakyness" am: 116bd6e1a2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1968679

Change-Id: Ib21c9ef7caec66a50492214a975c901ac26f603b
2022-02-25 12:26:13 +00:00
Taras Antoshchuk
116bd6e1a2 Merge "Fix HostsideVpnTests flakyness" 2022-02-25 12:02:13 +00:00
Remi NGUYEN VAN
bbe9cae557 Add DisableConfigSyncTargetPreparer to CTS/MTS
The target preparer ensures that the device does not have change of
DeviceConfig while it is running the tests on S+ (R- is not supported by
the preparer).

This fixes flakes where settings get changed mid-test.

Bug: 210377950
Test: atest CtsNetTestCases
Change-Id: Icfbb402f31b6ee1321e9fcdab994233fb1981bb0
2022-02-25 18:04:41 +09:00
Treehugger Robot
f046baa63a Merge "Make sure the right NetworkMonitor start method is called on S-/T+" am: 894912c85e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1995390

Change-Id: I9f8c6d3c9e61ab08a0a858b6af0899940ff57091
2022-02-25 02:58:39 +00:00
Treehugger Robot
894912c85e Merge "Make sure the right NetworkMonitor start method is called on S-/T+" 2022-02-25 02:23:09 +00:00
Treehugger Robot
32d512fafa Merge "Fix a flake where network caps change innocuously." am: da5e11c95f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1984746

Change-Id: I92452b90c8b11ac014657f8cfcf417febf36c840
2022-02-24 12:14:40 +00:00
Treehugger Robot
da5e11c95f Merge "Fix a flake where network caps change innocuously." 2022-02-24 11:53:04 +00:00
Sudheer Shanka
5f09f8da8c Add some debugs to diagnose test failure.
Bug: 218308105
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: I096258d8c55cf56478015a655b5f3be19f29ace1
Merged-In: I096258d8c55cf56478015a655b5f3be19f29ace1
2022-02-23 20:37:30 +00:00
Patrick Rohr
9fa0b3bf18 Move assumptions out of BeforeClass annotated method
Assumptions that are placed in BeforeClass annotated methods are not
reported correctly. See b/203722419 for more information.

Test: atest RateLimitTest
Bug: 220801455
Change-Id: Ia7f0eaddc75d0ee091e107615f1677c75865dbcb
2022-02-23 10:53:20 +01:00
Patrick Rohr
acbe5d00fc Merge "Add proper kernel support assumption to RateLimitTest" am: 3dd5cc1631
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1994431

Change-Id: I0291d388e198c4005e0f0b5d7782a1f1038f8810
2022-02-22 21:14:28 +00:00
Patrick Rohr
3dd5cc1631 Merge "Add proper kernel support assumption to RateLimitTest" 2022-02-22 20:43:22 +00:00
Jean Chalard
dfe53cdcef Merge "Fix : recent Connectivity module with old NetworkStack module" am: b30e957777
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1991623

Change-Id: I94804c1ed4a0facb8e806b29afded7a0ec2a3f80
2022-02-22 19:59:17 +00:00
Chalard Jean
c46c3b55da Fix a flake where network caps change innocuously.
Caps are changing before the code is checking for no callback,
but the network is not validating ; something like RSSI or
link speed has been updated, which is fine as long as the
network doesn't validate.

Test: ConnectivityManagerTest
Change-Id: Ie9a167d3599b0157cc1cf6e93c36e9689e9cc2e0
2022-02-23 04:52:04 +09:00
Jean Chalard
b30e957777 Merge "Fix : recent Connectivity module with old NetworkStack module" 2022-02-22 19:32:54 +00:00
Chalard Jean
cd8210843f Make sure the right NetworkMonitor start method is called on S-/T+
Test: ConnectivityServiceTest
Change-Id: I6a7f0143082236e30d2e3878147df2c921ff5539
2022-02-23 04:31:26 +09:00
Patrick Rohr
2140575fce Add proper kernel support assumption to RateLimitTest
As it turns out, /proc/config.gz can be accessed via shell command from
within a CTS test. This adds a proper kernel support check for the
RateLimitTest.

Bug: 220801455
Test: atest RateLimitTest
Change-Id: I4d3a6848c1c05c313cb74b235294cee982eecf57
2022-02-22 15:55:30 +01:00
Treehugger Robot
8fd20fff05 Merge "Run CTS EthernetNetworkSpecifier in 12" am: 7a195e16c6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1990270

Change-Id: Ia890cfe521c2fc0c91b1ff7552f9fbeeaf946ef1
2022-02-22 13:17:01 +00:00
Treehugger Robot
7a195e16c6 Merge "Run CTS EthernetNetworkSpecifier in 12" 2022-02-22 12:47:12 +00:00
Treehugger Robot
93765193d3 Merge changes Ie68356a4,I2b63c24b am: d6a5303cd8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1993952

Change-Id: Id3cb1919302d5c232ac9ec4149eca9c3a6821c70
2022-02-22 11:31:45 +00:00
Treehugger Robot
d6a5303cd8 Merge changes Ie68356a4,I2b63c24b
* changes:
  Attempt to deflake NetworkAgentTest#testRejectedUpdates.
  Fix a couple of JavaDoc errors in NetworkAgentInfo.
2022-02-22 10:41:37 +00:00
Treehugger Robot
f105588f91 Merge changes Ib1cd342a,Iab23d414 am: 1c5ce5542a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1991622

Change-Id: I3aab26bc9351e7dd065071b11d58ef9be7224a92
2022-02-22 09:35:16 +00:00
Lorenzo Colitti
dfabefac82 Merge "Mock more resources for VPNs." am: 16040b1833
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1993950

Change-Id: I759556591492205a783a7207322fde1b9a3e857d
2022-02-22 09:34:59 +00:00
Treehugger Robot
1c5ce5542a Merge changes Ib1cd342a,Iab23d414
* changes:
  Add an IS_DESTROYED flag to FullScore.
  Use MessageUtils instead of hardcoded strings in policyNameOf.
2022-02-22 09:26:38 +00:00
Lorenzo Colitti
16040b1833 Merge "Mock more resources for VPNs." 2022-02-22 09:10:42 +00:00
Lorenzo Colitti
e3ef5a8024 Attempt to deflake NetworkAgentTest#testRejectedUpdates.
This test is highly flaky in presubmit with error messages that
look like:

java.lang.AssertionError: Did not receive callback after 200ms

The test itself looks correct, so it's possible that 200ms just
isn't enough time for the callbacks to be delivered. Set the
timeout to DEFAULT_TIMEOUT_MS like most of the other
TestableNetworkCallbacks in this class.

Fix: 218389790
Test: test-only change
Change-Id: Ie68356a48e9618e5fea3865aa06bfbfc457b89c4
2022-02-22 18:04:31 +09:00
Lorenzo Colitti
8c7a8860f9 Add an IS_DESTROYED flag to FullScore.
This is being added as the lowest priority score factor, just
above the tie-breakers. It ensures that a network that has been
destroyed will lose to another identical network that has not
been destroyed, but will otherwise be scored identically.

The flag is a CS-managed flag that is stored in NetworkAgentInfo.
Currently it is always false, but it will be populated in
future CLs.

Bug: 216567577
Test: atest FrameworksNetTests
Change-Id: Ib1cd342ab7dfc4df45715da19b743d711fe8d605
2022-02-22 16:39:44 +09:00
Lorenzo Colitti
8627c0eeda Merge "Mock resources used directly by LockdownVpnTracker." am: 2606d9c862
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1991628

Change-Id: I2f4adda347ed2a8b6a0d108f5a71e3b6c38aaf4a
2022-02-22 02:29:39 +00:00
Lorenzo Colitti
2606d9c862 Merge "Mock resources used directly by LockdownVpnTracker." 2022-02-22 01:59:20 +00:00
Lorenzo Colitti
93a72d22a5 Mock more resources for VPNs.
These also cause ConnectivityCoverageTests to fail when built
from master and run on S. They are used in Vpn.java, not
LockdownVpnTracker.

They were not addressed in the previous CL because running this
test locally is difficult.

Test: forrest
Change-Id: I7d687338fd6bc7468b1abcae58898322554e647b
2022-02-22 10:17:09 +09:00
Lorenzo Colitti
19e6171926 Mock resources used directly by LockdownVpnTracker.
LockdownVpnTracker directly uses resources from
com.android.internal.R. This is acceptable because it's platform
code. But ConnectivityServiceTest uses the LockdownVpnTracker
built from the module source tree, and when that code fetches
resources on a previous Android release, it crashes because the
resource IDs don't exist; non-public resource IDs aren't stable.

Fix this by mocking the resources used by LockdownVpnTracker.

Test: atest ConnectivityCoverageTests
Change-Id: I239a18a38d4f1082f76f5ff1b831c15ee753bdfd
2022-02-22 10:13:24 +09:00
Patrick Rohr
0d24eb4ac5 Merge "CTS for ingress rate limiting" am: c6cf669b8d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1978371

Change-Id: I816b8243b86b5539003adc6285a00ad9576f4b5b
2022-02-21 20:49:19 +00:00
Patrick Rohr
c6cf669b8d Merge "CTS for ingress rate limiting" 2022-02-21 19:57:37 +00:00
Patrick Rohr
96c1ff4ae9 CTS for ingress rate limiting
This test creates a TUN interface and registers it with
ConnectivityService. For 15 seconds, it continuously writes data to that
interface and measures at what rate it is received.

Data accounting is currently not covered by this test.

Test: atest RateLimitTest
Bug: 172053704
Change-Id: I74f891f3b7113855375c48a10cefbfe47221931b
2022-02-21 18:05:21 +01:00
Maciej Żenczykowski
44a4bb6d45 Merge "Skip NetworkStatsServiceTest before T" am: fc67ee8c71
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1990891

Change-Id: I50f114e07afb4ea84d5ca4c4623f79940f5d8703
2022-02-19 20:42:21 +00:00
Maciej Żenczykowski
e6fd9ce504 Merge "Add tests for deleteKernelTagData" am: 8bf31e8061
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1972803

Change-Id: I63927a2cf20ba448ff316ffd01bc409ff8b6a28b
2022-02-19 20:42:17 +00:00
Maciej Żenczykowski
fc67ee8c71 Merge "Skip NetworkStatsServiceTest before T" 2022-02-19 20:20:24 +00:00
Maciej Żenczykowski
8bf31e8061 Merge "Add tests for deleteKernelTagData" 2022-02-19 20:20:24 +00:00
Chalard Jean
a14b3f2184 Fix : recent Connectivity module with old NetworkStack module
This patch adjusts the behavior of the NetworkMonitor mock
to behave the same way as the real one – accept either
notifyNetworkConnected or notifyNetworkConnectedParcel as
a signal a network is connected. This is necessary because
the Connectivity module will call either of these depending
on versions of other software it finds on the device.

Test: ConnectivityServiceTest
      NetworkMonitorTest
Change-Id: I5900a019b3b033f4365d8a82b1e522336012064e
2022-02-19 20:43:14 +09:00
Lorenzo Colitti
c6d3f3cf25 Use MessageUtils instead of hardcoded strings in policyNameOf.
This makes the code easier to maintain because we do not need to
manually add string representations, and because it will throw at
static initialization time if the clas contains duplicate
POLICY_xxx values. The memory overhead is likely negligible.

Bug: 216567577
Test: new coverage in FullScoreTest
Change-Id: Iab23d414c8e28ff7f26060ad44fa996f277d361f
2022-02-19 19:45:43 +09:00
Lorenzo Colitti
7057f583d3 Merge "Don't check validation state in waitForAvailable(..., Network)." am: dbb9280abc
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1989910

Change-Id: If4ad56edf618f3d8a84051822afa551aaae88d35
2022-02-18 17:25:30 +00:00
Lorenzo Colitti
dbb9280abc Merge "Don't check validation state in waitForAvailable(..., Network)." 2022-02-18 17:04:27 +00:00
Benjamin Cooley
ccb8daa808 cts: Re-launch the desired activity after screen-on on TVs.
Some TV's do not resume the previous activity coming back from sleep.
Add a case to restart activity.

Derived from
https://android-review.googlesource.com/c/platform/cts/+/1358002
(Bug: 148812676)

Test: Verified existing passing tests continue to pass on TCL Beyond TV
(Pie)

Change-Id: I86fe80c5326065ac349585d1ab95736132ddfb5a
2022-02-18 16:44:37 +00:00