Commit graph android_packages_modules_Co.../tests/unit/java
Message SHA1
Use java BpfMap in removeUidInterfaceRules am: 599c4e5cf4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2141539

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

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2022-07-14 01:50:43 +00:00
96851244dc
Use java BpfMap in BpfNetMaps#addUidInterfaceRules am: 5f52f4f2fb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2141538

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

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2022-07-14 01:50:40 +00:00
832056dd7f
Use java BpfMap in removeUidInterfaceRules
Bug: 217624062
Test: atest BpfNetMapsTest HostsideVpnTests#testBlockIncomingPacket
Change-Id: I253c75aaeabe138a4f9d57c226744f5766ef1006

Motomu Utsumi   commited 2022-07-13 11:12:19 +00:00
599c4e5cf4
Use java BpfMap in BpfNetMaps#addUidInterfaceRules
Bug: 217624062
Test: atest BpfNetMapsTest HostsideVpnTests#testBlockIncomingPacket
Change-Id: I8aeb4712c852167d553eb331f32d770582199b13

Motomu Utsumi   commited 2022-07-13 11:11:59 +00:00
5f52f4f2fb
Merge changes I58cd6145,I32299ce8,I0433459e am: fabb53a881
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2141537

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

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2022-07-12 03:30:48 +00:00
a3fb4620dd
Merge changes I58cd6145,I32299ce8,I0433459e
* changes:
  Use java BpfMap in updateUidLockdownRule
  Use java BpfMap in BpfNetMaps#addNiceApp
  Use java BpfMap in BpfNetMaps#removeNiceApp

Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-07-12 03:00:28 +00:00
fabb53a881
Merge changes I69a2970d,Ibfb3ae48,Ie595cf1f am: 9ab777b5d5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2138295

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

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2022-07-11 07:33:31 +00:00
31e985a4c2
Use java BpfMap in updateUidLockdownRule
Bug: 217624062
Test: atest BpfNetMapsTest HostsideVpnTests#testBlockIncomingPacket
Change-Id: I58cd614575a98c4b5a8f9c34d47dd2dfff187b26

Motomu Utsumi   commited 2022-07-11 07:19:05 +00:00
697b299e3a
Merge changes I69a2970d,Ibfb3ae48,Ie595cf1f
* changes:
  Use java BpfMap in BpfNetMaps#addNaughtyApp
  Use java BpfMap in BpfNetMaps#removeNaughtyApp
  Add bpf map and lock for UidOwnerMap

Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-07-11 07:14:53 +00:00
9ab777b5d5
Merge "Update error handling in BpfNetMaps" am: f2eca2f13a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2135063

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

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2022-07-11 06:49:45 +00:00
c3f1a475c3
Merge "Update error handling in BpfNetMaps"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-07-11 06:28:50 +00:00
f2eca2f13a
Use java BpfMap in BpfNetMaps#addNiceApp
Bug: 217624062
Test: atest BpfNetMapsTest HostsideRestrictBackgroundNetworkTests
Change-Id: I32299ce8cde34d46999ecb966c3305c966c0509f

Motomu Utsumi   commited 2022-07-11 03:14:07 +00:00
55630d0dc8
Use java BpfMap in BpfNetMaps#addNaughtyApp
Bug: 217624062
Test: atest BpfNetMapsTest HostsideRestrictBackgroundNetworkTests
Change-Id: I69a2970d20be41431b774273bc0902bd325421f4

Motomu Utsumi   commited 2022-07-11 03:14:07 +00:00
389278ec8b
Use java BpfMap in BpfNetMaps#removeNiceApp
Bug: 217624062
Test: atest BpfNetMapsTest HostsideRestrictBackgroundNetworkTests
Change-Id: I0433459ec43b6a84c4417152884d10fae5fecee6

Motomu Utsumi   commited 2022-07-11 03:14:07 +00:00
7392eb4f4c
Use java BpfMap in BpfNetMaps#removeNaughtyApp
Bug: 217624062
Test: atest BpfNetMapsTest HostsideRestrictBackgroundNetworkTests
Change-Id: Ibfb3ae48427b7dc5d06708e63f4a16f7527ce86c

Motomu Utsumi   commited 2022-07-11 03:14:07 +00:00
60ed3be43b
Add bpf map and lock for UidOwnerMap
This commit is a preparation for replacing JNI codes that modify
UidOwnerMap by Java.

Bug: 217624062
Test: atest BpfNetMapsTest HostsideRestrictBackgroundNetworkTests
android.net.cts.ConnectivityManagerTest#testFirewallBlocking

Change-Id: Ie595cf1f77a3ed86addbcdaea1a1be972e0265b3

Motomu Utsumi   commited 2022-07-11 03:14:05 +00:00
5a68a21926
Update error handling in BpfNetMaps
Address review comments from aosp/2117045
Throw AssertionError if bpf map init get error
Update tests to avoid getting AssertionError

Bug: 217624062
Test: atest BpfNetMapsTest
Change-Id: I2194b825aa73b88d5334077d17acb9abbd367c69

