Commit graph android_packages_modules_Co.../Tethering/tests
Message SHA1
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
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
Merge "Notify linkproperties change in all scenarios"
Mark Chien   authored and   Gerrit Code Review   commited 2022-02-25 11:13:12 +00:00
cc0dc24205
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
Merge "Rename framework-connectivity-tiramisu to framework-connectivity-t" into tm-dev
Paul Hu   authored and   Android (Google) Code Review   commited 2022-02-22 15:52:11 +00:00
9b6237745a
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
Fix EthernetTetheringTest testTestNetworkUpstream flaky am: 95cb089853 am: 3b9d3c49f6 am: 0bf047ce39
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1878054

Change-Id: Ie5c10b10525db99f98ee66482078970fdc549b93

markchien   authored and   Automerger Merge Worker   commited 2022-02-22 08:18:45 +00:00
5198710f89
Fix EthernetTetheringTest testTestNetworkUpstream flaky
The test assume the first tethering upstream would be test network. But
if there are mutiple networks available, this is a wrong assumption
because of race condtion. If tethering choose upstream while wifi or
celluar is available but test network may not available for tethering yet
(it depend on the NetworkCallback from ConnenectivityService), the first
upstream may not be the test network.

Bug: 215224286

Test: atest EthernetTetheringTest
Change-Id: Idfa972008643f1fb5119179383b06e2c8f65c667

markchien   commited 2022-02-22 12:42:15 +08:00
95cb089853
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
Merge "BpfBitmap Test" am: b194d551bf am: 7fa056c024 am: 993b48a466
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1908038

Change-Id: Iebc2e9ca34e71467a625d3646f1449e8c927b932

Maciej Å»enczykowski   authored and   Automerger Merge Worker   commited 2022-02-18 05:00:38 +00:00
c7ec0f485e
Merge "BpfBitmap Test"
Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2022-02-18 01:55:43 +00:00
b194d551bf
Merge "Add test for IPv4 UDP forwarding rules in BPF map" am: dc62c75b1e am: 77186dd8d4 am: 2aa04bf40c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1864481

Change-Id: Ib79b35356dd831d9618a9dfbf29477b2f6262c8b

Nucca Chen   authored and   Automerger Merge Worker   commited 2022-02-17 05:37:29 +00:00
1bee62cddf
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
BpfBitmap Test
Privileged test case for BpfBitmap.

Test: atest BpfBitmapTest
Bug: 179733303
Change-Id: I9c32d8843176815a725eccfd1f0400ec129cd94d

Tyler Wear   commited 2022-02-15 22:19:58 +00:00
c23ffbdf7e
Add test for IPv4 UDP forwarding rules in BPF map
Parse the dumpsys output strings to check that the IPv4 UDP
forwarding rule is added by the UDP conntrack event on
the tethering interface.

Test: atest EthernetTetheringTest
Change-Id: I2f04af72e51ca6b7a37ba51daa4f5125cb11144c

Hungming Chen   commited 2022-02-15 16:24:22 +08:00
a525e24fbc
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
Add jarjar rule for com.android.testutils.TestBpfMap
TestBpfMap needs to be jarjar'ed to work with ConnectivityCoverageTests
which combines both framework tests and tethering tests (and their
respective jarjar rules).

Test: atest ConnectivityCoverageTests:BpfCoordinatorTest
Change-Id: Ie3e7f0be9aeb848978f0df97be48100c808086bc

Patrick Rohr   commited 2022-02-03 22:53:07 +01:00
3157918fc9
Use new bluetooth API to enable/disable bt tethering after T
This change only apply to the device after T.
Use new bluetooth API to change bluetooth tethering settings and the
new API provide the callback to to notify Tethering when bluetooth
interface is ready. Tethering doesn't use bluetooth interface status
change event from netlink to add/remove IpServer anymore.

Tag: #feature
Bug: 190438212
Test: TetheringTest
Change-Id: Iae92d98d500f83b116da7282cf1130fb8fecf53d

