Commit graph android_packages_modules_Co.../Tethering/tests/unit
Message SHA1
Merge "[Tetheirng] Refactor carrier config to EntitlementManager" am: 1135676150 am: 4ba3a8a6fb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2033668

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

Tom Hsu   authored and   Automerger Merge Worker   commited 2022-04-21 14:27:04 +00:00
c83fee7adb
Merge "[Tetheirng] Refactor carrier config to EntitlementManager"
Tom Hsu   authored and   Gerrit Code Review   commited 2022-04-21 13:43:14 +00:00
1135676150
[Tetheirng] Refactor carrier config to EntitlementManager
- To reduce CarrierConfigManager access times, move CarrierManager
  to TetheringConfiguration.

Bug: 225900149
Test: atest EntitlementManagerTest pass
Test: atest TetheringConfigurationTest pass
Change-Id: I5b206e2bc012cbbca26fb1e5c72558383981f183

tom hsu   commited 2022-04-21 12:44:26 +08:00
f0d60e9902
Merge "Add onSupportedTetheringType callback" am: c4379c2440 am: fb8dc55f47
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1940847

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

Mark Chien   authored and   Automerger Merge Worker   commited 2022-04-20 06:13:52 +00:00
5702c68944
Merge "Add onSupportedTetheringType callback"
Mark Chien   authored and   Gerrit Code Review   commited 2022-04-20 03:38:42 +00:00
c4379c2440
Add onSupportedTetheringType callback
This new callback could tell caller Tethering is supported for what tethering
types.

Bug: 184996041
Test: atest TetheringTests
      atest EthernetTetheringTest
CTS-Coverage-Bug: 223340235

Change-Id: Ib80ed8d7f73f4a098b8965db186d24d8cf1884d3

markchien   commited 2022-04-20 00:41:41 +08:00
ae3d303344
Merge "Move TetherStatsKey and TetherStatsValue to common libs" am: 8315d1cf03 am: 00882a40a6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2054166

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-04-19 09:34:48 +00:00
54c77de080
Merge "Move TetherStatsKey and TetherStatsValue to common libs"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-04-19 08:35:03 +00:00
8315d1cf03
Merge "Add config_p2p_leases_subnet_prefix_length configuration" am: 60f25d6c5b am: b88aea2c58
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1999082

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

Mark Chien   authored and   Automerger Merge Worker   commited 2022-04-06 10:00:27 +00:00
20ede05369
Merge "Add config_p2p_leases_subnet_prefix_length configuration"
Mark Chien   authored and   Gerrit Code Review   commited 2022-04-06 09:14:19 +00:00
60f25d6c5b
Move TetherStatsKey and TetherStatsValue to common libs
EthernetTetheringTest needs to parse BPF map content for bpf stats
tests. Move the struct class files to common libs.

Compare TetherStats{Key, Value}.java between frameworks/libs/net/common
and packages/modules/Connectivity/Tethering.
There is only the package name change as expected.

$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/TetherStatsKey.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/TetherStatsKey.java
17c17
< package com.android.networkstack.tethering;

Bug: 227159997
Test: atest TetheringCoverageTests

Change-Id: I87193cb6409b4d19c72184011d7e99275800dab1

Hungming Chen   commited 2022-04-04 23:25:58 +08:00
87bb6c3603
Add config_p2p_leases_subnet_prefix_length configuration
Add new rro configuration which can be used to make the p2p dhcp
prefix length larger to reserve the address range outside of leases
subnet prefix length for EAPOL-Key feature. This configuration only
valid if its value larger than dhcp server address prefix length and
config_tether_enable_legacy_wifi_p2p_dedicated_ip is true.
E.g.:leaseSubnetPrefixLength = 25, p2p static address = 192.168.49.1/24
dhcp range: 192.168.49.0 ~ 192.168.49.127 (192.168.49.1/25), reserved
192.168.49.128 ~ 192.168.49.255 for EAPOL-Key feature.

Bug: 170056953
Test: atest TetheringTests

Change-Id: I1319efd871796da7234383a29ab64a1623101ae7

markchien   commited 2022-03-31 16:32:55 +08:00
fb65dfeb8d
Add test for tetherOffloadClient{Add, Remove, Clear} am: dad664748a am: 1dcbf69053
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1744606

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

Hungming Chen   authored and   Automerger Merge Worker   commited 2022-03-30 12:27:44 +00:00
ee7bd4eab6
Add test for tetherOffloadRule4Clear am: fa3942c7e7 am: 5b3fe8dc7c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1838894

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

