Commit graph android_packages_modules_Co.../Tethering/tests
Message SHA1
[TestOnly] Use probeV4TetheringConnectivity in getClatIpv6Address
Test: atest EthernetTetheringTest
Change-Id: Ib741e4f9cd452c7ce37e829210d30046a9f391ef

Mark   commited 2022-06-14 04:38:33 +00:00
06238c1aa6
[TestOnly]Create TetheringTester in initTetheringTester
If tethering's upstream have ipv6, the #initTetheringTester
would make sure ipv6 tethering connectivity is ready for testing.

Test: atest EthernentTetheringTest

Change-Id: Iade99eeb95fa94483248799eb852a81662bbb1e0

Mark   commited 2022-06-13 09:01:53 +00:00
01971ad969
[TestOnly] Move isExpectedUdpPacket into TetheringTester
isExpectedUdpPacket and isIcmpv6Type is similar util, put them in the
same place and have isExpectedIpPacket to share the ip/eth parsing code.

Test: atest EthernetTetheringTest
Change-Id: I3ede46f5ff1799f575fad7aca277f2bc0bf6c391

Mark   commited 2022-06-13 09:01:42 +00:00
73284988cd
[TestOnly]Remove RemoteResponder from TetheringTester
This is no-op change. Originally RemoteResponder design for providing a
base responder that user could extend it like DnsServerResponder,
TcpResponder, UdpResponder. But actually user could just simply extend
TetheringTester that make RemoteResponder useless. Thus, remove it to
simply the code.

Test: atest EthernetTetheringTest
Change-Id: I47b22a1460ca312c678778143033aadf5e3e0b82

Mark Chien   authored and   Mark   commited 2022-06-13 09:00:27 +00:00
03693623c1
Merge "[TestOnly] Replace isRouterAdvertisement with isIcmpv6Type"
Mark Chien   authored and   Gerrit Code Review   commited 2022-06-08 02:15:53 +00:00
4fcf168399
[TestOnly] Replace isRouterAdvertisement with isIcmpv6Type
Test: atest EthernetTetheringTest
Change-Id: I5dca7a05a982139d8fc6f8272c8b829b74a34722

Mark   commited 2022-06-07 15:29:34 +00:00
6078d6edd6
Skip testTetherClatUdp before S
The test does not pass on R.

Bug: 234727688
Test: atest EthernetTetheringTest
Change-Id: I831859e521b026ed4acb84de5857a7d3ec318ba5

Remi NGUYEN VAN   commited 2022-06-03 12:04:23 +09:00
8b56874caa
Revert "Revert "EthernetTetheringTest: add testTetherClatUdp""
This reverts commit 5bbd292bed.

Bug: 215655463
Change-Id: I06490001b06446b6a4ff3dc084ce11e8ebbe17f8
Test: atest ConnectivityCoverageTests

Remi NGUYEN VAN   commited 2022-06-03 02:55:26 +00:00
e78cfa130b
Revert "EthernetTetheringTest: add testTetherClatUdp"
This reverts commit b0274cf796.

Reason for revert: Breaks presubmit: b/234727688

Change-Id: I736752dca3707588a525f28d208bdb20f7280972

Remi NGUYEN VAN   commited 2022-06-03 02:32:48 +00:00
5bbd292bed
EthernetTetheringTest: add testTetherClatUdp
Bug: 215655463
Test: atest ConnectivityCoverageTests
Change-Id: Id5d237b96b1d171c1e353cfd0aeba5aa4606fcc7

Hungming Chen   commited 2022-06-02 12:07:13 +08:00
b0274cf796
Merge "Add tethering icmpv6 forwarding test"
Mark Chien   authored and   Gerrit Code Review   commited 2022-06-01 15:15:37 +00:00
86a800f911
Merge "Bump tethering target sdk to 33"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-01 08:57:46 +00:00
d10244feb8
Add tethering icmpv6 forwarding test
Bug: 183166581
Test: atest EthernetTetheringTest

Change-Id: I77ad4a468530f3ef834cd7b72e585798a23f64c3

markchien   authored and   Mark Chien   commited 2022-05-31 23:53:47 +08:00
a40f2fe746
Bump tethering target sdk to 33
Note: to avoid missing some dependeices change only happen in T+, below
testing verification is perform by internal branch.

