Commit graph

52,109 commits

Message SHA1
Skip testTetherClatUdp before S
The test does not pass on R.

Bug: 234727688
Test: atest EthernetTetheringTest
Change-Id: I831859e521b026ed4acb84de5857a7d3ec318ba5

Remi NGUYEN VAN   commited 2022-06-03 12:04:23 +09:00
8b56874caa
Revert "Revert "EthernetTetheringTest: add testTetherClatUdp""
This reverts commit 5bbd292bed.

Bug: 215655463
Change-Id: I06490001b06446b6a4ff3dc084ce11e8ebbe17f8
Test: atest ConnectivityCoverageTests

Remi NGUYEN VAN   commited 2022-06-03 02:55:26 +00:00
e78cfa130b
Revert "EthernetTetheringTest: add testTetherClatUdp"
This reverts commit b0274cf796.

Reason for revert: Breaks presubmit: b/234727688

Change-Id: I736752dca3707588a525f28d208bdb20f7280972

Remi NGUYEN VAN   commited 2022-06-03 02:32:48 +00:00
5bbd292bed
EthernetTetheringTest: add testTetherClatUdp
Bug: 215655463
Test: atest ConnectivityCoverageTests
Change-Id: Id5d237b96b1d171c1e353cfd0aeba5aa4606fcc7

Hungming Chen   commited 2022-06-02 12:07:13 +08:00
b0274cf796
Merge "Add tethering icmpv6 forwarding test"
Mark Chien   authored and   Gerrit Code Review   commited 2022-06-01 15:15:37 +00:00
86a800f911
Merge "Remove useless methods from NetworkStatsRecorder"
Paul Hu   authored and   Gerrit Code Review   commited 2022-06-01 09:25:45 +00:00
8433020e1a
Merge "Remove the DisabledState from NsdService"
Paul Hu   authored and   Gerrit Code Review   commited 2022-06-01 09:25:11 +00:00
d65740346e
Merge "tests: simplify BpfMap.reset(createMap()) -> BpfMap.resetMap()"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-06-01 09:00:46 +00:00
69777762e7
Merge changes I25158126,I99fcf77b
* changes:
  TrafficControllerTest - trivial simplification
  simplify bpf tests and check type correctness

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-06-01 08:59:19 +00:00
d9b378eeef
Merge "Bump tethering target sdk to 33"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-01 08:57:46 +00:00
d10244feb8
Merge "Add native test libclat_test to MTS."
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-01 08:32:56 +00:00
fbf49b29bf
Merge "Add IpConfigStore testcase to improve the code coverage."
Xiao Ma   authored and   Gerrit Code Review   commited 2022-06-01 07:47:07 +00:00
c0e80ee9f9
Remove useless methods from NetworkStatsRecorder
In order to increase the line coverage for the Connectivity
module, remove the useless methods from NetworkStatsRecorder.

Bug: 234315786
Test: atest FrameworksNetTests CtsNetTestCases \
      ConnectivityCoverageTest
Change-Id: I6ef08d220ad69ec3c945dd54be1b51814d2438b2

Paul Hu   commited 2022-06-01 07:06:34 +00:00
c9fd2f14d9
Remove the DisabledState from NsdService
In order to increase the line coverage for the Connectivity
module, remove the DisabledState from NsdService which is
uselss for a while.

Bug: 234315786
Test: atest FrameworksNetTests CtsNetTestCases \
      ConnectivityCoverageTest
Change-Id: I29c7ef608d97037084b25daa70ad5829f474e20a

Paul Hu   commited 2022-06-01 05:57:59 +00:00
29f4359856
Add IpConfigStore testcase to improve the code coverage.
Add new testcase in IpConfigStoreTest to cover the readIpConfiguration
usage, improve the code coverage for connectivity module.

To reduce the flakyness of test, this cl refactors DelayedDiskWriter
constructors by allowing to pass in a Dependencies instance, then
waitForIdle can be used to check if the delayed write operation
associated with the passed-in HandlerThread has completed in tests.

Bug: 234315786
Test: atest com.android.server.net.IpConfigStoreTest
Change-Id: I57c8bd02a771f1cca815252ba502cda0210d1385

