Commit Graph

43184 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
eef1e2033d Merge "Move TestableNetworkAgent to Common Util Location" 2021-12-14 12:49:15 +00:00
Jean Chalard
ec3013ddf4 Merge "Mark arg to NC#appliesToUidRange non-null" 2021-12-14 12:17:27 +00:00
Jean Chalard
5469fa6e59 Merge "Remove NetworkCapabilities#combine*" 2021-12-14 10:47:31 +00:00
Aswin Sankar
5d16f41639 DnsException: run only on T+ versions
- Test was failing on S mainline builds. Fixing forward.

Bug: 210540375
Test: CtsDnsResolverTests.
Change-Id: Ia980965c8ee1b9ddae99f593628f8b7ecfeca394
2021-12-14 02:44:54 +00:00
Chalard Jean
2873428835 Mark arg to NC#appliesToUidRange non-null
This is always non-null, and if it's not it has a good
chance to throw anyway

Test: m
Change-Id: I1020ab9e6eb546390325cf6aa4d30183b2e69785
2021-12-13 21:55:56 +09:00
Chalard Jean
bdf4f2987d Remove NetworkCapabilities#combine*
This is no longer used outside of tests, and can be safely
removed.

Also this family of methods is fairly confusing, as while
it's well defined for some members, many later additions
had to be written so as to dissallow some combinations when
the workings of this family of methods didn't match the
semantics of some members, making them possibly dangerous
to use and at least exhibit difficult to understand semantics.

Test: FrameworksNetTests
      m
Change-Id: Ia69c20afa16c2153839891f6e33331caa9da33ff
2021-12-13 21:15:34 +09:00
Treehugger Robot
0db3016398 Merge changes from topic "DnsException"
* changes:
  CTS DnsResolverTest for DnsException ctor
  DnsResolver: Make DnsException ctor public
2021-12-13 07:48:28 +00:00
Aswin Sankar
85509fb3e4 Merge "DnsResolverTest: Use AndroidJUnit4.class" 2021-12-13 06:28:08 +00:00
Jean Chalard
bbb7ae75d1 Merge "Fix an issue where OEM pref tests don't clean up correctly" 2021-12-13 02:06:38 +00:00
Mingguang Xu
4df5d1fdd2 Add CTS for DhcpOption
Bug: 177278970

Test: this
Change-Id: Ia9a9384cb39c049253ead8f7eb594505ccf08333
2021-12-10 23:26:36 +00:00
Mingguang Xu
0a416b65b1 Merge "Create DhcpOption object and make it a SystemApi" 2021-12-10 19:43:02 +00:00
Aswin Sankar
ca942be00d CTS DnsResolverTest for DnsException ctor
- Adds a CTS test to verify that DnsException
can be subclassed and its constructor re-used.

Test: Adds testDnsExceptionConstructor() CTS test.
Bug: 208479811
Change-Id: Ia1dffe8ad5252b61af5a6ef0f6630f075081a6d1
2021-12-10 19:30:20 +00:00
Aswin Sankar
74cbfd5aab DnsResolver: Make DnsException ctor public
Making the DnsException constructor public is useful for apps
using DnsResolver to write their tests, and for internal packages
that may want to implement the DnsResolver.Callback interface.

Test: for regression; CTS tests in b/208479811
Bug: 208464882
Change-Id: I14641688f53721c96e6df9596a7506912ba3aec0
2021-12-10 19:30:20 +00:00
Aswin Sankar
6ed0167930 DnsResolverTest: Use AndroidJUnit4.class
These CTS tests previously extended AndroidTestCase, which made useful
annotations like 'DevSdkIgnoreRule' not take effect.

Test: CtsNetTestCasesLatestSdk
Bug: 208479811
Change-Id: I79f7e48167bb3bfbd4f6cde33d7e3907c2af6f74
2021-12-10 19:30:15 +00:00
Treehugger Robot
7577131341 Merge "[MS07.2] Move NetworkStatsCollection/IdentitySet into frameworks" 2021-12-10 18:48:52 +00:00
Mingguang Xu
2d87c6152d Create DhcpOption object and make it a SystemApi
This allows OEM apps to pass their custom DHCP options for establishing
network connection.

