Commit Graph

8111 Commits

Author SHA1 Message Date
Maciej Żenczykowski
7928fde758 BpfMapTest - adjust paths for bpfloader change
that puts tethering mainline module maps and programs
under /sys/fs/bpf/tethering

Test: builds, boots, atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If57e737168cefe9fe0fe180114c1d61918d20d21
2021-01-20 05:13:08 +00:00
Maciej Żenczykowski
b213e84170 add maze to OWNERS
since there's now bpf code in tethering portion of the codebase.

Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I679b7ba6d5fff49bad4fb2fe7d251875e4cb94b5
2021-01-19 18:31:52 -08:00
Lorenzo Colitti
fab97c22b2 Merge changes Id87b88f6,I67dfba75
* changes:
  [NFCT.TETHER.6] Migrate tetherOffloadGetAndClearStats from netd to mainline
  [NFCT.TETHER.5] Migrate tetherOffloadSetInterfaceQuota from netd to mainline
2021-01-20 02:19:14 +00:00
Nucca Chen
2668d4a0e2 Merge changes I969d6182,Ie73f7b4d
* changes:
  [NFCT.TETHER.4] Migrate tetherOffloadRuleRemove from netd to mainline
  [NFCT.TETHER.3] Migrate tetherOffloadGetStats from netd to mainline
2021-01-19 11:29:22 +00:00
Maciej Żenczykowski
ab44322f9c Merge "move bpf test map into a separate file" 2021-01-19 11:25:13 +00:00
Junyu Lai
f555f4bca7 Merge "Revert "[VCN06.1] Add CTS for request background network"" 2021-01-19 10:24:47 +00:00
Junyu Lai
3660b71c11 Revert "[VCN06.1] Add CTS for request background network"
Revert "[VCN06] Support request background network"

Revert submission 1545847-vcn06

Reason for revert: b/177876289 presubmit failure
Reverted Changes:
I8042ce197:[VCN06.1] Add CTS for request background network
If9aaa87b7:[VCN06] Support request background network

Change-Id: Icd01643cae86c4448eb7105ef0f238b1f10ebc19
2021-01-19 09:06:00 +00:00
Maciej Żenczykowski
e9810ffef1 move bpf test map into a separate file
This allows for better separation of test vs production code:
we will add more test maps and programs here later.

Test: builds
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7b22e3e148ebf43fdf43dc68d0dea354f7627688
2021-01-18 18:36:00 -08:00
Junyu Lai
5b39b66544 Merge "[VCN06.1] Add CTS for request background network" 2021-01-19 01:04:20 +00:00
junyulai
f8370c08be [VCN06.1] Add CTS for request background network
Test: android.net.cts.ConnectivityManagerTest#testRequestBackgroundNetwork
Bug: 175662146
Change-Id: I8042ce1971c728a9f900d090c0c4cabd994820bf
2021-01-18 16:32:33 +08:00
Nucca Chen
6bc18e6d2c Merge "[NFCT.TETHER.2] Migrate tetherOffloadRuleAdd from netd to mainline" 2021-01-18 06:37:23 +00:00
Les Lee
7e9e19c1ea Merge "wifi: Add bridged pre-fix for tethering interface" 2021-01-18 01:21:45 +00:00
lesl
6a953ef4d3 wifi: Add bridged pre-fix for tethering interface
In bridged mode, the tethered interface will include the prefix ap_br_

Bug: 162686273
Test: Manual Test - bridged AP enabled success
and client can connected it and get the IP address
Test: atest -c NetworkStackTests
Test: atest -c FrameworksNetTests
Test: atest -c CtsNetTestCasesLatestSdk
Change-Id: I89ae178c658a42f902199afaed89ec798de54643
2021-01-18 01:21:32 +00:00
Hungming Chen
6971e91d62 [NFCT.TETHER.6] Migrate tetherOffloadGetAndClearStats from netd to mainline
A preparation for updating BPF map in mainline module.