Hungming Chen   authored and   Automerger Merge Worker   commited 2022-03-30 12:27:42 +00:00
2cb7902713
Add test for tetherOffloadClient{Add, Remove, Clear}
also remove the redundant constructor definition in
test key/value class builder.

Test: atest TetheringCoverageTests
Change-Id: Icf93d4f196846c82c3a1c2b2b8697f4a5156ea92

Hungming Chen   commited 2022-03-30 16:28:11 +08:00
dad664748a
Add test for tetherOffloadRule4Clear
Test that clear IPv4 offload rules once tethering stopped

Test: atest TetheringCoverageTests
Change-Id: I107b15bef2a15f7c85236f2801c43288fe7d0f4d

Hungming Chen   commited 2022-03-30 16:28:11 +08:00
fa3942c7e7
Merge "[DU04-4]Appropriate changes to the NetworkPolicyManager API" am: cd9fe9b220 am: 1f3f4b22cf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2022895

Change-Id: I76b1412e6e6d2f82a92a8fc7f8de16682a548e72

Frank Li   authored and   Automerger Merge Worker   commited 2022-03-16 13:20:10 +00:00
441ad07fe4
Merge "[DU04-4]Appropriate changes to the NetworkPolicyManager API"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-16 12:28:24 +00:00
cd9fe9b220
Merge "Add a carrier config to block tethering." am: 1c12d0790e am: b9331a8fd1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1967167

Change-Id: I2d4726fb8a6a85a5ddf6646289e0ba308b3061a8

Tom Hsu   authored and   Automerger Merge Worker   commited 2022-03-16 08:19:32 +00:00
e806405414
Merge "Add a carrier config to block tethering."
Tom Hsu   authored and   Gerrit Code Review   commited 2022-03-16 07:26:39 +00:00
1c12d0790e
Add a carrier config to block tethering.
When KEY_CARRIER_SUPPORTS_TETHERING_BOOL=false, it will behave as if
entitlement check failed and a system notifcation shows up if user
tries to turn on tethering from Settings UI.

Bug: 161206517
Test: manual
Change-Id: I78da390ecb0c8f4f68285ef16da80653f136c11e

Meng Wang   authored and   tom hsu   commited 2022-03-16 12:40:24 +08:00
a84bb2d8ba
[DU04-4]Appropriate changes to the NetworkPolicyManager API
Divide the NetworkPolicyManager API
notifyStatsProviderWarningOrLimitReached into the following two APIs:
1. notifyStatsProviderWarningReached()
2. notifyStatsProviderLimitReached()

Bug: 216474563
Test: atest NetworkStatsServiceTest NetworkPolicyManagerTest
            NetworkPolicyManagerServiceTest OffloadControllerTest
Change-Id: I473b8b677d492a7076e63f445b3a3be24d25e14d

Frank   commited 2022-03-16 12:23:34 +08:00
9ff8eb1829
Merge changes I5af6ce96,Ibc1f6813 am: 3938102448 am: a7033ddecf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1941933

Change-Id: Idcd5873236e7483786482ee0e3e234071685e0de

Nucca Chen   authored and   Automerger Merge Worker   commited 2022-03-11 18:47:24 +00:00
c7b499505a
Merge changes I5af6ce96,Ibc1f6813
* changes:
  Refactor make{Tether4Key, Tether4Value ConntrackEvent} helper
  BpfCoordinatorTest: refactor upstream and downstream setup functions

Nucca Chen   authored and   Gerrit Code Review   commited 2022-03-11 18:05:14 +00:00
3938102448
Merge "Make isTetheringSupported respect all tethering downstreams" am: 8dcc3000fd am: ed061b1e09
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1938694

Change-Id: Idf9865302881522eb26c385acf0cb2a6198ef539

Mark Chien   authored and   Automerger Merge Worker   commited 2022-03-07 06:40:00 +00:00
bc79108b69
Merge "Make isTetheringSupported respect all tethering downstreams"
Mark Chien   authored and   Gerrit Code Review   commited 2022-03-07 05:56:20 +00:00
8dcc3000fd
Make isTetheringSupported respect all tethering downstreams
Currently if wifi, usb and bluetooth tethering is not supported,
isTetheringSupported would return false. Then ethernet, ncm tethering
and wifi p2p would also not be supported anymore. Make
isTetheringSupported respect all tethering downstreams after T.

