Commit graph android_packages_modules_Co.../tests/unit/java
Message SHA1
Add wipeOnError flag to NetworkStatsRecorder am: 692baa7d71
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18910973

Change-Id: I0a0e42c0acce71aa5873c6f2d2767e3d0479c962
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Aaron Huang   authored and   Automerger Merge Worker   commited 2022-06-20 02:10:02 +00:00
ef3c12c392
Merge "Add unit tests for IKEv2 VPN setup and MOBIKE" am: 554eb0699c am: 6e762ca922
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2124749

Change-Id: I04225f9434997c4c1f452277f3f4162e8ac5ce0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Yan Yan   authored and   Automerger Merge Worker   commited 2022-06-17 20:35:08 +00:00
1c3c660904
Merge "Send callback if ip provisioning is interrupted" am: 7d5aae1a55 am: 6775e2eaea
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2123881

Change-Id: Ib8c11b71d599d48c422c0cee470d60e15c101d22
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

James Mattis   authored and   Automerger Merge Worker   commited 2022-06-17 20:34:53 +00:00
f637582a7a
Merge "Add unit tests for IKEv2 VPN setup and MOBIKE"
Yan Yan   authored and   Gerrit Code Review   commited 2022-06-17 17:53:59 +00:00
554eb0699c
Add wipeOnError flag to NetworkStatsRecorder
If reading data happens exception while doing data migration,
the file will be deleted by legacy recorders. This would cause
legacy persistent data being lost and cannot be retrieved by
any method. To avoid the files being deleted, add a wipeOnError
flag to recorder which indicates this recorder will wipe on
error or not . If the flag is set to true then deletes all files
when it throws, otherwise keeps all files.

Ignore-AOSP-First: urgent fix and will cherry-pick immediately after.
Bug: 233828210
Test: FrameworksNetTests:NetworkStatsRecorderTest
Change-Id: Id7a3d8bebf8a00d814f9e84bf4c10d927e6ff749

Aaron Huang   commited 2022-06-17 15:23:24 +08:00
692baa7d71
Add unit tests for IKEv2 VPN setup and MOBIKE
Add unit tests for IKEv2 VPN setup and handling network change.

Bug: 192077544
Test: atest VpnTest (new tests)
Change-Id: Idd13a3ae57a521901c576bdd33ca0170e94be048

Yan Yan   commited 2022-06-17 00:14:32 +00:00
4b0e4b1f17
Merge "Revert "Temporarily ignore ethernet tests until prebuilts are updated"" into tm-dev
Patrick Rohr   authored and   Android (Google) Code Review   commited 2022-06-16 19:22:10 +00:00
ab3e14471b
Send callback if ip provisioning is interrupted
A callback is expected to be sent on either success or failure when the
EthernetManager#updateConfiguration API is called.

Currently, if this API is called for an active interface and marked
restricted, after the IP provisioning process is started in
EthernetNetworkFactory, the interface will then processe all the
onNetworkUneeded requests for the newly restricted network. Assuming no
apps have requests for this particular network or restricted networks,
the network will be stopped once the outstanding network request count
reaches zero.

If provisioning hasn't completed yet for the original
updateConfiguration call, the original callback will be cleared out on
stop and will never notify the original caller of
EthernetManager#updateConfiguration whose call was aborted.

Bug: 235907515
Test: eth unit and cts tests
Change-Id: I91359272c07e090039049370ba9f438546fce3ad

James Mattis   commited 2022-06-16 08:10:20 -07:00
265eba982d
Merge "Revert "Temporarily disable testUidStatsForTransport"" into tm-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2022-06-16 07:43:45 +00:00
3481337b6b
Merge "Revert "Temporarily disable NsdService unit tests"" into tm-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2022-06-16 07:43:03 +00:00
705d85bf3f
Merge changes Ic6ff7a3d,Iff9b9792 am: 5d787feef0 am: 78df805366
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2110087

Change-Id: Ib10eb3de45b85e9c02f9103d22a50cc7b2aabf89
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2022-06-16 02:18:53 +00:00
e17b63b4f1
Merge changes Ic6ff7a3d,Iff9b9792
* changes:
  Refactor code and improve tests for VPN filtering
  Remove LOCKDOWN from FirewallChain IntDef

Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-06-16 01:32:20 +00:00
5d787feef0
Merge "Disable fallback when comparison result is different" into tm-dev am: ebec0f76ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18849946

Change-Id: I568129dda63d52fb71e56f191063fa15913eb573
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Junyu Lai   authored and   Automerger Merge Worker   commited 2022-06-15 21:48:26 +00:00
480cd3a603
Revert "Temporarily ignore ethernet tests until prebuilts are updated"
This reverts commit 14f45a3e98.

Reason for revert: Reenabling tests after prebuilts are updated.

