Commit Graph

3778 Commits

Author SHA1 Message Date
Treehugger Robot
38276f1b9c Merge "Add cts test suite in connectivity/cts deps" 2022-01-21 07:36:08 +00:00
Lorenzo Colitti
513180aae8 Merge changes from topic "connectivity-mainline-presubmit-defaults"
* changes:
  Add java defaults for mainline-presubmit as well.
  Run bpf_existence_test in mainline-postsubmit.
2022-01-21 07:07:41 +00:00
Chiachang Wang
b04664d7a6 Merge "Update the SDK for the tests with intended target in T+" 2022-01-21 06:34:29 +00:00
William Escande
02fc79437b Add cts test suite in connectivity/cts deps
Test: atest CtsNetTestCases
Change-Id: Ib82b703145096a0b974aa602c7cdd505c333bca0
2022-01-20 17:52:03 +01:00
Junyu Lai
e9c4988632 [MS65.2] Add unit test of NetworkIdentity#Builder
Test: atest NetworkIdentityTest#testBuilder
Bug: 204830222
Change-Id: Ie0d56821608c881c3bffe224cfe240fa900c6f39
2022-01-20 15:58:30 +00:00
Junyu Lai
56f4a9c3d1 [MS57.2] Prepare APIs for data migration utility
Test: atest NetworkStatsHistoryTest#testBuilder
Bug: 204830222
Change-Id: I938c3ed50eea0f2349ea92c3824c637eaa77d328
2022-01-20 15:06:50 +00:00
Junyu Lai
7372824eca [MS41.2] Add unit test for query history APIs
Test: atest NetworkStatsServiceTest NetworkStatsManagerTest
Bug: 204830222
Bug: 200768422
Change-Id: I1dce7d671c5524496e0451665f62447ef6e454ae
2022-01-20 15:06:50 +00:00
Lorenzo Colitti
ab4c64329b Merge "Move LocalSocketTest out of packages/modules/Connectivity." 2022-01-20 09:43:04 +00:00
Aaron Huang
ccdf2a5838 Merge "Add unit test for NetworkStats iterator" 2022-01-20 04:09:00 +00:00
Paul Hu
a77cad355b Merge "Build framework-connectivity-tiramisu library" 2022-01-20 03:02:56 +00:00
Chiachang Wang
7212fbee14 Update the SDK for the tests with intended target in T+
Correct the SDK for those tests are expected running in T+
device. Check @IgnoreUpTo(S) may be incorrect after receiving
patches before T release.

Refer to temporary constant definition in DevSdkIgnoreRule until
the SDK constant being pushed into AOSP and synced with branch
used for mainline.

BUg: 215294242
Test: atest CtsNetTestCases CtsNetTestCasesLatestSdk
Change-Id: Ide6a241f7944dd1e75bc33b21aa29471a5df94c6
2022-01-20 10:30:19 +08:00
Frank
9ef027c2f5 [DU03-2]Remove INetworkStatsService from BatteryStatsImpl
Correct the NetworkStatsServiceTest

BatteryStatsImpl is using INetworkStatsService APIs, which
cannot be accessed after moving into the mainline module. So, replace
and remove those hidden API usages.

Bug: 210066922
Test: atest BatteryStatsImplTest WifiPowerCalculatorTest
            MobileRadioPowerCalculatorTest NetworkStatsServiceTest
CTS-Coverage-Bug: 213437796
Change-Id: I47dc377a5cce7d8a0029dc808ad0f46e651764b1
2022-01-20 00:15:55 +08:00
Aaron Huang
2ae5921bc8 Add unit test for NetworkStats iterator
Bug: 210073043
Test: this
Change-Id: I2bcd80627c31e94ac040dbb4e7d38561d8f4c229
2022-01-19 17:10:44 +08:00
Remi NGUYEN VAN
6c232e9b49 Merge "Mark connectivity module tests as such" 2022-01-19 06:49:39 +00:00
Remi NGUYEN VAN
0ac9163620 Merge "Do not verify field count in tests used in CTS" 2022-01-19 06:49:28 +00:00
William Escande
5fd2c7033a Move LocalSocketTest out of packages/modules/Connectivity.
This test is testing non-updatable code in frameworks/base, so it should
not live in packages/modules/Connectivity.

Test: treehugger
Change-Id: Ifdefeeca0190d27e98f687446f984dcc711a8c55
2022-01-19 04:03:26 +00:00
Chiachang Wang
af7c44cc4e Add missing DevSdkIgnoreRule rule variable
DevSdkIgnoreRule.IgnoreUpTo() will not work as expected without
the rule defined.

Bug: 184750836
Test: atest android.net.Ikev2VpnProfileTest#\
      testBuildExcludeLocalRoutesSet works as expected with ignore
      rule
Change-Id: I03a5b28963cd6feebe4358d57c070d941cd114e5
2022-01-18 11:25:03 +00:00
Remi NGUYEN VAN
e347301890 Mark connectivity module tests as such
Add @ConnectivityModuleTest to tests for classes that are mainly used to
back the connectivity (tethering) module, in particular data classes.

