Commit Graph

43139 Commits

Author SHA1 Message Date
Davor Majdandzic
2cdbbc1a32 Competing network interfaces
NetworkRequest is expecting transport type Ethernet or test. This
causes the test 'testApiCallbacks' to fail for devices that have a
non-test Ethernet network since that network is being chosen instead of
the expected test Ethernet network.

Remove network capability TRANSPORT_ETHERNET from CaptivePortalApiTest.

Bug: 204329523
Test: atest android.net.cts.CaptivePortalApiTest#testApiCallbacks

Signed-off-by: Davor Majdandzic <davor.majdandzic@aptiv.com>
Change-Id: Ie7b4d00c08f1497044e63462f1d899d1f3dea2df
2021-11-25 17:37:45 +01:00
Mark Chien
0f56af4162 Merge "Add defaults to enable/disable connectivity/tethering next" 2021-11-24 07:05:00 +00:00
markchien
598a75ba8c 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
2021-11-24 12:20:23 +08:00
Treehugger Robot
73b42b0f95 Merge "isEthernet() - ARPHRD_PPP does not require ethernet headers" 2021-11-22 08:53:28 +00:00
Treehugger Robot
1c4a66ddc4 Merge "Fix a possible flake in disconnectFromWiFi" 2021-11-22 07:34:57 +00:00
Remi NGUYEN VAN
469d941752 Merge "Update NSD tests without AsyncChannel" 2021-11-22 05:58:15 +00:00
Aaron Huang
c7037475fa Merge "Use real ProxyTracker in ConnectivityServiceTest" 2021-11-22 05:25:28 +00:00
Remi NGUYEN VAN
f96ecf2708 Remove unused service and test dependencies
Nothing uses StateMachine in service-connectivity, and
FrameworksNetTestsLib pulled a lot of unused dependencies with
services.core and services.net.

Remove unused dependencies. This helps measure code coverage more
accurately.

Bug: 207020032
Test: atest ConnectivityCoverageTests
Change-Id: I39857865594a3263c4b1deeda23312c8e4f86a77
2021-11-19 21:14:39 +09:00
Maciej Żenczykowski
c8c36b9407 isEthernet() - ARPHRD_PPP does not require ethernet headers
(this is required to make ipv6 tethering work with at least S.LSI modems)

Test: TreeHugger
Bug: 207057951
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic178db928ec7f74f69d7d4739b3b8439ff026625
2021-11-18 23:31:56 -08:00
Treehugger Robot
2c75c0444d Merge "Disable CtsNetTestCases if needed" 2021-11-18 11:43:07 +00:00
Remi NGUYEN VAN
cd4b4ee973 Update NSD tests without AsyncChannel
Update the tests to use the newer NsdManager based on Binder interfaces
instead of AsyncChannel.

Bug: 190249673
Test: atest NsdManagerTest NsdServiceTest
Change-Id: I0991b598331e335a0bc211f010da7f034fb2441b
2021-11-18 18:22:45 +09:00
Maciej Żenczykowski
a457bf7ea8 explicitly specify that offload.o & test.o bpf programs are S+
Note: due to the release version of the Connectivity/Tethering mainline
module being built from sc-mainline-prod, this won't actually take effect
until system/bpf bpfloader at version 0.6+ is merged in to that tree.

This doesn't really matter, since currently things default to v0.0+.
But there is no mainline module updatable pre-v0.2 supported OS
anyway. BpfLoader v0.2 is what shipped in Android S Beta 4 through
Android S Final.

Before S there simply was no bpfloader support for mainline updatable
ebpf code, while S Beta 3 and earlier shipped v0.0 which is badly
incompatible with even the current version of the mainline module.

Additionally v0.0 doesn't even parse this field, while v0.1 which
does was very short lived [~3 days] and can thus be utterly ignored.

As such this change is effectively a no-op, and even post merge
of bpfloader v0.6+ into sc-mainline-prod will still be effectively
a no-op.