Bug: 233824546
Change-Id: I6883ea55dd390e7fe102b735e0b757e838d9eff6
Merged-In: I8e806b3b884f2e0b6c1a1d2fffdb9a99c5dd60e8

Patrick Rohr   commited 2022-06-15 18:55:48 +00:00
3a7645fc75
Disable fallback when comparison result is different
Follow-up from ag/18452103, where we add fallback code that runs
with the importer to make sure they are identical.
When the result is different, we'll take the result from fallback
code to minimize the rollout risk. However, since the OEMs might
change the importer implementation. The fallback code would no
longer valid and that makes OEM modified code not working. Hence
the fallback code must be disabled before release.

This change keeps comparison enabled for all cases to keep getting
signals from beta users. And will switch it to read overlay value
for OEM to debug their solution.

Ignore-AOSP-First: Parent CLs are not in aosp yet
Test: 1. NetworkStatsServiceTest
      2. Test all datasets with script
Bug: 233752318
Change-Id: I869ff05297149bde6e13a204bd8c5a4fece75de0

Junyu Lai   commited 2022-06-15 19:49:33 +08:00
f955184698
Revert "Temporarily disable testUidStatsForTransport"
This reverts commit 87a9bc7edb.

Reason for revert: Prebuilts are updated and tests should pass now

Change-Id: I6dd793e124a2781b9d74d28b7da7ac9f15f41d89
Merged-In: Ib1d180cc799dde94ada642ce752623b4b65f1e31
Merged-In: I44dda14cae265e600010c6f8efe1471ac481c6ea
Merged-In: I702a75e91be0bb582f9cbd7b4a23e1286f8252cf

Remi NGUYEN VAN   commited 2022-06-15 02:15:23 +00:00
b3740168ae
Revert "Temporarily disable NsdService unit tests"
This reverts commit a3ce8f8438.

Reason for revert: Prebuilts should be newer now

Change-Id: I717288c9a2e25fb9bc358a61beb8877144ed078c
Merged-In: Ib1d180cc799dde94ada642ce752623b4b65f1e31
Merged-In: I44dda14cae265e600010c6f8efe1471ac481c6ea
Merged-In: I702a75e91be0bb582f9cbd7b4a23e1286f8252cf

Remi NGUYEN VAN   commited 2022-06-15 02:13:23 +00:00
d86035f662
Merge "Revert "Add unit tests for IKEv2 VPN setup and MOBIKE"" am: c8144ff164 am: 0b022e8d5c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2124453

Change-Id: Ie794ae544b59461075e49eeec0b593cbe2b72c43
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Yan Yan   authored and   Automerger Merge Worker   commited 2022-06-13 21:43:07 +00:00
259c00bbaf
Revert "Add unit tests for IKEv2 VPN setup and MOBIKE"
Revert "Make VPN more testable and update NC during network change"

Revert submission 2113906-mobike-ut

Reason for revert: b/235853154 Test files build failed on tm-mainline-prod
Reverted Changes:
I739016db1:Add unit tests for IKEv2 VPN setup and MOBIKE
Ic0f0c5496:Make VPN more testable and update NC during networ...

Change-Id: I9e8695078633822d3051aed27dcd617e0b8da6e5

Yan Yan   commited 2022-06-13 19:51:52 +00:00
fcc7e905b2
Merge "Add unit tests for IKEv2 VPN setup and MOBIKE" am: e934e484c7 am: c4ddee9707
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2113906

Change-Id: I9fe164bbde085367a7254b4a1428605a340d0499
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Yan Yan   authored and   Automerger Merge Worker   commited 2022-06-13 18:20:52 +00:00
f825c61f24
Add unit tests for IKEv2 VPN setup and MOBIKE
Add unit tests for IKEv2 VPN setup and handling network change.

Bug: 192077544
Test: atest VpnTest (new tests)
Change-Id: I739016db1b139b722b54c828fcc3babc5b1f14c4

Yan Yan   commited 2022-06-10 18:48:49 +00:00
cbd6205ae9
Refactor code and improve tests for VPN filtering
Bug: 206482423
Test: atest ConnectivityServiceTest PermissionMonitorTest

Change-Id: Ic6ff7a3d7695ad6ce96764a9bab2c0a641ba2ba6

Motomu Utsumi   commited 2022-06-10 03:18:32 +00:00
f8bd82cd67
Remove LOCKDOWN from FirewallChain IntDef
LOCKDOWN_VPN was in the FirewallChain IntDef but this was not a right
place because LOCKDOWN_VPN was not a valid value for Connectivity APIs
that take an argument annotated with @FirewallChain(setUidFirewallRule,
setFirewallChainEnabled, replaceFirewallChain).