This causes the test not to be run in NetworkStack/CaptivePortalLogin
MTS tests when the connectivity (tethering) module is not installed.
Skipping such tests is necessary in that configuration as they may test
behavior that is new in the latest update, and data classes backing the
connectivity module would not be affected by
NetworkStack/CaptivePortalLogin updates anyway.

Bug: 211075897
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I6163cd998fc78765b903fdb7acd21e652bc711c9
2022-01-18 16:55:44 +09:00
Remi NGUYEN VAN
8bc36966d4 Do not verify field count in tests used in CTS
Tests in tests/common and tests/cts are run as part of CtsNetTestCases.
Many used assertFieldCountEquals in parceling/unparceling tests to
ensure that unexpected fields were not added, or that they were not
missed when testing parceling/unparceling.

However with many of the classes updatable through module updates, the
field count may change in the future, breaking CTS tests.

Stop checking for the field count, as it would break on module releases,
and its value is lower than the maintenance cost.

Bug: 205901761
Test: atest CtsNetTestCases
Change-Id: I79854741f7e834574d4825bb737ef507785310fe
2022-01-18 16:55:32 +09:00
Lorenzo Colitti
7aac4ad2f7 Add an OWNERS_core_networking_xts for CTS/GTS/... and use it.
This uses a similar scheme to our existing OWNERS files, which
all come from a common location in the master branch.

Test: repo upload
Change-Id: I672070302789ac38a738ab6626f47ec9cbc75dd9
2022-01-18 01:42:39 +00:00
Lorenzo Colitti
be53da163c Add java defaults for mainline-presubmit as well.
Test: m
Change-Id: Ie5b7f48ff59af136edff272fad1d544585a911e6
2022-01-18 08:38:04 +09:00
Treehugger Robot
2fe71c70ab Merge "Don't pass non-const refs." 2022-01-17 15:57:35 +00:00
Lorenzo Colitti
da0c43e38f Run bpf_existence_test in mainline-postsubmit.
The TEST_MAPPING file already contains a mainline-postsubmit
stanza, but according to go/test-mapping-mainline-user-guide
this information also needs to be in AndroidTest.xml (or in
Android.bp, for tests that are not covered by an AndroidTest.xml
and where soong autogenerates the test config).

Test: m bpf_existence_test
Change-Id: I103f5fefbfefa6fd2b59ab6c209fbf1dceada4ba
2022-01-18 00:13:51 +09:00
Aaron Huang
63b5da9866 Merge "Use getter methods to verify the fields of Entry" 2022-01-17 09:31:55 +00:00
Lorenzo Colitti
32999378a7 Don't pass non-const refs.
Non-const refs are not allowed by style guide.
This was just an oversight.

Test: m bpf_existence_test
Change-Id: I8947118618dd5beef7f5643475d348f709799922
2022-01-14 09:41:11 +09:00
Maciej Żenczykowski
8f9cfde3d8 Merge changes I41dcf8aa,Ie13e1df6
* changes:
  Test for the existence of maps as well as programs.
  Minor simplifications in bpf_existence_test.
2022-01-13 22:27:18 +00:00
Sooraj Sasindran
226131ab48 Merge "Ability for DPM to specify fallback mechanism" 2022-01-13 17:24:07 +00:00
Junyu Lai
5db1ea12b5 Merge "[MS44.2] Add unit test for API to query tagged UID summary" 2022-01-13 11:25:15 +00:00
Taras Antoshchuk
b209f64b3c Merge "Use assumeTrue in VpnTest" 2022-01-13 10:03:57 +00:00
Lorenzo Colitti
08a2e03231 Merge "Make MTS verify expected BPF programs based on OS version." 2022-01-13 08:14:08 +00:00
Lorenzo Colitti
8db39c4572 Test for the existence of maps as well as programs.
Test: passes on barbet running aosp/master
Change-Id: I41dcf8aa99a38a00227d608f421672c398cd2065
2022-01-13 16:12:35 +09:00
Lorenzo Colitti
32bd071ecb Minor simplifications in bpf_existence_test.
1. Use set instead of vector. This simplifies the code a bit.
2. Use proper NDK constants and functions to check the device
   OS version.

Test: test-only change
Test: passes on flame running qt-dev build (no-op)
Test: passes on flame running RQ3A build
Test: passes on raven running SP2A build
Test: passes on barbet running aosp/master
Change-Id: Ie13e1df674e50fcfb70811bc0dccae515cbb6e1c
2022-01-13 15:57:00 +09:00
Lorenzo Colitti
3b38b12071 Make MTS verify expected BPF programs based on OS version.
While this does not capture all nuances of optional programs,
go devices, etc. it should be a useful starting point to tell us
if something is really unexpected.

