Commit Graph

3655 Commits

Author SHA1 Message Date
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
9e4d6d2dc6 Add CTS for DhcpOption am: 4df5d1fdd2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1917689

Change-Id: Ic4a33e417830ff534da1e56895159935b2a85ae9
2021-12-11 01:51:37 +00:00
Mingguang Xu
4df5d1fdd2 Add CTS for DhcpOption
Bug: 177278970

Test: this
Change-Id: Ia9a9384cb39c049253ead8f7eb594505ccf08333
2021-12-10 23:26:36 +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
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
a9656625d2 Merge "[MS07.2] Move NetworkStatsCollection/IdentitySet into frameworks" am: 7577131341
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1895330

Change-Id: I3d84b1a82e07a9b4a56ddc88f3f81d875870517c
2021-12-10 18:57:07 +00:00
Treehugger Robot
7577131341 Merge "[MS07.2] Move NetworkStatsCollection/IdentitySet into frameworks" 2021-12-10 18:48:52 +00:00
Aaron Huang
9792b5b5e6 Add makeDependencies method in IpSecService related tests
Bug: 204153604
Test: FrameworksNetTest
Change-Id: Iea5731273e4772966466088f11a4c6334fa19f5d
2021-12-10 12:11:20 +00: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
81288cfce7 Merge "Add additional IPsec owners" am: b1c6bf8ece
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1910250

Change-Id: Ic47c361c3f73abdafb367a5a40a4a5d553b8eabb
2021-12-08 18:54:07 +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
Connor O'Brien
e0a64bb50c Rename libbpf to libbpf_bcc
This is to prevent a name collision with "upstream"
libbpf (external/libbpf) which is built using the same name.

Bug: 203823368
Test: m FrameworksNetTests
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I9a009493fe0482967ab1f92516514715cfd457d6
2021-12-07 23:05:24 +00:00
Paul Hu
b8c0a764bd Merge "Remove NsdSettings from test" am: 5c3c3af9b6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1908687

Change-Id: Id2ff4ca8c54ea88966d78d4000384ea4aa780ad4
2021-12-07 06:01:16 +00:00
Paul Hu
5c3c3af9b6 Merge "Remove NsdSettings from test" 2021-12-07 05:43:44 +00:00
Treehugger Robot
5f5e9d2e37 Merge "Flake fix : Wait setting applied before returning from setConfig" am: f575d053d4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1895332

Change-Id: Iee56a747ef47ca48a27d6f5abbc3352667fbaef3
2021-12-06 06:46:34 +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
303a4916de Merge "[NETD-BPF#4] Move bpf_shared.h from netd to module" am: 3f8d3ff9bf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1870274

Change-Id: Ic25002c1cb0ad702be4114b91ce5114da716531b
2021-12-03 09:20:00 +00:00
Ken Chen
3f8d3ff9bf Merge "[NETD-BPF#4] Move bpf_shared.h from netd to module" 2021-12-03 08:15:06 +00: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
cac7575885 Merge "Competing network interfaces" am: 44a20af4a3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1903360

Change-Id: I358c9a83623dd93ce06d423bcde7720f1dc39a84
2021-11-29 09:44:19 +00:00
Treehugger Robot
44a20af4a3 Merge "Competing network interfaces" 2021-11-29 09:31:30 +00:00
Paul Hu
b0a10cd127 Merge "Save uid netd network permissions" am: 6fafdc1548
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1773890

Change-Id: Ibff437f91017017cc6fcc7e456e621e2ad81995a
2021-11-29 03:45:46 +00:00
Paul Hu
6fafdc1548 Merge "Save uid netd network permissions" 2021-11-29 03:27:33 +00:00
Aaron Huang
ced49fd763 Change to use Dependencies in IpSecService Tests
The interface IpSecServiceConfiguration is refactored to static
class Dependencies. Refine the tests to use Dependencies.

Bug: 204153604
Test: FrameworksNetTests
Change-Id: Ie2b79b1d948a19f64600ed9ea3b60b192dd92dfd
2021-11-27 00:27:33 +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
Treehugger Robot
8edbc35d56 Merge "Stop skipping VPN tests when running ADB over TCP." am: b031a2265e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1669610

Change-Id: I7a829bc84282c940abae5e0930a9c2cbe4cc7099
2021-11-26 03:47:07 +00:00
Treehugger Robot
b031a2265e Merge "Stop skipping VPN tests when running ADB over TCP." 2021-11-26 03:30:45 +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
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
0061457a54 Merge "Fix a possible flake in disconnectFromWiFi" am: 1c4a66ddc4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1892098

Change-Id: I6df297447ade42e38963855809c499c55b6ea85c
2021-11-22 07:53:43 +00:00
Treehugger Robot
1c4a66ddc4 Merge "Fix a possible flake in disconnectFromWiFi" 2021-11-22 07:34:57 +00:00
Remi NGUYEN VAN
b7fd5bd3e1 Merge "Update NSD tests without AsyncChannel" am: 469d941752
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1823893

Change-Id: I897bdce6cdaf4ea390d8ce6be03b87bacd6da82e
2021-11-22 06:19:18 +00:00
Remi NGUYEN VAN
469d941752 Merge "Update NSD tests without AsyncChannel" 2021-11-22 05:58:15 +00:00
Aaron Huang
4fc403c3b0 Merge "Use real ProxyTracker in ConnectivityServiceTest" am: c7037475fa
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1885529

Change-Id: Id685a51b37d59a822aaa9307f9d4b55053211612
2021-11-22 05:41:34 +00:00
Aaron Huang
c7037475fa Merge "Use real ProxyTracker in ConnectivityServiceTest" 2021-11-22 05:25:28 +00:00
Remi NGUYEN VAN
e03f77170a Remove unused service and test dependencies am: f96ecf2708
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1895317

Change-Id: I677a6b4c0b68648b4fab0e6f67edc88aa8be77b2
2021-11-19 15:59:07 +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
Xin Li
c96c26077b Merge "Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918" into stage-aosp-master 2021-11-18 21:29:06 +00: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
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
Remi NGUYEN VAN
4638c093ed Merge "Fix NetworkCapabilitiesTest on S" 2021-11-11 04:42:36 +00:00