Bug: 177278970

Test: atest FrameworksNetTests
Test: atest NetworkStackTests

Signed-off-by: Mingguang Xu <mingguangxu@google.com>
Change-Id: I2b8c38ee9a948ad6edb666312c989d27a8ff904b
2021-12-09 19:37:40 -08:00
Junyu Lai
e9710f0918 [MS07.2] Move NetworkStatsCollection/IdentitySet into frameworks
These files are needed for the data migration util system Api
interfaces. Thus, they need to be moved into frameworks folder.

This change also set the @IgnoreUpTo annotation to S, since
these tests are testing purely platform code on S- devices which
is not really necessary for MTS. Also the tests are still covered
by the unit tests, since they are always verifying HEAD.

Test: TH
Bug: 197717846
Change-Id: I93c19b4860864c724be9f9f889ee2173f4605198
2021-12-09 08:43:16 +00:00
Benedict Wong
b1c6bf8ece Merge "Add additional IPsec owners" 2021-12-08 18:31:58 +00:00
Benedict Wong
40ba93d4cc Add additional IPsec owners
Test: Owners file changes only; no code changes
Change-Id: Ifd6ae33c68e72ad4c07abc4342ccbacebe86c220
2021-12-08 06:57:51 +00:00
Chiachang Wang
81bc609550 Merge "Enable strict_updatability_linting in connectivity src" 2021-12-08 02:36:16 +00:00
Paul Hu
5c3c3af9b6 Merge "Remove NsdSettings from test" 2021-12-07 05:43:44 +00:00
Treehugger Robot
f575d053d4 Merge "Flake fix : Wait setting applied before returning from setConfig" 2021-12-06 06:27:54 +00:00
Tyler Wear
a7dd5f1f4a Move TestableNetworkAgent to Common Util Location
To prep TestableNetworkAgent being accessible for multiple
tests, move to common location.

Change-Id: I6c06ac926af003877a0f919e3b1403291d814f13
2021-12-03 10:11:28 -08:00
paulhu
850bd91c3a Remove NsdSettings from test
NsdSettings has been removed from NsdService, so the test needs
to update accordingly.

Bug: 206702844
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I23b6323b2d870746737370b9a3fc90e530e3d2ed
2021-12-03 22:26:39 +08:00
Ken Chen
3f8d3ff9bf Merge "[NETD-BPF#4] Move bpf_shared.h from netd to module" 2021-12-03 08:15:06 +00:00
Ken Chen
5fabfd8dd0 Merge "[NETD-BPF#3] Relocate Tethering/bpf_progs and rename bpf_tethering_headers" 2021-12-02 12:54:01 +00:00
Treehugger Robot
5b98fb05d6 Merge "Ensure created fd being closed" 2021-12-01 10:49:26 +00:00
Chiachang Wang
0209c36662 Ensure created fd being closed
If exception s thrown while calling bindSocket(fd), the temporary
created ParcelFileDescriptor may not be closed as expected.

Ensure it's closed eventually.

Bug: 206042872
Test: atest FrameworksNetTests
Change-Id: Icde895978ab9281006ffd56335d1247462d9da28
2021-12-01 14:46:29 +08:00
Chalard Jean
132ff9ef2e Remove the legacy int policy from NetworkRanker
This code is now dead and can't be resurrected. It can safely
be removed.

Test: FrameworksNetTests
Change-Id: I7bc2ce3d43a92e463b6aed73914c3f7a3a0c8103
2021-11-30 20:00:55 +09:00
Chalard Jean
5d76f2b6e4 Fix an issue where OEM pref tests don't clean up correctly
An exception is thrown in finally{} before the last cleanup
step which is not executed, wreaking havoc on the device
networking state.