So why do it? I want to explicitly document that these programs are S+,
so that I can change the default in the future to be T+.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7e5d0124700c7045abe16b1f3b504c9e88054ff2
2021-11-17 12:04:44 -08:00
Treehugger Robot
d8d887bd39 Merge "Always use OWNERS from master branch." 2021-11-17 07:55:00 +00:00
Maciej Żenczykowski
101f39bb66 Always use OWNERS from master branch.
Since you cannot include yourself we need an extra level of indirection,
to make sure that OWNERS remains current even in historical branches.

Also vastly increase the number of OWNERS

Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I19723fd9fbcee8fe3d8c9386ec5290d2764f2104
2021-11-17 05:58:02 +00:00
Taras Antoshchuk
bc3f86dfa3 Disable CtsNetTestCases if needed
Apply NetworkStackNextEnableDefaults to CtsNetTestCases to disable it
in branches where NetworkStackNext and related targets should not be
built.

Test: presubmit
Change-Id: I850b4294aa4c3c01f8871760185ca7fedc0f8584
2021-11-15 17:40:42 +01:00
Chalard Jean
dece0d805f S- not to crash on NetworkInfo(null) or setDetailedState(null)
When NetworkInfo(null) or setDetailedState(null, any, any) are
called, S used to not crash but plant a null bomb for later
which may explode in some calls (notably, parceling) : see the
bug referenced below for details.

To help catching these errors earlier a patch was made to crash
as soon as one of these methods is called with a null argument,
but this will also crash incorrect use on existing code that
may never actually step on the mine, crashing code that used not
to crash. For safety, implement the new behavior only on T.

Bug: 145972387
Test: NetworkInfoTest
Change-Id: Ib710497d83b2d26439c2bd4d2f572310db97d6fd
2021-11-15 21:18:25 +09:00
Aaron Huang
e3879abb07 Use real ProxyTracker in ConnectivityServiceTest
Currently CS test uses a mock ProxyTracker object to verify that
the sendProxyBroadcast() is called. Also, if the network is a
default network then sendProxyBroadcast() will be indirectly
called in setDefaultProxy(). This only verifies that the method
is called but it doesn't verify that the broadcast is sent.

Instead of testing setDefaultProxy() is called, it is better to
verify that the broadcast is actually sent. Therefore, use a
real ProxyTracker in the test to verify the broadcast is sent.

Test: FrameworksNetTests:ConnectivityServiceTest
Change-Id: Id5c9e07e8326f24bd2665b4bb08f96d6d57d999c
2021-11-15 20:01:12 +08:00
Chalard Jean
05c291e5a3 Fix a possible flake in disconnectFromWiFi
1. There is a theoretical issue where the callback is not yet
   registered when wifi is disabled, but there is no evidence
   of it actually happening
2. 2 minutes timeout makes no sense for these tests that have a
   total 1 minute timeout anyway

Bug: 196387278
Test: CtsNetTestCases
Change-Id: I120af9b312ca34431d0e62dd85233fcdaa1b09b9
2021-11-15 11:58:07 +00:00
Maciej Żenczykowski
ff81692077 Merge changes from topics "rename-libbpfmapjni", "rename-libtetherutiljni"
* changes:
  Rename libbpfmapjni and include bpf common util library
  Rename tethering jni and get the jni by its package name
2021-11-11 13:19:48 +00:00
Treehugger Robot
7eb9f88a6e Merge "replace R + 1 with S" 2021-11-11 07:26:39 +00:00
markchien
782a56809b Rename libbpfmapjni and include bpf common util library
1. libbpfmapjni.so is rename to libnet_utils_device_common_bpf.so
2. net-utils-device-common-bpf.jar is separated from
   net-utils-device-common-netlink.jar

Bug: 205088391
Test: atest TetheringTests
      atest CtsTetheringTest
      atest TetheringPrivilegedTests

Change-Id: If59b35b3429ebd597c18678499ff458183f89026
2021-11-11 13:49:15 +08:00
Remi NGUYEN VAN
4638c093ed Merge "Fix NetworkCapabilitiesTest on S" 2021-11-11 04:42:36 +00:00
Remi NGUYEN VAN
daa03defee Fix NetworkCapabilitiesTest on S
Mark NetworkCapabilitiesTest as ConnectivityModuleTest so that it is
only run in MTS with the Connectivity module installed, and fix
parceling tests to use the right number of fields in that case.