Also remove redundant code:
1. tethering always has upstream configuration, checking whether has
upstream configuration for isTetheringSupported is useless.
2. Remove TetheringDependencies#isTetheringSupported because it don't
have any caller.

Test: atest TetheringTests
Change-Id: I3db5ce410c064d37c9e9e704fce2a2b68705834e

markchien   commited 2022-03-07 10:55:51 +08:00
259d5c08a8
Deduplicate InterfaceParams am: 9f371f024b am: c75bd90328
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2006832

Change-Id: Idd68a0b18009b923b95cf661f2c49230ef349022

Patrick Rohr   authored and   Automerger Merge Worker   commited 2022-03-05 09:11:47 +00:00
6c3c538632
Deduplicate InterfaceParams am: 9f371f024b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2006832

Change-Id: I5d0139ca8c4a92b7e20c0e5d051ce78920f236a0

Patrick Rohr   authored and   Automerger Merge Worker   commited 2022-03-05 08:50:09 +00:00
c75bd90328
Merge changes from topic "dedup-interfaceparams"
* changes:
  Remove unused InterfaceParams jarjar rule
  Deduplicate InterfaceParams

Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2022-03-05 08:23:55 +00:00
a63535bfd1
Deduplicate InterfaceParams
CS should use InterfaceParams from frameworks/libs/net.

Test: builds
Bug: 222448728
Change-Id: I1f45d3171b265461a8724b4be7b212c030b63fe9

Patrick Rohr   commited 2022-03-04 16:53:51 +01:00
9f371f024b
Merge "Pass whole TetheringConfiguration to IpServer" am: 9edd999725 am: f815abc7ac
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1999083

Change-Id: Ia6f4c5ca684ea8c42854af0756e391288c3873f6

Mark Chien   authored and   Automerger Merge Worker   commited 2022-03-03 12:44:40 +00:00
c33bce2bc3
Merge "Pass whole TetheringConfiguration to IpServer"
Mark Chien   authored and   Gerrit Code Review   commited 2022-03-03 11:54:59 +00:00
9edd999725
Pass whole TetheringConfiguration to IpServer
This is a no-op CL that passing whole TetheringConfiguration to IpServer
to reduce the number of IpServer constructor parameters.

Bug: 170056953
Test: atest TetheringTests
Change-Id: I4ec17f7ecaefd7f275139ad9c7f7551635b192c9

markchien   authored and   Mark Chien   commited 2022-03-03 11:54:24 +00:00
b961d3d70f
Merge "Remove tether_enable_select_all_prefix_ranges flag" am: a3728e97ca am: 0438fbe9ee
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2005315

Change-Id: I70da2fa5f7b4b55a8843e4b4c450e8ac7f12774c

Mark Chien   authored and   Automerger Merge Worker   commited 2022-03-03 10:31:29 +00:00
d5740854f2
Merge "Remove tether_enable_select_all_prefix_ranges flag"
Mark Chien   authored and   Gerrit Code Review   commited 2022-03-03 09:40:27 +00:00
a3728e97ca
Remove tether_enable_select_all_prefix_ranges flag
The tether_enable_select_all_prefix_ranges is added from M2020-12
for quick roll back the feature. Since feature is landed over a year
without any problem, remove the flag now.

Bug: 171269957
Test: atest TetheringTests
Change-Id: I3ef414a47dd0a1f80ea2d378601ccd7c14067318

markchien   commited 2022-03-02 21:58:50 +08:00
23a5f18adb
Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Test: build, flash, device boot to home.
Merged-In: I9ebedf8813cbfa30d979bc35a3b2306715be682b
Change-Id: I9ebedf8813cbfa30d979bc35a3b2306715be682b

paulhu   commited 2022-03-01 09:44:21 +08:00
537f72061a
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

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-28 05:32:23 +00:00
cebdfba1bb
[MS54.3] Move NetworkStats to updatable sources
This CL builds NetworkStats related codes with the
connectivity module instead of platform.

Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c

Junyu Lai   commited 2022-02-28 03:24:19 +00:00
eb6f4bef96
Merge "Notify linkproperties change in all scenarios" am: cc0dc24205 am: 96fe87ceae
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1958901

Change-Id: Iffd52a9e415dc72bc58c9db15c2627bfa182bb12

Mark Chien   authored and   Automerger Merge Worker   commited 2022-02-25 12:02:32 +00:00
5cc8c767ee
Notify linkproperties change in all scenarios
In scenarios where linkproperties event is received on default internet
callback, linkproperties are cached and network state is updated with
new link properties but Tethering class is notified about the change.
Later when event is received on mobile request or listen all cb, since
the network state is already updated with these linkproperties, change
in link properties will not be notified. This results in tethering
failures where the ip addresses of the tethering interface will not be
updated.