Test: CtsNetTestsCasesLatestSdk
Change-Id: I645466b1418c038aadd301847ad4be445206f5de
2021-11-30 20:00:16 +09:00
Chalard Jean
8d094daba9 Flake fix : Wait setting applied before returning from setConfig
Test: DnsResolverTest
Change-Id: I2e8d487a736d84ab37caf5a9aa95751ddd383588
2021-11-30 16:50:15 +09:00
Treehugger Robot
44a20af4a3 Merge "Competing network interfaces" 2021-11-29 09:31:30 +00:00
Paul Hu
5e3ef685ef Merge "Simplify the permission update conditions" 2021-11-29 05:31:14 +00:00
Paul Hu
6fafdc1548 Merge "Save uid netd network permissions" 2021-11-29 03:27:33 +00:00
paulhu
7bbffbd7d8 Simplify the permission update conditions
Bug: 192431153
Test: atest FrameworksNetTests
Change-Id: Ibef4f3b26932a3d12959e2e1d585e184a4ec73cb
2021-11-26 16:14:47 +08:00
paulhu
b2d5b054d3 Save uid netd network permissions
PermissionMonitor only saves netd network permissions by appId.
Then apply same permision to uids which are same appId. But
UIDS_ALLOWED_ON_RESTRICTED_NETWORKS can allow single uid has
restricted network permission. Thus, save the netd network
permissions by uid that can apply different permission to each
uid.

Bug: 192431153
Test: atest FrameworksNetTests
Change-Id: I942cbe0fa30758a7497c47a1b684ed70c4e3b09e
2021-11-26 14:47:01 +08:00
Aaron Huang
93d437ba0c Merge "Remove TODO that was already done" 2021-11-26 04:00:44 +00:00
Treehugger Robot
b031a2265e Merge "Stop skipping VPN tests when running ADB over TCP." 2021-11-26 03:30:45 +00:00
Chiachang Wang
3bc5276568 Enable strict_updatability_linting in connectivity src
Bug: 188851968
Test: m lint-check
Change-Id: I3cd06ea16f05cb37d9369a48dd0285d8239fd764
2021-11-26 10:31:58 +08:00
Treehugger Robot
edfb9232f0 Merge "better compatibility for unusual Qualcomm/Mediatek cellular ARPHRD_* values" 2021-11-26 01:25:13 +00:00
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
Maciej Żenczykowski
23ff703f7a better compatibility for unusual Qualcomm/Mediatek cellular ARPHRD_* values
see kernel/private/wembley/+/refs/heads/tm-4.19/include/uapi/linux/if_arp.h
which has #define ARPHRD_PUREIP 520 (and is a Mediatek based device)

or Qualcomm based Pixel 3 and older kernels (<=4.9) which #define ARPHRD_RAWIP 530
(unlike Pixel 4/5 which are 4.14/4.19 and use the upstream ARPHRD_RAWIP of 519)

We stop supporting 520/530 starting with 5.11+ since those as GKI 2.0 only kernels
cannot be using non-upstream-ed constants (btw. this is probably true for 5.10-S
as well, but let's play it safe).  For pre-5.11 we're lucky because even now
(with 5.15 released) upstream has yet to define an ARPHRD_* for either one of
520 or 530, so there's no harm in 'squatting' on this unused space.

This approach also means there's absolutely no change in behaviour on
pre-launch-T devices, since they all are at most running 5.10 kernels.

We'll be able to get rid of this code in the far future once we stop shipping
mainline tethering updates to pre-5.10 Mediatek or pre-4.14 Qualcomm devices.
This will likely be many years.

Test: TreeHugger
Bug: 207057951
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I767b5fc56bc826e088507aea8ae7a30aa8aa424a
2021-11-25 11:03:58 +00: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
Aaron Huang
2f8e0319d4 Remove TODO that was already done
The TODO is used to track to remove dependencies from
ConnectivityService. Remove it since that was already done.

Test: remove comment only
Change-Id: Ida8c1124e110f64262a693dcddfbc7a9549510da
2021-11-23 14:39:16 +08:00
Ken Chen
335c0d4249 [NETD-BPF#4] Move bpf_shared.h from netd to module
The header file is referenced by the part going to be mainlined in Netd.
Note that some platform visibility is required with this commit, since
users of bpf_shared.h is currently located in platform. The visibility
can be removed when all users are moved out of platform.

Bug: 202086915
Test: m; flash; boot
Test: cd system/netd && atest
Test: cd packages/modules/Connectivity && atest
Test: atest FrameworksNetTests
Change-Id: I5c16511b6a2d4eb80dfd93157cbc98d5030bd5ac
2021-11-23 11:53:46 +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