Test: test-only change
Test: passes on flame running qt-dev build (no-op)
Test: passes on flame running RQ3A build
Test: passes on raven running SP2A build
Test: passes on barbet running aosp/master
Change-Id: I43ff8c61c861c008cce459d2dcb487bb536c8da8
2022-01-13 15:31:27 +09:00
Sooraj Sasindran
06baf4cfa1 Ability for DPM to specify fallback mechanism
Bug: 194332512
Test: unit test
Change-Id: Id4d85da8f64e7559326c4657b8833dac3ce5ce3d
2022-01-13 06:07:36 +00:00
Frank Li
231503a08c Merge "[DU01]Remove INetworkManagementService from NetworkStatsService" 2022-01-13 05:45:42 +00:00
Chiachang Wang
e52be3b59f Merge "Add excludeLocalRoutes in NativeNetworkConfig" 2022-01-13 00:57:49 +00:00
Taras Antoshchuk
c8b0428da5 Use assumeTrue in VpnTest
Test: atest HostsideVpnTests
Change-Id: I399bb4d113e37869be50bfe73cb3d9b4fa2253ef
2022-01-12 22:41:35 +00:00
Taras Antoshchuk
e4f2b591de Merge "Revert "Revert^2 "Revert "Add CTS tests for exclude VPN routes A..."" 2022-01-12 15:27:30 +00:00
Lorenzo Colitti
6909e63260 Add a simple test for ConnectivityService#dump.
Test: test-only change
Change-Id: I28f463c95815098821ed48c885ce67bd5e9e7676
2022-01-13 00:06:07 +09:00
Junyu Lai
7ef0a17544 [MS44.2] Add unit test for API to query tagged UID summary
Test: atest NetworkStatsManagerTest
Bug: 204830222
Change-Id: I0b712141b7c644205bba3a98ebf39803f0d05306
2022-01-12 14:07:02 +00:00
Remi NGUYEN VAN
6eb0654f9b Merge changes Iad0b0d52,Iee727308
* changes:
  Use recording callbacks in NsdManagerTest
  Refactor NsdManagerTest
2022-01-12 11:47:03 +00:00
Remi NGUYEN VAN
0f17237773 Use recording callbacks in NsdManagerTest
Refactor the test to use recording callbacks based on ArrayTrackRecord,
which allow removing the test's own logic to poll for events.

Bug: 190249673
Test: atest NsdManagerTest --rerun-until-failure 20
Change-Id: Iad0b0d52271b13954c0193b3b9d4307349a39443
2022-01-12 15:26:11 +09:00
Aaron Huang
c448b73a22 Use getter methods to verify the fields of Entry
Bug: 210073043
Bug: 204830222
Test: FrameworksNetTests
Change-Id: I1ade9113e9367a85b7c200c8f52d8ff3ffc14770
2022-01-11 18:16:27 +08:00
Chiachang Wang
da13f899e3 Merge "Add test for setting excludeLocalRoutes" 2022-01-11 08:56:38 +00:00
Remi NGUYEN VAN
eaada07913 Refactor NsdManagerTest
Refactor the test to use Kotlin, and move some repeated code to
submethods.

Bug: 190249673
Test: atest NsdManagerTest
Change-Id: Iee7273080d5d29f1d364ac0a77e017edf9b36051
2022-01-11 12:52:22 +09:00
Chiachang Wang
bf6b879b55 Add excludeLocalRoutes in NativeNetworkConfig
Add extra field in NativeNetworkConfig to allow CS to notify
netd whether the local traffic should be excluded from the VPN
network.

Bug: 184750836
Test: atest FrameworksNetworkTests
Change-Id: If230fe7057722c80a09433673ac3cec857f7a7a5
2022-01-11 11:33:44 +08:00
Taras Antoshchuk
d9ba74953b Revert "Revert^2 "Revert "Add CTS tests for exclude VPN routes A..."
Revert "Revert "Revert "Revert "Add APIs that allow to exclude r..."

Revert "Revert "Revert "Revert "Add VpnServiceBuilderShim for Vp..."

Revert submission 1941195-revert-1931760-reland-vpn-impl-part-2-WGARECSJEM

Reason for revert: fixed merge conflict with aosp/1938197
Reverted Changes:
Ic25e5e4ea:Revert^2 "Revert "Add CTS tests for exclude VPN ro...
Ic72cafcf5:Revert "Revert "Revert "Add APIs that allow to exc...
I53802190a:Revert "Revert "Revert "Add VpnServiceBuilderShim ...

Change-Id: I5a6ceaae21c563de8bb71338c29973f58178b456
2022-01-10 10:20:46 +00:00
Matt Buckley
67197b7ed6 Merge "Revert^2 "Revert "Add CTS tests for exclude VPN routes APIs""" 2022-01-07 17:48:45 +00:00
Matt Buckley
01d9abecef Revert^2 "Revert "Add CTS tests for exclude VPN routes APIs""
1a6d19e4b8

Change-Id: Ic25e5e4eaf57e033a9304244387e6fba15213d2b
2022-01-07 17:44:52 +00:00
lifr
214714285a [DU01]Remove INetworkManagementService from NetworkStatsService
NetworkStatsService is using INetworkManagementService APIs, which
cannot be accessed after moving into the mainline module. So, replace
and remove those hidden API usages.

Bug: 209738761
Test: atest NetworkStatsServiceTest
Change-Id: Ieda3c3382fa61411587c5b390bbecb2a2524844b
2022-01-08 01:33:36 +08:00