Test: atest TetheringCoverageTests
Change-Id: Id87b88f6dfcdfe5765756442ed880933cd1c6baf
2021-01-15 18:40:55 +08:00
Hungming Chen
67c14b549f [NFCT.TETHER.5] Migrate tetherOffloadSetInterfaceQuota from netd to mainline
A preparation for updating BPF map in mainline module.

Test: atest TetheringCoverageTests
Change-Id: I67dfba750c7303e4aeaf65f5086db1290d176b4d
2021-01-15 18:40:48 +08:00
Hungming Chen
5ea9c4b64a [NFCT.TETHER.4] Migrate tetherOffloadRuleRemove from netd to mainline
A preparation for updating BPF map in mainline module.

Test: atest TetheringCoverageTests
Change-Id: I969d6182a307f46c8ed0a30960deb460ecedd8ea
2021-01-15 18:40:40 +08:00
Hungming Chen
b350d7589f [NFCT.TETHER.3] Migrate tetherOffloadGetStats from netd to mainline
A preparation for updating BPF map in mainline module.

Test: TetheringCoverageTests
Change-Id: Ie73f7b4d9b191e62cfdfe2cfa3360cc7210f17e8
2021-01-15 17:11:12 +08:00
Hungming Chen
dd55b91228 [NFCT.TETHER.2] Migrate tetherOffloadRuleAdd from netd to mainline
A preparation for updating BPF map in mainline module.

Test: atest TetheringCoverageTests
Change-Id: I6f8667bf110dae3e2805c2752ff59e7284a7bce0
2021-01-15 17:10:58 +08:00
Remi NGUYEN VAN
4bf203d065 Skip NetworkAgentTest on R-
NetworkAgent is not updatable on R-, so there is no need to run tests
compiled against S on older platforms. They are also incompatible
because NetworkAgent stopped using AsyncChannel in S.

This only affects MTS, and CTS used to test S+ devices. CTS for R-
devices is already cut in a branch that this change will not merge to.

Bug: 177290955
Change-Id: I85c137a1b5fd7ef701fba4623566df5a8fb707a3
Test: atest CtsNetTestCasesLatestSdk
2021-01-15 07:45:29 +00:00
Maciej Żenczykowski
539d0e27cf Merge "Use header module bpf_syscall_wrappers" 2021-01-14 07:36:50 +00:00
Treehugger Robot
26b0cf3261 Merge "Net CTS: move NsdManagerTest from Wifi CTS" 2021-01-14 03:51:17 +00:00
David Su
cd1851e0a2 Net CTS: move NsdManagerTest from Wifi CTS
NsdManagerTest is not owned by Wifi, so it doesn't
belong in Wifi CTS.

Bug: 176902925
Test: atest CtsNetTestCases
Change-Id: I8eb3cba7a3b2ff24a012cca8d3fdff173e88c69a
2021-01-14 03:47:25 +00:00
Hungming Chen
400702b6bb Use header module bpf_syscall_wrappers
Use the versioned header library instead of just including
the header files.

Test: atest BpfMapTest
Change-Id: Icf23dcdc051a4ead6a7c6e925159cdc27f49eac2
2021-01-13 14:31:28 +08:00
Patrick Rohr
99f6c312ef Merge "Add CTS test for Restricted Networking Mode" 2021-01-12 17:41:19 +00:00
Hungming Chen
7d05e6fddd Follow-up CL to the change at aosp/1498277
1. Correct the API annotation.
2. The entry deletion failure causes the exception in cleanTestMap().
3. Use AtomicInteger to be the counter in the lambda.

Test: atest BpfMapTest
Change-Id: I4a56038881a38bda993ef5303b71f0e2a99f03d1
2021-01-12 19:08:15 +08:00
Nucca Chen
12067258b2 Merge "Provide a easy way to access bpf maps from java" 2021-01-12 08:06:03 +00:00
Remi NGUYEN VAN
73fa31b404 Merge "Revert^2 "Add service-connectivity to tethering APEX"" 2021-01-12 01:35:30 +00:00
markchien
7052688dde Provide a easy way to access bpf maps from java
A wrapper for bpf map opening, reading/writing, and iteration.