LOCKDOWN_VPN was in the FirewallChain IntDef because
BpfNetMaps#setUidRule was used to add/remove LOCKDOWN_VPN entries.
This commit adds BpfNetMaps#updateUidLockdownRule and uses this to
add/remove LOCKDOWN_VPN entries instead of BpfNetMaps#setUidRule and
removes LOCKDOWN from FirewallChain.

Bug: 206482423
Test: atest TrafficControllerTest ConnectivityServiceTest
PermissionMonitorTest HostsideVpnTests#testBlockIncomingPacket

Change-Id: Iff9b9792fc0f208f153e10e396c6d5034b412d7c

Motomu Utsumi   commited 2022-06-10 02:49:25 +00:00
8b42e6d431
Merge "Test recoverable Ikev2 errors" am: 281390e58c am: af4edb7ad7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2098818

Change-Id: Ibd191930f95d69cbb2a2c21b383e0386d934ffeb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Lucas Lin   authored and   Automerger Merge Worker   commited 2022-06-09 18:27:40 +00:00
e5bc899067
Merge "Test recoverable Ikev2 errors"
Lucas Lin   authored and   Gerrit Code Review   commited 2022-06-09 17:37:45 +00:00
281390e58c
Merge "Remove debug log from NetworkStatsService" am: bd96778236 am: 2a9dae00ba
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2117037

Change-Id: I3221a0799dc86537fdff803a98e10103c253463e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Aaron Huang   authored and   Automerger Merge Worker   commited 2022-06-09 03:44:47 +00:00
438cad705c
Merge "Remove debug log from NetworkStatsService"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-06-09 02:37:42 +00:00
bd96778236
Merge "ClatCoordinator: improve file descriptor clean up in error handling" am: a58028e31a am: b15536a161
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2114854

Change-Id: I87af9b09aa79bc6224a4b8a75c2e5d3c70c55807
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-06-08 07:58:47 +00:00
f8ad5d6ca1
Merge "ClatCoordinator: improve file descriptor clean up in error handling"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-08 07:19:31 +00:00
a58028e31a
Remove debug log from NetworkStatsService
This change reverts aosp/1777887. The exception was used to get
the stack while the mMobileIfaces contains null interface, and
currently mMobileIfaces is protected by making it volatile so
it is fine to be removed.

Also, fix style error in NetworkStatsServiceTest

Test: build, FrameworksNetTests
Change-Id: I8435354f8cfd05589c0231f3bb8cbaa66c0525cf

Aaron Huang   commited 2022-06-08 12:20:55 +08:00
de99c7a9f4
Merge changes from topic "oom-fix"
* changes:
  Fix get summary does not include the latest bucket
  Add unit test for MultipathPolicyTracker

Junyu Lai   authored and   Gerrit Code Review   commited 2022-06-07 09:26:09 +00:00
093cd94972
Test recoverable Ikev2 errors
Test if retry mechanism is working or not when there is a
recoverable Ikev2 error.

Bug: 229350078
Test: atest FrameworksNetTests:VpnTest
Change-Id: I5e881c6b42aeb98adce598587e2a7e49be7d9643

lucaslin   commited 2022-06-07 16:28:47 +08:00
adb56e94a5
Merge "Hold wifi and mobile interfaces since boot in NetworkStatsService"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-06-07 07:36:26 +00:00
5804b5c5df
Merge "Add 3rd deny firewall chain for OEM" am: 1259ebcb59 am: b80b5e5476
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2117038

Change-Id: I9bc36d8d1b3870d821a9440d7babfc7f9d20a727
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2022-06-07 06:14:35 +00:00
aee69a63d8
Add 3rd deny firewall chain for OEM
Bug: 208371987
Test: atest
CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testFirewallBlocking
ConnectivityServiceTest

Change-Id: Ib521fa02f6a19270cb88a3d85321bda822516c78
(cherry picked from commit 1d9054ba5f)
Merged-In: Ib521fa02f6a19270cb88a3d85321bda822516c78

Motomu Utsumi   authored and   Cherrypicker Worker   commited 2022-06-07 05:35:36 +00:00
608015f24e
Fix get summary does not include the latest bucket
In internalGetSummaryForNetwork, the history object will not
include the latest bucket because of the logic in
NetworkStatsHistory#recordHistory would only include buckets
that atomically occur in the inclusive time range.

This makes querySummaryForDevice callers who are also sensitive
to the latest bucket fails.

This CL revert the behavior back to S, in T this is temporarily
changed after aosp/1937268.

Also, for test purpose, this CL change System.currentTimeMillis to
use mClock when querying.

Test: NetworkStatsServiceTest#testGetLatestSummary
Bug: 233733267
Change-Id: I55e2a5d953622b68da36a9b8d3e57c88d57543b0
Merged-In: I55e2a5d953622b68da36a9b8d3e57c88d57543b0
  (pure cherry-picked from ag/18670248)