Test: atest TetheringTests
      atest TetheringIntegrationTests
      atest CtsTetheringTest
      atest MtsTetheringLatestSdk
      manually change entitlement check recheck period to 1 min and
      monitor schedule alarm works.
      Dogfood this change personally 7 days, major use hotspot sharing network to notebook to work.
Bug: 232193147
Change-Id: I3cba98f42ac1a9c0c1db4b2ad036aff714a428f3

Mark Chien   commited 2022-05-31 03:31:18 +00:00
d25a1e05ae
Merge "Test testTetherUdpV4AfterR only verify bpf in precise kernel range"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-27 19:03:58 +00:00
875daa69eb
Test testTetherUdpV4AfterR only verify bpf in precise kernel range
Use three-part kernel version numbers to check which device
needs to verify BPF offload. Only check major and minor number
is not enough. Ex: mixed build T + R may have an unsupported kernel
version 4.19.160 (require 4.19.176+). Now check the subminor
number as well.

For UDPv4 support, kernel require 4.14.222+ 4.19.176+ 5.4.98+, 5.8.0+

Test: atest EthernetTetheringTest (raven @ internal master build)
Test: cts test (bramble @ T + R mixed build)
> run cts-on-gsi -m CtsTetheringTest -t android.net.EthernetTetheringTest#testTetherUdpV4AfterR

Bug: 232332847
Change-Id: I466df73b0fa35b086a2c5e11f8624c84eb79c8fd

Hungming Chen   commited 2022-05-27 22:15:24 +08:00
d7e713283d
Fix incorrect sdk version check in SCV2 device test
Test: atest ConnectivityCoverageTests:com.android.networkstack.tethering.OffloadControllerTest
Bug: 229190480
Change-Id: I4e37a9d6634daac14ef41ab30ab986b2e96dacd4

Frank   commited 2022-05-24 13:55:03 +08:00
a632356e05
Merge "fix BpfMapTest"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-05-20 07:44:13 +00:00
e273ba1e21
Fix testUpdateConnectedClientsForLocalOnlyHotspot
testUpdateConnectedClientsForLocalOnlyHotspot should not run before T,
but it don't be ignored correctly because missing DevSdkIgnoreRule
setup.

Bug: 233077722
Test: TH
Change-Id: Ib2d241f927ccdc5d2bc392962481ecb86a223e09

Mark Chien   commited 2022-05-19 21:14:21 +08:00
7e4eab5153
Merge "Register localOnly softapCallback for local only hotspot"
Mark Chien   authored and   Gerrit Code Review   commited 2022-05-17 09:07:38 +00:00
46c86bbf82
Prepare for refactoring wifi ipserver start/stop
This is a preparing change.
1) In enableWifiIpServing, replace
   ensureIpServerStarted(ifname) +
   changeInterfaceState(ifname, ipServingMode)
   with enableIpServing(TETHERING_WIFI, ifname, ipServingMode).

   And checking whether corresponding wifi or p2p feature is
   avaialble before enableWifiIpServing. Note: If the wifi or p2p
   feature wasn't supported before, it would still call
   changeInterfaceState without ipServer created but
   changeInterfaceState would be no-op because there is no
   corresponding ipServer for changing state.

2) Splitting enableWifiIpServing into enableWifiIpServing and
   enableWifiP2pIpServing.

3) No longer guess the interface name after T. WIFI_AP_STATE_CHANGED
   intent should always include ifname and it should be tracked by
   mTetherStates. If OEM have modification in wifi framework to send
   empty ifname, tethering no longer support this after T.

4) After T, tethering always trust the ifname which pass by wifi or p2p
   intent broadcast and treat it as TETHERING_WIFI or
   TETHERING_WIFI_P2P. This allow tethering to deprecate wifi/p2p regexs
   after T.

Bug: 189410000
Bug: 178116595
Bug: 185451791
Bug: 190145323
Bug: 176048959

Test: atest TetheringTests

Change-Id: Ia5f69ddf2d842536ce0df75eeae57866f56df571

markchien   commited 2022-05-16 21:17:40 +08:00
f2e9409f55
Register localOnly softapCallback for local only hotspot
Before T, wifi local only mode won't update onConnectedClientsChanged.
To support updating tethered client information for localOnly hotspot,
register localOnly softap callback to get connected wifi client update.