Xiao Ma   commited 2022-06-01 14:47:47 +09:00
b4a8fd534a
Merge "Add test coverage for ConnectivityService.dump with arguments"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-06-01 05:41:50 +00:00
c0b2b37faa
Merge "Fix service resolve on tethering downstreams"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-06-01 05:31:14 +00:00
5eaefa21bf
Add test coverage for ConnectivityService.dump with arguments
Test: atest FrameworksNetTests
Change-Id: I389ef6e89a7570cb3e7f8cedab48517c25c4c0b0

chiachangwang   commited 2022-06-01 03:58:25 +00:00
9673c4ddad
Merge changes from topic "stats-migration"
* changes:
  Skip PersistentIntTest on S- device
  Don't clobber existing history entries.
  Ensure NetworkStats migrated snapshot is identical
  [MS82.1] Support network stats data migration process
  Add a PersistentInt class.

Natasha Lee   authored and   Gerrit Code Review   commited 2022-06-01 03:03:02 +00:00
bcdb3c12ee
Merge changes from topic "target-sdk-tests"
* changes:
  Run testExcludedRoutesDisabled only in APKs with target SDK < T.
  Create CtsNetTestCasesMaxTargetSdk31.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-06-01 02:53:09 +00:00
e051145522
Merge "Remove logic from NetworkMonitorManager wrapper"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-06-01 01:20:03 +00:00
de9818fb81
Merge "Support more than 8 firewall chains / match types."
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-05-31 22:21:48 +00:00
4eacf772c2
Add tethering icmpv6 forwarding test
Bug: 183166581
Test: atest EthernetTetheringTest

Change-Id: I77ad4a468530f3ef834cd7b72e585798a23f64c3

markchien   authored and   Mark Chien   commited 2022-05-31 23:53:47 +08:00
a40f2fe746
tests: simplify BpfMap.reset(createMap()) -> BpfMap.resetMap()
BpfMap.reset(createMap()) is equivalent to newly added BpfMap.resetMap(),
except that the latter makes it impossible to screw up the Key/Value sizes.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I290986e9ae8660f3fc6f73b086d33f4ab93d6095

Maciej Żenczykowski   commited 2022-05-31 07:35:04 -07:00
439bac2e56
TrafficControllerTest - trivial simplification
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I25158126c968707f44f595f731547a8bd9bb503d