Junyu Lai   commited 2022-06-07 11:07:46 +08:00
04b2cb2f2d
Add unit test for MultipathPolicyTracker
This CL adds unit test to test onThresholdReached event
would unregister and re-register usage callback.

Test: MultipathPolicyTrackerTest#testOnThresholdReached
Bug: 233733267
Change-Id: I6e43ae93055009d91b0795a4466f2c02f4403c0a
Merged-In: I6e43ae93055009d91b0795a4466f2c02f4403c0a
  (pure cherry-picked from ag/18579049)

Junyu Lai   commited 2022-06-07 11:06:46 +08:00
207b125a20
Add 3rd deny firewall chain for OEM
Bug: 208371987
Test: atest
CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testFirewallBlocking
ConnectivityServiceTest

Change-Id: Ib521fa02f6a19270cb88a3d85321bda822516c78

Motomu Utsumi   commited 2022-06-06 07:47:35 +00:00
1d9054ba5f
Hold wifi and mobile interfaces since boot in NetworkStatsService
In current design, the interface will be removed from the list if
the network disconnected which will cause getUidStatsForTransport()
returns unexpected snapshot to caller since the list is empty.

This change also remove interface name from all entries before
the method returns the result.

Bug: 231514741
Test: FrameworksNetTests
      manual test
Change-Id: Ie60829a65d0d9b5b63ad353695a820c0586e3665
Merged-In: Ie60829a65d0d9b5b63ad353695a820c0586e3665

Aaron Huang   commited 2022-06-06 13:19:11 +08:00
f4f5de3993
Merge changes from topic "cherrypicker-L34800000954905788:N57900001270872696" into tm-dev
* changes:
  Ignore new test until prebuilts are updated.
  Add deny firewall chain for OEM

TreeHugger Robot   authored and   Android (Google) Code Review   commited 2022-06-03 16:45:05 +00:00
52f0fe0c47
Merge "ClatCoordinatorTest: add test for startClat error handling" am: 6d0b34ecb3 am: d8031cf082
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2109965

Change-Id: I4de6014183413c6f44e239b2ba0dcca198d309f4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-06-03 15:51:39 +00:00
5f5b94cfdf
Merge "ClatCoordinatorTest: add testDump" am: 1076248194 am: 70e1fd1cc2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2110085

Change-Id: I4690dfb0dda3decc4b7e335679c1fbda4b206b91
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-06-03 15:51:29 +00:00
0a4c675372
Merge "ClatCoordinatorTest: add test for startClat error handling"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-03 15:17:10 +00:00
6d0b34ecb3
Merge "ClatCoordinatorTest: add testDump"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-03 15:17:06 +00:00
1076248194
ethernet: broadcast state change for server interfaces
Also update the test to ensure mFactory.hasInterface is mocked to match
mFactory.getInterfaceState: previously it would be called by the factory
in the mocked getInterfaceState, but the new code calls it directly.

Bug: 171872016
Test: atest EthernetManagerTest
Change-Id: I9ac959f181c88a7992991923b98a836f2833fa88
(cherry picked from commit f33f276b29)
Merged-In: I9ac959f181c88a7992991923b98a836f2833fa88

Patrick Rohr   authored and   Lorenzo Colitti   commited 2022-06-03 21:32:31 +09:00
1f8bd41e87
Merge changes from topic "remove-ethernet-shims" am: 337d512081 am: 293129ca50
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2114378

Change-Id: I557bc2835c6aa75af895466585424fd0587bfcb0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2022-06-03 12:23:56 +00:00
266e3cc123
Merge changes from topic "remove-ethernet-shims"
* changes:
  ethernet: add test for tethered interface callbacks
  ethernet: stop using EthernetManager shims
  ethernet: broadcast state change for server interfaces
  ethernet: increase timeout to deflake tests

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-06-03 11:51:58 +00:00
337d512081
Merge "Verify if the VPN app has been added into power save whilte list" into tm-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2022-06-03 11:49:35 +00:00
09130e00ae
Merge "Add deny firewall chain for OEM" am: 181f7c85fc am: 7731ca47f9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2114533

Change-Id: I9bfb2edc9bded9e895f291385ebdb16218fe05a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2022-06-03 11:46:43 +00:00
78319c9f6d
Add deny firewall chain for OEM
Bug: 207773349
Bug: 208371987
Test: atest
CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testFirewallBlocking
--iterations 50 && atest ConnectivityServiceTest --iterations 10

Change-Id: I60d5540821abcced03356f366775f16ee369d7f9
(cherry picked from commit d980149817)
Merged-In: I60d5540821abcced03356f366775f16ee369d7f9

Motomu Utsumi   authored and   Cherrypicker Worker   commited 2022-06-03 11:06:46 +00:00
9cd4726890