In order to get counted by mts code coverage, these native tests need to
be run as part of mts.
Bug: 233904825
Test: m mts && mts-tradefed run mts-tethering-coverage
Change-Id: I79313197b146c7043ffb5e164faa46c2e16dd1d2
testUpdateConnectedClientsForLocalOnlyHotspot should not run before T,
but it don't be ignored correctly because missing DevSdkIgnoreRule
setup.
Bug: 233077722
Test: TH
Change-Id: Ib2d241f927ccdc5d2bc392962481ecb86a223e09
Updating the automotive allowed UIDs check to only work if the
capabilities have a single transport equal to ethernet.
Bug: 229419469
Test: atest FrameworksNetTests
Change-Id: I91e987d6b943a3c5986ab88553a6eef0d479b079
This avoids races where NetworkInterface.getByName does not return the interface
right after it is created.
Change-Id: I17a5a22034bafc30023307d5480db18e918fc042
Test: test-only change
Bug: 227008268
Lorenzo Colitticommited 2022-05-19 02:45:16 +00:00
This reverts commit 53eb35cd82.
Reason for revert: b/233081774, caused long build times in FrameworkNetTests
Change-Id: Ide01c994f694b55fc0e87bb0e81584ac44196e68
This is a followup commit for aosp/2017317.
1. Reorder the NAT464 information in dumpsys connectivity
2. Reword message when clat not started
Bug: 212345928
Test: dumpsys connectivity
Change-Id: I31c7066787dc7db8e5fe225f3918368b25bb7f5e
Hungming Chenauthored and Nucca Chencommited 2022-05-18 14:49:57 +00:00
This is meant to optimize dscp_policy bpf verifier time at boot.
Bug: 230585250
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1ecd61db80919e2fa1fcbac00348f10a80b77620
Maciej Żenczykowskicommited 2022-05-18 09:05:32 +00:00
After turning off the ethernet settings via api, the ethernet service
can still be started when plugging-in the cable. Improve the api by
ignoring the upcoming interface unsolicited event listener callbacks
and register new interface observer once the ethernet setting is enabled
again.
Bug: 231933028
Test: atest testListenEthernetStateChange_unsolicitedEventListener
Change-Id: I1b1cb7d157f023fca82d75592168bd360a6fa6e1
Allow ethernet factories on automotive devices to set the allowed UIDs
on NetworkCapabilities.
Bug: 229419469
Test: atest FrameworksNetTests
Change-Id: I03e7cda75f1c530e0d0e4a756330bc9847a96668
Updating EthernetManagerTest to account for existing ethernet
interfaces. Specifically, testCallbacks() assumed the test interface
created would be the only ethernet interface on the device. This would
cause the test to fail if other ethernet interfaces existed.
Bug: 230305098
Test: atest CtsNetTestCases:android.net.cts.EthernetManagerTest
Change-Id: I675c4ef5c2bd96d01a057bdfec1794d6bfcf82bb
The offer is currently not registered, so this won't do anything yet.
Test: atest EthernetServiceTests
Bug: 197548738
Change-Id: Ic0923708619019bb339d1343ff9027a6a670d11c
The service name can include non-ASCII characters. So
NsdService need to have specific handling for these non-ASCII
characters that make resolution working properly.
Note: The unescape() method is the same one that was used in S,
but was removed by mistake.
Bug: 230698801
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I42fc5618aa2d549ceae25f516ad17c78930ea41d
paulhuauthored and Paul Hucommited 2022-05-17 02:29:08 +00:00
Add an CTS test to verify that a service can still be registered
with non-ASCII characters. And the service info can be
resolved successfully.
Bug: 230698801
Test: atest CtsNetTestCases:android.net.cts.NsdManagerTest
Change-Id: I1cb9a558988af5f1264d0ae732ab4b62c0bb8cde
paulhuauthored and Paul Hucommited 2022-05-17 10:27:10 +08:00
In practice this doesn't actually really matter, since older versions
of the bpfloader won't even look in the relevant directories:
BpfLoader v0.9 is the first one that looks into
'/apex/com.android.tethering/etc/bpf/net_shared',
but it is only v0.12 that pins the resulting programs and maps
correctly into
/sys/fs/bpf/net_shared/
hence the annotations for block/clatd/dscp_policy.
BpfLoader v0.13 is the first one that looks into
'/apex/com.android.tethering/etc/bpf/netd_shared'
subdirectory and pins into
/sys/fs/bpf/netd_shared/
hence the annotation for netd.
But it's best to explicitly document the intent.
Note that in practice the mainline module will fail spectacularly
on a T OS if it can't find the programs and maps
(presumably due to the bpfloader being too old)
but will work on S even though the bpfloader there is much older,
because these programs/maps are not required on pre-T OS.
This change is thus really only documentation.
Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5ffa2faf83ca337b84e34b01df84436629989c58
Maciej Żenczykowskicommited 2022-05-16 17:09:58 -07:00
(out of current /sys/fs/bpf/net_shared/...)
This will allow genfscon regexp changes in a followup selinux commit.
Note that this has a hard dependency on system/bpf change
'bpfloader: add support for netd_shared and net_private subdirs'
which also bumps bpfloader to v0.13.
This was merged May 12, 2022 (into both aosp/master and tm-dev)
and it is in Android T starting with Beta 3 release.
This isn't really an issue since amusingly T Beta 2 is already
incompatible with current mainline releases due to the snap
reverting a previous required bpfloader system/bpf change:
move net_shared bpf programs into net_shared subdirectory
See: http://b/232050459#comment14
So this doesn't break T Beta1/2, since they already don't work,
and Beta3 will work.
Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id5f14d6e3f11cfe35d9d8a9496548a2bc4d022ec
Maciej Żenczykowskicommited 2022-05-16 23:24:37 +00:00
S had a minimum kernel requirement of 4.9,
T bumps this up to 4.14, which adds net cgroup bpf support.
It's important to ship T with this otherwise we'll be forced
into trying to somehow support 4.9 kernels with T mainline
module updates for years and years, when we no longer have
any tests of the old code paths...
Test: TreeHugger
Bug: 232017472
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6e873f0815f176f5618278087132156c9974d6ea
Maciej Żenczykowskicommited 2022-05-16 11:04:22 -07:00
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
Currently, even when VPN Lockdown mode is enabled, incoming packets are
not dropped if VPN is not connected.
This commit fixed this issue.
After this commit, If VPN Lockdown mode is enabled, incoming packets
are dropped regardless of the VPN connectivity.
Bug: 206482423
Test: atest TrafficControllerTest ConnectivityServiceTest PermissionMonitorTest
Change-Id: If52ece613c8aac1073355e43b6fb9cb3fcc87d1d
CtsNetTestCases is already run in presubmit, but
CtsNetTestCasesLatestSdk should also pass on HEAD. The only differences
are the target SDK and the shims used (LatestSdk uses latest stable
shims, CtsNetTestCases uses unstable shims). Thus, add
CtsNetTestCasesLatestSdk to presubmit to ensure the tests keep
passing.
Bug: 228286975
Test: atest CtsNetTestCasesLatestSdk
Change-Id: Idaca34fb8a907a6f0017747b47ca89d5306f3ecc
- All tests in NsdManagerTest would be ignored when running
CtsNetTestCasesLatestSdk on android S devices. But
NsdManagerTest#testNsdManager is existed before android T, it
should not be ignored on android S devices. Besides, those
tests can only run after android T have guarded by
ConstantsShim check. Thus, remove DevSdkIgnoreRule on
NsdManagerTest.
- In the legacy NsdManagerTest that covers older APIs, do not use
newer APIs that use executors, and use only older APIs instead.
Bug: 228286975
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.\
NsdManagerTest
Change-Id: I2b4ca568e9819dc0f476f66e43072ddbcfd75a02
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
Remove usage of Ikev2VpnProfileShim and Ikev2VpnProfileBuilderShim.
Both were used to allow the test to build in branches that do not have T
APIs, but all downstream branches now do.
The shims would throw checked exceptions when unsupported methods were
used, not providing fallback behavior, so they can just be replaced by
direct calls in any case.
Bug: 232251248
Test: atest Ikev2VpnTest
Change-Id: I1d5418206fab9f35403eb3baf81363b1286b0b3b