This change handles this issue by triggering the link properties change
in all scenarios.

Update the correponding test case as well.

Tests: Builds, Boots, TetheringTests
Bug: 216281561
Change-Id: I7452ed07d2665843c86141764b71aab0c00417fe

Pavan Kumar M   commited 2022-02-25 12:29:10 +05:30
68e96aba07
Refactor make{Tether4Key, Tether4Value ConntrackEvent} helper
Used for reducing the increasing amount of helper in the
follow-up commits.

Tether4Key, Tether4Value ConntrackEvent need many arguments to build
a testing instance. Any new argument combination may require a new
helper. It is hard to compare the difference while reading the code.

Test: atest BpfCoordinatorTest
Change-Id: I5af6ce9609b97d124227750cd1c5337796982c58

Hungming Chen   commited 2022-02-22 21:32:52 +08:00
4aa94e6f9c
BpfCoordinatorTest: refactor upstream and downstream setup functions
This is preparation for tetherOffloadRule4Clear test.

- Upstream interface can be set {null, cellular (rawip), wifi (ether)}
- Allow that add up to two downstream interfaces which has one client
  on each of them.
- Change mBpfDownstream4Map and mBpfUpstream4Map from mocked instance
  to TestBpfMap for further rule check.
- Remove startPolling() from initBpfCoordinatorForRule4() because
  upstream information is updated by updateUpstreamNetworkState now.

Test: atest TetheringCoverageTests

Change-Id: Ibc1f68131410b7cec379ab4e310b90ad85f25d31

Hungming Chen   commited 2022-02-22 21:32:38 +08:00
154b1e467d
Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Ignore-AOSP-First: Merge conflict. Will cherry-pick to AOSP afterwards.
Test: build, flash, device boot to home.
Merged-In: I9ebedf8813cbfa30d979bc35a3b2306715be682b
Change-Id: I9ebedf8813cbfa30d979bc35a3b2306715be682b

paulhu   authored and   Paul Hu   commited 2022-02-20 15:12:13 +00:00
699477a8f0
Add bt dep for tethering tests
Bug: 217736913
Test: Compile, bringup and test user journeys
Ignore-AOSP-First: framework-bluetooth.stubs.module_lib is not yet ready on AOSP
Change-Id: I37a2f3406c24a6bc6fd2d0eb2061fdb7a4240195

Roopa Sattiraju   authored and   Zach Johnson   commited 2022-02-15 22:58:34 -08:00
b09e60c404
Merge "Move Tether4Key and Tether4Value to common libs" am: 34e16b9537 am: a1349ad262
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1978067

Change-Id: I0c0571a7a4cbd50d0e8be196885d191e923b8a4c

Nucca Chen   authored and   Automerger Merge Worker   commited 2022-02-09 14:25:25 +00:00
2d4548bd32
Move Tether4Key and Tether4Value to common libs
EthernetTetheringTest needs to parse BPF map content for IPv4
forwarding rule tests. Move the struct class files to common
libs.

Compare Tether4{Key, Value}.java between frameworks/libs/net/common
and packages/modules/Connectivity/Tethering.
There is only the package name change as expected.

$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Key.java
17c17
< package com.android.networkstack.tethering;
---
> package com.android.net.module.util.bpf;

$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Value.java
17c17
< package com.android.networkstack.tethering;
---
> package com.android.net.module.util.bpf;

Test: atest TetheringCoverageTests

Change-Id: I73c180fa4129aefde1e64ecbafe928f388b061d6

Hungming Chen   authored and   Nucca Chen   commited 2022-02-09 10:45:37 +00:00
887a22cc4a
[MS54.3] Move NetworkStats to updatable sources
This CL builds NetworkStats related codes with the
connectivity module instead of platform.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c

Junyu Lai   authored and   Remi NGUYEN VAN   commited 2022-02-07 10:11:40 +09:00
2ef865e0fd
Extract TestBpfMap from BpfCoordinatorTest.
The class is being moved to a common test utils location in
another CL in this topic.

Test: atest BpfCoordinatorTest
Change-Id: Ibf8dae3e05aacaea4f7c3fe8229d87e1ad6a68d5

Lorenzo Colitti   authored and   Patrick Rohr   commited 2022-02-03 22:53:07 +01:00
1705eb9964