Motomu Utsumi   commited 2022-07-11 03:13:04 +00:00
305975ffb0
Merge "Verify calling thread for intent receiver" am: 11781f84b6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2145587

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

Chiachang Wang   authored and   Automerger Merge Worker   commited 2022-07-11 01:48:45 +00:00
cda9c3e682
Merge changes from topics "RefactorIR", "appExclusionPrefix", "reStartVpnProfile" am: ff41ecc64d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2145586

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

Chiachang Wang   authored and   Automerger Merge Worker   commited 2022-07-11 01:47:33 +00:00
0116bc51f4
Verify calling thread for intent receiver
Bug: 230548427
Test: atest VpnManagerServiceTest
Change-Id: Ibe5f7aba8e31dfecfb2eaac3fb109eb442879ede

chiachangwang   commited 2022-07-07 08:54:52 +00:00
826f0b01d2
Refactor to mock package add and remove event
Use mock intent receiver to handle intent related events instead
of exposing the private methods even for testing only.

The visibility for onPackageAdded, onPackageRemoved and
onUserStarted were exposed for testing only in former commit.
The test coverage for intent receiver part may be missed.
The other intent related methods will be verified in the
follow up commits. This refactor will also help to not to
expose further private methods.

Bug: 230548427
Test: atest VpnManagerServiceTest
Change-Id: If2aa88d8d5c1643e8bd4937673aa792186047fd8

chiachangwang   commited 2022-07-07 08:54:27 +00:00
26de58ea79
Test reconnect VpnManager VPN with always on enabled
Verify reconnect using startVpnProfile with the same package with
always-on package should work without exception.

Bug: 235322391
Test: atest FrameworksNetTests
Change-Id: I9a780d970208032e2468e9c5b3334373627c6a20

chiachangwang   commited 2022-07-07 06:46:15 +00:00
a412026c6b
Update the prefix of VPN_APP_EXCLUDED in the test
Update the string according to the change in Vpn.java

Bug: 237345836
Test: atest FrameworksNetTests
Change-Id: I9bfe0a1fad29ba1435eeb8b8b2cffa9d385b1cb5

chiachangwang   commited 2022-07-07 06:46:08 +00:00
9460f45c04
Add tests to verify getProvisionedVpnProfileState
Add tests to verify that calling getProvisionedVpnProfileState works
normally from the same package but gets a security exception from a
differnet package.

Bug: 230548427
Test: atest FrameworksNetTests
Change-Id: I0132c42dce1b8269859fca8d0143304142162838

chiachangwang   commited 2022-07-07 06:45:55 +00:00
72fe97ea1c
Merge "ClatCoordinator: Dump ClatdTracker information" am: 78cf7c5e29
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2145582

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-07-05 15:20:52 +00:00
011b8dca41
Merge "ClatCoordinator: Dump ClatdTracker information"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-07-05 15:01:11 +00:00
78cf7c5e29
ClatCoordinator: Dump ClatdTracker information
Test: atest ClatCoordinatorTest
Change-Id: I6bb47c84321e1323496b728f2db939ee8d74504a

Hungming Chen   commited 2022-07-05 15:30:50 +08:00
a760a10474
Merge "Remove unnecessary null check" am: daced9e4b8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2138293

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-07-04 18:57:15 +00:00
be5920c6cd
Remove unnecessary null check
Address review comments from aosp/2131752 and aosp/2117045
sConfigurationMap must have a entry for UID_RULES_CONFIGURATION_KEY
because this bpf map is an array

Bug: 217624062
Test: atest BpfNetMapsTest
Change-Id: Ic52623e11c1f53e363416d57c0d8705d5510ef04

Motomu Utsumi   commited 2022-07-04 09:20:23 +00:00
1f73fedfef
Merge "Refactor BpfNetMaps and getChainEnabled" am: 51a03d629e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2135061

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

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2022-06-30 07:09:35 +00:00
1608aed5c7
Merge "Refactor BpfNetMaps and getChainEnabled"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-06-30 06:48:10 +00:00
51a03d629e
Merge "Decouple security exception check test from ConnectivityServiceTest" am: bb2e871cce
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2133162

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

Chiachang Wang   authored and   Automerger Merge Worker   commited 2022-06-30 02:00:38 +00:00
c568a0e522
Merge changes from topic "appExclusionPackage" am: 5b4ad7c47a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2106025

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

Chiachang Wang   authored and   Automerger Merge Worker   commited 2022-06-30 02:00:10 +00:00
8003ddb079
Add VpnTestBase for VPN test common code am: 9f672bdae6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2138296

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

chiachangwang   authored and   Automerger Merge Worker   commited 2022-06-30 02:00:07 +00:00
4a1860836d
Merge "Decouple security exception check test from ConnectivityServiceTest"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-06-30 01:36:46 +00:00
bb2e871cce
Merge changes from topic "appExclusionPackage"
* changes:
  Test VPN app exclusion
  Add VpnTestBase for VPN test common code