Bug: 173167302
Test: atest BpfMapTest

Change-Id: I792b41978b322c9e4969cd7b6c35d6978ab86bc4
2021-01-11 17:43:27 +08:00
Patrick Rohr
4df8a7aef1 Add CTS test for Restricted Networking Mode
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Bug: 175281879
Bug: 170323671
Change-Id: Ic69e7e029debeea1f131242fb2baad2796d4768c
2021-01-11 09:47:04 +01:00
lucaslin
ee661dfb59 Move BaseNetdUnsolicitedEventListener to frameworks/libs/net
Move BaseNetdUnsolicitedEventListener to frameworks/libs/net and
create a new library - netd-client for using.
Also remove netd_aidl_interface-unstable-java since netd-client
links to the stable one.

Bug: 174837473
Test: Manual test and check the log.
Change-Id: Id65142b8c13a6cccbfe387d4ab757967497546e6
2021-01-08 01:55:53 +00:00
Remi NGUYEN VAN
2812f607a0 Revert^2 "Add service-connectivity to tethering APEX"
Add the connectivity service JAR to the tethering APEX.
This change should not be released in monthly updates until the
modularization work is done, so will be reverted in module release
branches.

This rolls forward the change. The original topic was reverted because
of a bad merged-in clause; this is fixed and re-verified in this topic.

Test: Boot, wifi connects and has internet access
Bug: 171540887

Change-Id: Ib0ac49609e444a53a6fee4575f5078e15f364eef
2021-01-08 01:24:36 +00:00
Sudheer Shanka
edb6669cf1 Merge "Increase the wait timeout for meteredness to change." 2021-01-07 22:56:48 +00:00
Treehugger Robot
4f430ae5ec Merge "Revert "Add service-connectivity to tethering APEX"" 2021-01-07 15:25:03 +00:00
Pete Bentley
850ca6f6b4 Revert "Add service-connectivity to tethering APEX"
Revert "Set setCurrentProxyScriptUrl as public"

Revert submission 1532910-connectivity_jar_in_apex

Reason for revert: Breaks boot tests: b/176969905
Reverted Changes:
Ie41a5b569:Set setCurrentProxyScriptUrl as public
Id7b6a4664:Move service-connectivity to the tethering APEX
Ia7cb83834:Add service-connectivity to tethering APEX

Change-Id: I9f31d4810a92e620f02cc8d24bdf18fe28001a2b
2021-01-07 13:51:18 +00:00
Lorenzo Colitti
7998551cdc Merge "Add service-connectivity to tethering APEX" 2021-01-07 08:34:25 +00:00
Remi NGUYEN VAN
bd5cc4231d Add service-connectivity to tethering APEX
Add the connectivity service JAR to the tethering APEX.
This change should not be released in monthly updates until the
modularization work is done, so will be reverted in module release
branches.

Test: Boot, wifi connects and has internet access
Bug: 171540887
Merged-In: Ic496cd62be8c90928ccc619519ebe517beea78f0

Change-Id: Ia7cb83834b854e8c495c4ef17ec69ad032509208
2021-01-07 06:17:33 +00:00
Lorenzo Colitti
c9c51b665d Merge "Migrate away from AsyncChannel in NetworkAgent" 2021-01-06 14:10:21 +00:00
Sudheer Shanka
796f29c09e Increase the wait timeout for meteredness to change.
Bug: 170241174
Bug: 174808291
Test: atest CtsHostsideNetworkTests:HostsideRestrictBackgroundNetworkTests
Change-Id: I3af17819a403958d88a30af7f6346e5bb96b2828
2021-01-05 06:37:56 +00:00
Chalard Jean
4f896db6ff Migrate away from AsyncChannel in NetworkAgent
Use two oneway binder interfaces instead.
The interfaces post messages to handlers as was implemented before, but
provide a more strictly defined interface, with less hops between
NetworkAgent, AsyncChannel, and ConnectivityService.

Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Merged-In: Ica51d0179bcb3b4e314d2c3e85709aead6ca5657