Bug: 171928468
Test: atest TetheringTests

Change-Id: I0e974feea9497809ea02a4138c7b9c2c584a8a45

markchien   commited 2022-05-16 15:09:10 +08:00
4ccb419602
Merge changes from topic "tethering_metrics"
* changes:
  Add tethering stats into statsd
  Injecting tethering stats into statsd

Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-16 05:06:01 +00:00
42f38d0bdf
fix BpfMapTest
to account for close() becoming a no-op

Bug: 230880517
Test: TreeHugger, atest com.android.networkstack.tethering.BpfMapTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I69f25ff168c1cf0f13434dd1d842ed81a6a03f2f

Maciej Żenczykowski   commited 2022-05-13 14:59:13 +00:00
4426a84111
Add tethering stats into statsd
Bug: 153942334
Test: atest TetheringTest IpServerTest
Test: Manual test with statsd_testdrive
Change-Id: I7205bb24dd30ba78b79bc352034da299d452750f

Wayne Ma   commited 2022-05-12 17:21:11 +08:00
6cd440fedd
Catch new exceptions from BpfMap
Bug: 230880517
Test: atest FrameworksNetTests
Change-Id: I9eff2589f83ac109fb6e8b9906da05890daa9bd9

Hungming Chen   commited 2022-05-12 14:13:01 +08:00
374107963a
Injecting tethering stats into statsd
Fill in downstream type, upstream type, error code and user type to NetworkTetheringReported.

Bug: 153942334
Test: m, flash and boot
Test: atest TetheringMetricsTest
Change-Id: I6ba7d9e512b1ada519f44f9f3a95667e4b0f03c0

Wayne Ma   commited 2022-05-09 19:35:53 +08:00
7ecded8248
Ignore UDP offload test on kernel which is older than 4.14
Kernel version which is older than 4.14 doesn't support UDP offload
absolutely. Kernel version which is between 4.14 and 5.8 support UDP
offload probably. Simply set kernel 4.14 to be threshold first and
monitor on what devices tests fail for improving the offload support
checking.

Also fix a minor bug which UDP tethering without offload is not tested
on R.

Bug: 230359047
Test: atest EthernetTetheringTest
Change-Id: Ieb181d1b5ed67b922e18ce77a9c96208b2984d10

Hungming Chen   authored and   Nucca Chen   commited 2022-05-05 09:35:00 +00:00
08c48a3dff
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
Add bpf forwording packet count test
- Add dumpsys option to dump stats map in BpfCoordinator
- Add stats test to check bpf forwording packet count in
  EthernetTetheringTest

Bug: 227159997
Test: atest TetheringCoverageTests
Change-Id: I177787ed0c28ebe137ff1431f40a23b1e4b22a19

Hungming Chen   authored and   Nucca Chen   commited 2022-04-20 08:54:08 +00:00
e32dbded7c
BpfCoordinator: Add an option to choose which raw bpf map to dump
Make that tethering dumpsys can choose which map to dump.
The related functions in BpfCoordinator and its test are refactored
into template functions. This is used in the following commits which
will dump stats map for testing.

Bug: 227159997
Test: atest TetheringCoverageTests

Change-Id: I23d747543d16a971773c132b60227eb3f42efe25

Hungming Chen   commited 2022-04-20 15:58:47 +08:00
e4a6b28938
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"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-04-19 08:35:03 +00:00
8315d1cf03
Merge "ConnectivityCoverageTests refactoring"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-04-07 01:22:17 +00:00
1ae9c4ad07
ConnectivityCoverageTests refactoring
ConnectivityCoverageTests is a combination of several test libs, which
are jarjared differently. It causes duplicated classes not to be counted
for coverage properly. Build the test suite directly and apply jarjar
only once on top of everything.

Bug: 227694415
Test: atest ConnectivityCoverageTests

Change-Id: I4350ebdbf98030944ec3857e1ef67d76f26c3b16

markchien   authored and   Remi NGUYEN VAN   commited 2022-04-06 19:35:28 +09:00
e59f5e36e5
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}
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"
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."
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
* 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"
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
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