Chiachang Wang   authored and   Gerrit Code Review   commited 2022-06-30 01:34:54 +00:00
5b4ad7c47a
Merge "Merge tm-dev-plus-aosp-without-vendor@8763363" into stage-aosp-master
Xin Li   authored and   Android (Google) Code Review   commited 2022-06-29 21:22:03 +00:00
514698c728
Decouple security exception check test from ConnectivityServiceTest
Decouple security exception check test from ConnectivityServiceTest
to VpnManagerServiceTest.

These security exception tests landed in ConnectivityServiceTest
because of no VpnManagerServiceTest. Move the tests to the
VpnManagerServiceTest where is better place to put the VPN related
tests to reduce the size of ConnectivityServiceTest.

Bug: 230548427
Test: atest FrameworksNetTests
Change-Id: I94b691c4d1f63bd5226e3296e6d0160dcb03107c

chiachangwang   commited 2022-06-29 06:15:41 +00:00
1aef309197
Test VPN app exclusion
Initialize the VpnManagerServiceTest and verify app exclusion
design.

Bug: 231373589
Test: atest FrameworksNetTests
Change-Id: Icf3994a58de7b2fcc6fafe9712b5ac94e6c2c134

chiachangwang   commited 2022-06-29 06:15:41 +00:00
7f5d04962b
Add VpnTestBase for VPN test common code
This is a no-op change to move some common codes that share
between different VPN unit tests to the new base class.
It's helpful to reduce the code duplication for the follow up
work to add the VpnManagerServiceTest and other test codes
refactor.

Bug: 231373589
Test: atest FrameworksNetTests
Change-Id: Id5111e7ca33ea8f9eb4bcc6c13d0e681f0664d24

chiachangwang   commited 2022-06-29 03:06:09 +00:00
9f672bdae6
Merge tm-dev-plus-aosp-without-vendor@8763363
Bug: 236760014
Merged-In: Ic05ca7fe4adaa94f79e59758569f7595ab4c4f54
Change-Id: Id2ed4b3865be3c959c4cb62a31fba318f5b6fd77

Xin Li   commited 2022-06-28 21:23:32 +00:00
e9ece30105
Use import for testAndCleanup
Follow up work to remove the TODO since it's available in all
branches.

Test: ates VpnTest
Change-Id: I0830148e8577f98616f24d9ee4224496f51bd692

chiachangwang   authored and   Chiachang Wang   commited 2022-06-28 10:57:25 +00:00
337726529b
Merge "Add mdns files and unit tests"
Paul Hu   authored and   Gerrit Code Review   commited 2022-06-28 05:43:58 +00:00
57852487b8
Add mdns files and unit tests
- Put mdns code to service/mdns because we don't want to impact
  coverage for code that's not yet in use.
- Also fix some lint errors
  - Common typo errors
  - Lines longer than 100 characters
- Update IgnoreUpTo from S to SC_V2 because the tests should be
  ignored until T.

Bug: 232766079
Test: atest FrameworksNetTests
Change-Id: I19af3bf7ae004bd37960f2ad9014cf0c6a804c8d

Paul Hu   commited 2022-06-28 09:54:39 +08:00
3e1f4489bf
Refactor BpfNetMaps and getChainEnabled
Address comments from aosp/2117045 and aosp/2131752
Rename USE_NETD to PRE_T
Rename getChainEnabled to isChainEnabled
Remove unnecessary parentheses
Fix comment

Bug: 217624062
Test: atest BpfNetMapsTest
Change-Id: Iaff8c9fc5f74de3fe41a7fb010355b1742fbce90

Motomu Utsumi   commited 2022-06-27 14:33:28 +00:00
25cf86fc95
Merge "Use java BpfMap in BpfNetMaps#setChildChain"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-06-27 05:44:38 +00:00
bccf9df50e
Merge "Add API to get current firewall chain status"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-06-27 05:43:46 +00:00
6421d8456c
Use java BpfMap in BpfNetMaps#setChildChain
Bug: 217624062
Test: atest BpfNetMapsTest android.net.cts.ConnectivityManagerTest#testFirewallBlocking

Change-Id: I13e96911eccd7d1d0545a156ddc2859bcaac09eb

Motomu Utsumi   commited 2022-06-24 09:11:58 +00:00
18b287d285
Add API to get current firewall chain status
This commit adds ConnectivityManager#getFirewallChainEnabled to read the
current firewall chain status

Bug: 208371987
Test: m
Change-Id: I1eadb69f953af5d031cd8dabde3e1f098cf0f4df

Motomu Utsumi   commited 2022-06-24 09:11:53 +00:00
be3ff1e923
Add test for startPptp
The test verifies arguments used to start the daemon

Bug: 201660636
Test: atest VpnTest
Change-Id: I0854fbeaf1a3e3554c157fde227a7bfa187b1013
Merged-In: I0854fbeaf1a3e3554c157fde227a7bfa187b1013

Remi NGUYEN VAN   authored and   chiachangwang   commited 2022-06-24 03:33:30 +00:00
522cea7d4e