NetworkCapabilitiesTest is only useful to test the Connectivity module,
and not other modules like NetworkStack, as it is a unit test of a class
in the Connectivity module.

Bug: 205901761
Test: atest NetworkCapabilitiesTest
Change-Id: I10ba0f866bc7a39b2c90bdde12a79feefea2d5ee
2021-11-11 12:30:07 +09:00
Maciej Żenczykowski
8834250ef8 replace R + 1 with S
Test: TreeHugger
Bug: 170424293
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I43f53268b6c1605d928ce3431cc95b8a66b6c052
2021-11-10 18:20:01 -08:00
Mark Chien
ea0cfd1897 Merge "Rename tethering util folder and its package name" 2021-11-10 06:08:28 +00:00
markchien
f967b11087 Rename tethering jni and get the jni by its package name
tetherutiljni is renamed to com_android_networkstack_tethering_jni_util

Bug: 205088391
Test: atest TetheringTests
      atest CtsTetheringTest
      atest TetheringPrivilegedTests
Change-Id: Ifd1f4473625e33d3ebe190c9f8a2b5d54aa1ff49
2021-11-10 14:07:24 +08:00
markchien
d02f9af918 Rename tethering util folder and its package name
Move tethering util files from android.net.util into
com.android.networkstack.tethering.util. The goal is move all of
tethering internal files into its own namespace
com.android.networkstack.tethering.util.

Bug: 205088391
Test: atest TetheringTests
      atest CtsTetheringTest
      atest TetheringPrivilegedTests

Change-Id: I6559fb4f873b3cad5b210b10e49df1b6c6914a70
2021-11-09 17:02:47 +08:00
Remi NGUYEN VAN
959d2cb6bd Don't rematch all requests when adding new ones
With the network selection rewrite in S, rematching a single request can
now easily be done; this can be used as an optimization in
handleRegisterNetworkRequests to avoid rematching all requests when
registering a new one.

This can be disabled by a flag that is unset by default,
REMATCH_ALL_REQUESTS_ON_REGISTER.

Test: atest ConnectivityServiceTest
Change-Id: If76f79b41ac88863974f7025624667134bea2570
2021-11-08 19:17:57 +09:00
Treehugger Robot
7269fb17fd Merge "Add TetheredInterface{Request, Callback} interface" 2021-11-08 09:54:54 +00:00
markchien
48e271bdcb Add TetheredInterface{Request, Callback} interface
Define interfaces that match the signature of the existing
EthernetManager.TetheredInterfaceRequest and TetheredInterfaceCallback
classes and make EthernetManager.TetheredInterfaceRequest and
TetheredInterfaceCallback implement/subinterface these interfaces. The
new bluetooth API could also implement these interfaces to make API surface
consistent.

Test: TH would test the existing tests that use the subclass.
Bug: 190438212
Change-Id: I093972c111cb1d921076782492716d5a046be8fc
2021-11-08 16:44:34 +08:00
Mark Chien
7509c7a67e Merge "Separate tethering build target to Tethering and TetheringNext" 2021-11-08 07:29:55 +00:00
Treehugger Robot
27979bd116 Merge "Include the failing stats in stats failure assertions." 2021-11-08 06:20:39 +00:00
Lorenzo Colitti
5156e787f3 Include the failing stats in stats failure assertions.
Currently debugging IpSecManagerTest counter test failures is
difficult because the assertion message does not say how many
bytes/packets were expected.

Add this information to the assertion message.

Bug: 204860049
Test: test-only change
Change-Id: I4e12be9a58a688fcee3362dceb31d9f21e981d6c
2021-11-08 13:25:45 +09:00
Les Lee
b5ee639fe0 Merge "Add test case to test normalize" 2021-11-06 00:54:14 +00:00
Treehugger Robot
aa5532cb6f Merge "Add IFF_MULTICAST to test interfaces" 2021-11-05 20:01:41 +00:00
Les Lee
5299a2b307 Add test case to test normalize
Bug: 194939211
Test: atest -c NetworkTemplateTest
Change-Id: I2f5790b9217357ddcf3f466cec1b2b1afbb47210
2021-11-05 16:59:10 +08:00
Remi NGUYEN VAN
6fc44359eb Add IFF_MULTICAST to test interfaces
This allows using test interfaces for multicast scenarios, such as
testing mDNS behavior.