markchien   commited 2022-01-17 16:47:43 +08:00
69681d65a5
Merge "Bump tethering target sdk version to 31"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-13 05:00:02 +00:00
0d4f956b34
Bump tethering target sdk version to 31
Also add BLUETOOTH_CONNECT permission which is needed for access
PanService if target sdk 31+. The permission would be granted to
privilege application without prompt.

Also remove the min_sdk_version 29 from AndroidManifest because it is
useless that the Android.bp already define min_sdk_version 30.

$aapt dump xmltree TetheringNext.apk AndroidManifest.xml
N: android=http://schemas.android.com/apk/res/android
  E: manifest (line=19)
    A: android:sharedUserId(0x0101000b)="android.uid.networkstack" (Raw: "android.uid.networkstack")
    A: android:versionCode(0x0101021b)=(type 0x10)0x1f
    A: android:versionName(0x0101021c)="Tiramisu" (Raw: "Tiramisu")
    A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1f
    A: android:compileSdkVersionCodename(0x01010573)="Tiramisu" (Raw: "Tiramisu")
    A: package="com.android.networkstack.tethering" (Raw: "com.android.networkstack.tethering")
    A: platformBuildVersionCode=(type 0x10)0x1f
    A: platformBuildVersionName="Tiramisu" (Raw: "Tiramisu")
    E: uses-sdk (line=23)
      A: android:minSdkVersion(0x0101020c)=(type 0x10)0x1e
      A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
    ....
    E: uses-permission (line=35)
      A: android:name(0x01010003)="android.permission.BLUETOOTH_CONNECT" (Raw: "android.permission.BLUETOOTH_CONNECT")

Bug: 204265450
Test: manual testing bluetooth tethering and TH
Change-Id: I6f821020679b9379cada29f6f0816187545a24fb

markchien   authored and   Mark Chien   commited 2022-01-12 07:24:16 +00:00
bf62258f8c
Add tethering IPv4 UDP forwarding test
This is a preparation for testing IPv4 BPF offload.
- Add an ARP responder.
- Add a basic UDP forwarding test.

Test: atest EthernetTetheringTest
Change-Id: I720a5a2c4b97493eb6a5570cecd73dfc1eabf5cd

Hungming Chen   authored and   Nucca Chen   commited 2022-01-03 07:16:16 +00:00
bb8e9dae7f
Merge "Support testing upload/download packets"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-12-23 04:22:59 +00:00
139f43509e
Reuse BluetoothPan object and use it under tethering handler thread
1. Instead of create BluetoothPan every time when tethering need to use
it, store it with mBluetoothPan and resue it.
2. Call BluetoothPan function under tethering handler thread.

Bug: 190438212
Test: atest TetheringTests

Change-Id: I40adece59960ec44a02dc438d6bd95483a0788af

markchien   commited 2021-12-16 12:12:07 +08:00
1e020903cc
Merge "[NETD-BPF#3] Relocate Tethering/bpf_progs and rename bpf_tethering_headers"
Ken Chen   authored and   Gerrit Code Review   commited 2021-12-02 12:54:01 +00:00
5fabfd8dd0
Support testing upload/download packets
This is a preparing CL to test the packets sent from clients and the
packets replied from remote side.

Bug: 183166581
Test: atest EthernetTetheringTest
Change-Id: I898de024c0d9ecf13d81023035242c4abf856702

markchien   commited 2021-11-29 18:02:24 +08:00
13e5a48cb7
Add defaults to enable/disable connectivity/tethering next
The defaults can be used to enable/disable connectivity next targets
depending on the branch, while minimizing merge conflicts.

The "next" target may use unstable APIs. It need to be disabled in the
branch which only have the last stable SDK available.

Also correct TetheringTestsLatestSdkLib which should use stable API.

Test: TH
Change-Id: I00d91bbd513277c1cedf67d18ac9f56cc4037309

markchien   commited 2021-11-24 12:20:23 +08:00
598a75ba8c