Maciej Żenczykowski   commited 2022-05-31 07:35:04 -07:00
ced3531ad5
simplify bpf tests and check type correctness
We notice that:
  BpfMap.reset(dupFd_with_cloexec(BpfMap.getMap())
is equivalent to
  BpfMap = BpfMap
due to the current implementation of the BpfMap assignment operator.

Except the latter also verifies BpfMap<K,V> template types match.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I99fcf77bc6aa360b6a19e22c2cd58d67a1e62976

Maciej Żenczykowski   commited 2022-05-31 07:35:03 -07:00
55ab87aa49
Merge "Bump Mainline Module Version Codes in AOSP to 339990000"
Alexei Nicoara   authored and   Gerrit Code Review   commited 2022-05-31 14:17:23 +00:00
7884a2f2b8
Support more than 8 firewall chains / match types.
In the BPF code, per-UID network access (e.g., for doze mode,
standby, etc.) is stored in UidOwnerValue structures. Each of
these stores that UID's rules in a 32-bit bitmask of
UidOwnerMatchType values, so the code can support ~31 match
types.

However, which match types are enabled is stored in
configuration_map at index UID_RULES_CONFIGURATION_KEY, and
configuration_map only stores 8-bit values. So it's not
possible to define more than 7 match types.

Widen configuration_map to from 8 to 32 bits to match the width
of UidOwnerValue.rule. This doesn't impact memory because
configuration_map only has 2 entries.

Bug: 208371987
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7e1eee2daedd66d27965a2dd4ce6b4c3667892f7

Lorenzo Colitti   authored and   Maciej Żenczykowski   commited 2022-05-31 09:59:11 +00:00
60cbed385d
Remove logic from NetworkMonitorManager wrapper
NetworkMonitorManager should just be a passthrough wrapper for
INetworkMonitor. Move logic to choose the notifyNetworkConnected version
to call to its only caller, ConnectivityService.

This allows removing the dependency on modules-utils-build, which makes
the networkstack-client library less portable; for example it would add
duplicate classes if networkstack-client is included into service-wifi,
as service-wifi can already use modules-utils-build from framework-wifi.

Fixes: 227161380
Test: atest ConnectivityServiceTest
Change-Id: Ie50f586c5d1ffe021cb0a96294f13f478fd3a2dd

Remi NGUYEN VAN   commited 2022-05-31 18:50:50 +09:00
9ada184a2b
Fix service resolve on tethering downstreams
Tethering downstreams do not have NetworkAgents, and although they have
a netid of 99, Networks with netId 99 are not usable by apps for most
connectivity APIs.

Recent refactoring in NsdService adds the Network of a found service
into its NsdServiceInfo, and uses that network to resolve the service.
In that case the Network has netId 99 and resolving the service fails.

Avoid that problem by:
 - Keeping the Network field null when a service is found on a tethering
   downstream; this avoids giving apps a confusing and unusable Network
   with netId 99
 - Using the interface index found during discovery to resolve the
   service, if the app uses the NsdServiceInfo that was obtained from
   discovery to resolve. If not, all interfaces will be used to resolve,
   as per legacy APIs.

Bug: 233979892
Test: atest NsdServiceTest
      Also manual test with 2 devices connected via hotspot
Change-Id: Idd176153b67ccbd1d4f1b1fd66dafaa2f3a9e27a

Remi NGUYEN VAN   commited 2022-05-31 13:06:22 +09:00
1a8ee102d3
Bump tethering target sdk to 33
Note: to avoid missing some dependeices change only happen in T+, below
testing verification is perform by internal branch.

Test: atest TetheringTests
      atest TetheringIntegrationTests
      atest CtsTetheringTest
      atest MtsTetheringLatestSdk
      manually change entitlement check recheck period to 1 min and
      monitor schedule alarm works.
      Dogfood this change personally 7 days, major use hotspot sharing network to notebook to work.
Bug: 232193147
Change-Id: I3cba98f42ac1a9c0c1db4b2ad036aff714a428f3

Mark Chien   commited 2022-05-31 03:31:18 +00:00
d25a1e05ae
Merge "Remove unused variable"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-05-31 01:30:56 +00:00
913b20ba5f
Run testExcludedRoutesDisabled only in APKs with target SDK < T.
This test crashes if run from an APK that has target SDK 33 or
above because it tries to disable a compat change that on those
SDK versions is enabled by default.

Run it only in CtsNetTestCasesMaxTargetSdk31 and skip it in our
regular CTS modules.

Bug: 233553525
Test: test-only change
Change-Id: Iaf9c46591c13505c9d2a2a09994b9ee22a22390c

Lorenzo Colitti   commited 2022-05-30 23:36:23 +09:00
1c7a20c6c6
Create CtsNetTestCasesMaxTargetSdk31.
This APK will only run tests that require target SDK 31 or below.

Bug: 233553525
Test: test-only change
Change-Id: Ia86187de50107748d8053194d3f7a55b7947412e

Lorenzo Colitti   commited 2022-05-30 23:36:21 +09:00
9e61b82404
Run libclat_test in presubmit
This has been green for a while.

On postsubmit:
https://android-build.googleplex.com/builds/tests/view?testResultId=TR59428013832586062&invocationId=I95700010046253101

Test: treehugger
Change-Id: I343fa24603df493c785e462a6449eb1129f08c11

Hungming Chen   commited 2022-05-30 16:21:49 +08:00
2e6d107ecc
Add native test libclat_test to MTS.
In order to get counted by mts code coverage, this native test needs to
be run as part of mts.

Bug: 233904825
Test: m mts && mts-tradefed run mts-tethering-coverage
Change-Id: I4ec7108577a8a50d4419bbf387535f92f2f6d099

Hungming Chen   commited 2022-05-30 15:37:25 +08:00
14575d38cc
Merge "Test testTetherUdpV4AfterR only verify bpf in precise kernel range"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-27 19:03:58 +00:00
875daa69eb
Merge "Add traffic_controller, networkstats, netd_updatable tests to MTS."
Ken Chen   authored and   Gerrit Code Review   commited 2022-05-27 17:46:54 +00:00
93ea4c3f5c
Add traffic_controller, networkstats, netd_updatable tests to MTS.
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

Ken Chen   commited 2022-05-27 15:00:18 +00:00
b9266bf507
Test testTetherUdpV4AfterR only verify bpf in precise kernel range
Use three-part kernel version numbers to check which device
needs to verify BPF offload. Only check major and minor number
is not enough. Ex: mixed build T + R may have an unsupported kernel
version 4.19.160 (require 4.19.176+). Now check the subminor
number as well.

For UDPv4 support, kernel require 4.14.222+ 4.19.176+ 5.4.98+, 5.8.0+

Test: atest EthernetTetheringTest (raven @ internal master build)
Test: cts test (bramble @ T + R mixed build)
> run cts-on-gsi -m CtsTetheringTest -t android.net.EthernetTetheringTest#testTetherUdpV4AfterR

Bug: 232332847
Change-Id: I466df73b0fa35b086a2c5e11f8624c84eb79c8fd

Hungming Chen   commited 2022-05-27 22:15:24 +08:00
d7e713283d
Merge "Fix crash when decrementing data usage request"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-27 10:02:33 +00:00
019e6eb2d7
Fix crash when decrementing data usage request
When unregistering, if the caller process is dead. The system
can unregsiter for the caller. But the request decrement should
be counted onto the caller uid instead of system uid.

Test: NetworkStatsObserversTest#testUnregister_knownRequest_invalidUid_doesNotUnregister
Bug: 233580307
Change-Id: I85aee8f395739929bc7086883ace81ac1ecd0730
Merged-In: I85aee8f395739929bc7086883ace81ac1ecd0730
  (pure cherry-picked from ag/18579047)

Junyu Lai   commited 2022-05-27 09:50:52 +00:00
a1970dafa1
Remove unused variable
Clean up to remove unused variable.

Change-Id: Iad05d6db2fccdaff7419de02b29d74a18b00c3b4
Test: TH

Chiachang Wang   commited 2022-05-27 08:24:19 +00:00
589bfc1c04
Add some non-connectivity-module-test back to ConnectivityCoverageTests
In S, the tests are listed in the non-connectivity-module-test
where their testing files are not in the connectivity module.
But some files move into the connectivity module in T. So some
tests can be removed from non-connectivity-module-test and will
be running on ConnectivityCoverageTests to count their code
coverage.

Also update some tests to make them compatible with
mockito-extended and ignore some tests which need to test with
T apis.

Bug: 234000451
Test: atest FrameworksNetTests ConnectivityCoverageTests
Change-Id: I47fb59334d00ae7fee91c5694548b3cf89b09b2d

Paul Hu   commited 2022-05-27 07:16:46 +00:00
516d5dc0ea
Merge "CTS test for EthernetNetworkUpdateRequest"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-27 00:46:06 +00:00
30809dc4a1
Merge "Remove duplicate postsubmit."
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-27 00:35:15 +00:00
81b2bd2d7c
Merge "Changing target_sdk for CtsNetTestCasesLatestSdk"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-26 10:47:01 +00:00
44ad28052c
Changing target_sdk for CtsNetTestCasesLatestSdk
Bug: 233553525
Test: Presubmit

Changing target_sdk of or CtsNetTestCasesLatestSdk to 33 to match with apps target_sdk

Change-Id: Id786f64956d52307e15b3cd3feaa02d585e7623e

preranap   commited 2022-05-26 03:00:02 +00:00
7a1639ff5f
Merge "Adding missing dependency for api23Test"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-25 23:06:58 +00:00
433f594bb6
Merge "bpf programs: switch from integers to #define'd bpfloader versions"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-25 18:38:27 +00:00
fb2dd8d15c