Test: atest CtsNetTestCases
Change-Id: Ib5d8a997176f910d499021fdcd12c361aff1233d
2021-11-05 17:15:20 +09:00
Remi NGUYEN VAN
defc74fb2f Merge "Use ConnectivityCheckTargetPreparer in CTS" 2021-11-05 04:27:47 +00:00
Maciej Żenczykowski
4e141d9514 Merge "Fix TetheringPrivilegedTests crash" 2021-11-04 10:37:04 +00:00
markchien
5a8c806e55 Separate tethering build target to Tethering and TetheringNext
To avoid much code diverge between aosp and its downstream, we need to
separate the build target which build with latest stable sdk in release
branch and build with unfreeze sdk in dev branch. So we could use new
API with APIshim in dev branch without impacting release branch.

BYPASS_INCLUSIVE_LANGUAGE_REASON=the wording is the file name of
existing file.
Bug: 204265450
Test: m
Change-Id: I949fd83b1eed7461e0b381193b190cf15080bc1b
2021-11-04 08:53:12 +00:00
markchien
45dc794fb4 Fix TetheringPrivilegedTests crash
After separat BpfMap to a library, its package name is jarjar to
com.android.network.stack.util*. Also jarjar BpfMap of
TetheringPrivilegedTests to fix crash in jni registered.

Bug: 179733303
Test: atest TetheringPrivilegedTests
Change-Id: Ia9bc819a44fe26bf2ff7a46351ea60f2eeb02933
2021-11-04 16:40:18 +08:00
Remi NGUYEN VAN
1d1b1fe999 Merge "Move fromStableParcelable to KeepaliveController" 2021-11-04 06:19:17 +00:00
Maciej Żenczykowski
bb4c6073ec Merge "bpfmap: Move to Common Location" 2021-11-04 01:50:15 +00:00
Treehugger Robot
f475961aca Merge "Add permission update logs" 2021-11-02 02:27:56 +00:00
Kimberly Kreider
200e42063c Merge "Replace "mts" with "mts-tethering"." 2021-11-01 23:43:53 +00:00
Treehugger Robot
a200fe8c1c Merge "Shorten a timeout" 2021-11-01 12:19:28 +00:00
Chalard Jean
31ac212428 Merge "Replace mDeps with a custom object" 2021-11-01 10:31:53 +00:00
Chalard Jean
f63e4597a3 Shorten a timeout
This timeout is not very useful but will be incurred every
time

Test: ConnectivityServiceTest
Change-Id: Ia7c76c7c7a148f14844d098be267e16c215776f5
2021-11-01 19:30:10 +09:00
paulhu
819e8625e6 Add permission update logs
Save permission update result when package added /
package removed / setting changed.

Log:
Permission Monitor:
  Interface filtering rules:

  Update log:
    2021-10-27T11:04:23.472 - Package remove: name=com.vzw.apnlib, uid=10001, nPerm=(NONE/NONE), tPerm=UNINSTALLED
    2021-10-27T11:03:38.307 - Setting change: update={}, remove={10001=1}
    2021-10-27T11:02:22.589 - Setting change: update={10001=2}, remove={}
    2021-10-27T11:01:08.615 - Package add: name=com.vzw.apnlib, uid=10001, nPerm=(NONE/NONE), tPerm=NONE

Bug: 204260474
Test: build / flash / adb shell dumpsys connectivity
Change-Id: I889a8f2c82751f227655b39a4281a6f044508a86
2021-11-01 16:35:06 +08:00
Lucas Lin
5bf4cd9a73 Merge "Add tests for testing if [start|finish]Op is called or not" 2021-11-01 08:33:36 +00:00