Change-Id: Ica51d0179bcb3b4e314d2c3e85709aead6ca5657
2020-12-25 11:11:32 +09:00
Treehugger Robot
561f38a799 Merge "Also update connected clients for local only tethering" 2020-12-23 11:36:34 +00:00
markchien
f50f05ebcb Also update connected clients for local only tethering
mForwardedDownstreams is the set of downstreams who wanted upstream.
In other word, it don't contains localOnly tethering(e.g. local only
hotspot, wifi p2p tethering). Changing the list from mForwardedDownstreams
to mNotifyList make both tethered and localOnly tethering have connected
clients callback.

Bug: 172290164
Test: atest TetheringTests
Change-Id: I58fdb28efc616b00d63a1c237ea93aee4d8f2dcd
2020-12-22 23:23:09 +08:00
Chalard Jean
fab11bb263 Merge "Move module utils to the module package." 2020-12-21 05:35:09 +00:00
Remi NGUYEN VAN
abb46bef36 Fix timeout on NetworkAgentTest callback
All callbacks in the class use the DEFAULT_TIMEOUT_MS, except for this recently
added test.

The test is currently flaky in various branches.
Fixes: 174716714
Fixes: 174691729
Change-Id: I9f4446bb83eb4402c912292ac31d46e1d2cb6a52
Test: TH
2020-12-16 06:29:20 +00:00
Chalard Jean
d2df5729f6 Move module utils to the module package.
Test: FrameworksWifiTest FrameworksNetTest
Merged-In: Ib04bebb061dc64d6d685116b596fb3179d5b959a
Change-Id: I9118da3898d864c7bf0ed7bc9d94b94343c4a084
2020-12-16 11:44:34 +09:00
Remi NGUYEN VAN
9b6b353b5d Move cts/net/TEST_MAPPING to toplevel
The tests should just be run on any change in packages/modules/Connectivity,
not just changes in the CTS package.

Change-Id: I1c86c402f39a8a9b84e7422445df289c3ea7842f
Test: TEST_MAPPING needs to be verified by TH
2020-12-15 09:39:58 +00:00
Orion Hodson
b5e3c63b72 Merge "Use libnetjniutils for JNI File Descriptor info" 2020-12-15 06:25:38 +00:00
Lorenzo Colitti
678d27faca Merge changes from topic "cs-generalize-underlying-networks"
* changes:
  Update NetworkAgentTest to support generalized underlying networks.
  Minor fixes to NetworkAgentTest.
2020-12-14 05:19:49 +00:00
Lorenzo Colitti
ed1211d2d8 Update NetworkAgentTest to support generalized underlying networks.
Currently, when an agent calls setUnderlyingNetworks, the
transports of the network are hardcoded to TRANSPORT_VPN only.
This is being fixed in another CL in this topic. The new code
reports the same transports sent by the agent.

This test registers an agent with TRANSPORT_TEST|TRANSPORT_VPN.
Update the test to expect both transports in the callbacks it
receives.

Bug: 173331190
Test: passes when run with other CL in topic
Change-Id: Iede61d74fa02a4fec1f345f6d18835c1acab7337
2020-12-12 22:57:06 +09:00
Lorenzo Colitti
cc3e994f16 Minor fixes to NetworkAgentTest.
- Use a more realistic routing config (instead of a LinkAddress
  with prefix length 0, an address with a mask of 32 and a
  default route).
- Use InetAddresses to parse IP addresses since it's a public API.
- Import the NET_CAPABILITY_xxx and TRANSPORT_xxx constants for
  readability.

Bug: 173331190
Test: test-only change
Change-Id: I9703d7dd5781f60fb3d531267d3f5370cbccd64f
2020-12-12 22:57:05 +09:00
Orion Hodson
e5bd0dba21 Use libnetjniutils for JNI File Descriptor info
Drops use of deprecated API in libnativehelper and uses a common
helper that will be stable across releases.

Bug: 158749603
Test: m
Change-Id: Ic1a1811ffb9a1c207f562a180417e99df31e3502
2020-12-11 22:48:10 +00:00