Commit graph

56,847 commits

Message SHA1
Add test for startPptp
The test verifies arguments used to start the daemon

Bug: 201660636
Test: atest VpnTest
Change-Id: I0854fbeaf1a3e3554c157fde227a7bfa187b1013
Merged-In: I0854fbeaf1a3e3554c157fde227a7bfa187b1013

Remi NGUYEN VAN   authored and   chiachangwang   commited 2022-06-24 03:33:30 +00:00
522cea7d4e
Merge "Validate or set the eth specifier on update Iface"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-23 16:16:05 +00:00
85694dc277
Validate or set the eth specifier on update Iface
When a calling the updateInterface API, if no eth specifier was set it
would be removed not allowing follow-up network requests to request by
ethernet specifier.

This CL makes sure that the eth specifier is always set as expected when
updateInterface is called by either validating the input or setting the
specifier if the passed one is null.

Bug: 236294399
Bug: 229207021
Test: atest FrameworksNetTests
:com.android.server.ethernet.EthernetNetworkFactoryTest

Change-Id: Ic05ca7fe4adaa94f79e59758569f7595ab4c4f54

James Mattis   commited 2022-06-23 07:51:20 -07:00
59d98c07a7
Merge "Fix pro-guard rules for service-nearby"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-23 10:50:38 +00:00
f2ac559aa3
Fix pro-guard rules for service-nearby
(clean cherry-pick of downstream change)

Test: build and check classes in service-connectivity.jar.
Bug: 217115866
Merged-In: I9f7db4509bf8fe736f5d9fc08b164a20b2274aa8
Change-Id: Ia97b7ab645e3425780b335c699b57a6dc7589f2a

Chun Zhang   authored and   Remi NGUYEN VAN   commited 2022-06-23 16:31:56 +09:00
193797326e
Merge "Add wipeOnError flag to NetworkStatsRecorder"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-06-23 06:14:42 +00:00
1934a82b52
Merge "Revert "connectivity_native_test: remove retries""
Steven Moreland   authored and   Gerrit Code Review   commited 2022-06-22 20:32:25 +00:00
749fd994f8
Revert "connectivity_native_test: remove retries"
This reverts commit ccde0db174.

Reason for revert: fails in mainline prod branch

Change-Id: Id26c44b9e9c68a259d3c82d67a5f4cea27569432

Steven Moreland   commited 2022-06-22 20:27:15 +00:00
5d0843b7f2
Merge "Skip testNetworkRequest_forInterfaceWhileTogglingCarrier on lower kernel version."
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-22 13:47:54 +00:00
198bea7f24
Skip testNetworkRequest_forInterfaceWhileTogglingCarrier on lower kernel version.
Notice this test case fails on device such as coral running with an
older kernel version(e.g. 4.14) that might not support ioctl new
argument. Run this test only with 4.19 kernel or above instead.

Bug: 236783925
Test: atest EthernetManagerTest on cf
Test: atest EthernetManagerTest on flame
Change-Id: I82c99ff4378868c7cbcef72632b06fb918d07a70

Xiao Ma   commited 2022-06-22 19:52:59 +09:00
1e34a57c28
Add wipeOnError flag to NetworkStatsRecorder
If reading data happens exception while doing data migration,
the file will be deleted by legacy recorders. This would cause
legacy persistent data being lost and cannot be retrieved by
any method. To avoid the files being deleted, add a wipeOnError
flag to recorder which indicates this recorder will wipe on
error or not . If the flag is set to true then deletes all files
when it throws, otherwise keeps all files.

(cherry-picked from ag/18910973)
Bug: 233828210
Test: FrameworksNetTests:NetworkStatsRecorderTest

Change-Id: Id7a3d8bebf8a00d814f9e84bf4c10d927e6ff749
Merged-In: Id7a3d8bebf8a00d814f9e84bf4c10d927e6ff749

Aaron Huang   commited 2022-06-22 17:37:51 +08:00
80767e64ef
Merge "Remove the package name from PermissionMonitor dump logs"
Paul Hu   authored and   Gerrit Code Review   commited 2022-06-22 08:36:23 +00:00
61abd8e56f
Merge "Fix linker error with upstream llvm"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-22 07:53:28 +00:00
ce11dc9a2d
Merge "Skip cts testFirewallBlocking in instant mode."
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-06-22 07:21:34 +00:00
172fae10d7
Increase fallbacks counter when comparison result is different
In current code, the fallbacks counter does not increase
when comparison result is different. This will not impact
how we print log.wtf but will impact the dry run process
for debugging in next every later boots.

Test: 1. NetworkStatsServiceTest
      2. manual test with script
Bug: 233752318
Change-Id: Ib152cec2ee0f21d59ccfe4669b31f26b3db71a97
Merged-In: Ib152cec2ee0f21d59ccfe4669b31f26b3db71a97
  (cherry-picked from ag/19005472)

Junyu Lai   commited 2022-06-22 11:01:13 +08:00
239b67a3cb
Disable comparison in user release builds
This CL disable the comparison mechanism introduced
in previous beta releases to stop receiving log.wtf signals
from beta users.

This CL only affects logging on user release builds.

Test: 1. NetworkStatsServiceTest
      2. manual test with script
Bug: 233752318
Change-Id: I7047106b1019c29460d6633b148f501ffa62f139
Merged-In: I7047106b1019c29460d6633b148f501ffa62f139
  (cherry-picked from ag/18869740)

Junyu Lai   commited 2022-06-22 11:00:17 +08:00
11e9887fa8
Disable fallback when comparison result is different
Follow-up from ag/18452103, where we add fallback code that runs
with the importer to make sure they are identical.
When the result is different, we'll take the result from fallback
code to minimize the rollout risk. However, since the OEMs might
change the importer implementation. The fallback code would no
longer valid and that makes OEM modified code not working. Hence
the fallback code must be disabled before release.

This change keeps comparison enabled for all cases to keep getting
signals from beta users. And will switch it to read overlay value
for OEM to debug their solution.

Test: 1. NetworkStatsServiceTest
      2. Test all datasets with script
Bug: 233752318
Change-Id: I869ff05297149bde6e13a204bd8c5a4fece75de0
Merged-In: I869ff05297149bde6e13a204bd8c5a4fece75de0
  (cherry-picked from ag/18849946)

Junyu Lai   commited 2022-06-22 10:59:10 +08:00
e72c849a61
Address comment at ag/18491259 and ag/18486388
Test: TH
Bug: 230289468
Change-Id: Id91fabb47b542d8526d6aa787b5947238c3934fb
Merged-In: Id91fabb47b542d8526d6aa787b5947238c3934fb
  (cherry-picked from ag/18579048)

Junyu Lai   commited 2022-06-22 10:57:38 +08:00
dbe8ddca71
Run comparison code if the data migration finished with fallback
If the data migration process runs finished with fallback,
that means we might get some unknown data that cannot be handled
by importing code.

If that happens, the CL runs the problematic code whenever device
boot-up but doesn't do the actual import process. This improves the
debuggability since the current log disappears after device reboot,
which will show up in every boot-up log after this CL.

Test: manual
Bug: 230289468
Change-Id: I6d117032d47f21c7cb49bbab916668058060f2f8
Merged-In: I6d117032d47f21c7cb49bbab916668058060f2f8
  (cherry-picked from ag/18491259)

Junyu Lai   commited 2022-06-22 10:36:22 +08:00
d451fdbb25
Persisting status int on the device if fallback happened
This CL also stop from incresing "successes" counter if the
importer finishes with fallback.

Test: manual
Bug: 230289468
Change-Id: I88fce1b2d0dea3772a8b31df8f8fa93bf13bffad
Merged-In: I88fce1b2d0dea3772a8b31df8f8fa93bf13bffad
  (cherry-picked from ag/18486388)

Junyu Lai   commited 2022-06-22 10:35:25 +08:00
079717052c
Merge "connectivity_native_test: remove retries"
Steven Moreland   authored and   Gerrit Code Review   commited 2022-06-21 23:03:09 +00:00
e1ae9fd469
Fix linker error with upstream llvm
https://reviews.llvm.org/rGd07ff995917 changed behaviour of lld and is
no longer accepting single dash `-error-limit`. Update to the new flag
format.

Test: presubmit
Change-Id: I7a78128c56157414411d085086091b9d25be0186

Yi Kong   commited 2022-06-21 19:45:01 +00:00
20a996e1e1
Merge "Verify VPN can handle network loss"
Yan Yan   authored and   Gerrit Code Review   commited 2022-06-21 17:36:22 +00:00
b3cfcc5c18
Skip cts testFirewallBlocking in instant mode.
Bug: 236662581
Test: aest  android.net.cts.ConnectivityManagerTest#testFirewallBlocking --instant
Change-Id: Ib8752439593dcd285146746b06b29f364e66ab85

Motomu Utsumi   commited 2022-06-21 06:02:01 +00:00
c4e6fcb6bc
Merge "Mark EthernetManagerTest as @ConnectivityModuleTest"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-20 11:38:00 +00:00
c2cbabf590
Merge "Fix validation URL flakes with DeviceConfigRule"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-06-20 08:29:10 +00:00
39e121cc88
Mark EthernetManagerTest as @ConnectivityModuleTest
The test will fail on T without an updated connectivity module, as it
uses new behavior implemented by a newer module version, such as
TestNetworkManager#createTapInterface(boolean, boolean).

Bug: 236558929
Change-Id: Ia74a31c8f7aabb4aae8eead5bba9f31cb7f2dd8d
Test: atest EthernetManagerTest

Remi NGUYEN VAN   commited 2022-06-20 06:55:56 +00:00
63ce27dd8d
adjust for newly added bpf map/prog definition fields in T+
This is needed due to BpfLoader v0.18 supporting more
functionality and thus bpf code compilation by default using
larger structs than it did during S.

Bug: 218408035
Test: booted on cuttlefish, atest CtsNativeNetTestCases
OBSigned-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0a37e59760fb0b55e6d6a6d12d5fd40106accd55

Maciej Żenczykowski   commited 2022-06-18 19:00:19 -07:00
b95db28080
netd bpf program - use finer grained selinux privs, part 1
Make use of new BpfLoader functionality: per-map/program selinux context
to further restrict access to mainline module shipped bpf maps and programs.

Bug: 218408035
Test: booted on cuttlefish, TreeHugger
Change-Id: Iaa33754aaca8bfafef6539abfbdd30b4cdfc4727

Maciej Żenczykowski   commited 2022-06-18 18:59:12 -07:00
cae181d777
switch netd.o to BpfLoader v0.18 file format
This is a temporary thing for testing with framework/libs/net patch
that adds checks for V18 define.

This is very short term and will be reverted in the next topic,
that will make v0.18 the default.

Bug: 218408035
Test: booted on cuttlefish
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I22c414ebc64201db60eb872e0da0fea6c65eaede

Maciej Żenczykowski   commited 2022-06-17 16:13:56 -07:00
1c52aa12e8
Revert "switch netd.o to BpfLoader v0.18 file format"
This reverts the previous commit.

This is no longer required as v0.18 is now the default.

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

Maciej Żenczykowski   commited 2022-06-17 16:13:56 -07:00
b0adaec487
Verify VPN can handle network loss
This commit also
- verifies that during network switch with MOBIKE
  enabled, the cleanup task is scheduled upon network loss and
  cancelled when new network is available.
- improves the retry tests to avoid waiting for actual timeout

Bug: 192077544
Test: atest VpnTest (new tests)
Change-Id: I5b47ba98116ac4523a36bc495e8788f29a9ecf20

Yan Yan   commited 2022-06-17 21:27:03 +00:00
37a1ba2202
Merge "Add unit tests for IKEv2 VPN setup and MOBIKE"
Yan Yan   authored and   Gerrit Code Review   commited 2022-06-17 17:53:59 +00:00
554eb0699c
Merge "Send callback if ip provisioning is interrupted"
James Mattis   authored and   Gerrit Code Review   commited 2022-06-17 15:20:26 +00:00
7d5aae1a55
Remove the package name from PermissionMonitor dump logs
According to the Android CDD, the connectivity bug report can not
include any kind of unser-installed package name. Thus, remove
the package name from PermissionMonitor dump logs.

Before:
2022-06-17T04:12:58.317509 - Package remove: name=com.android.\
    frameworks.tests.net, uid=10092, nPerm=(NONE/NETWORK),\
    tPerm=UNINSTALLED
2022-06-17T04:11:22.539777 - Package add: name=com.android.\
    frameworks.tests.net, uid=10092, nPerm=(NETWORK/NONE),\
    tPerm=INTERNET

After:
2022-06-17T12:45:00.430175 - Package remove: uid=10092,\
    nPerm=(NONE/NETWORK), tPerm=UNINSTALLED
2022-06-17T12:44:56.144445 - Package add: uid=10092,\
    nPerm=(NETWORK/NONE), tPerm=INTERNET

Bug: 235512126
Test: adb shell dumpsys connectivity to see the logs.
Change-Id: I9eb496a1b27575e6b5e84d289280a8e49d212020

Paul Hu   commited 2022-06-17 13:11:59 +00:00
d0bed12661
Merge "Don't make an interface default if it has defined capabilities."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-06-17 06:34:34 +00:00
81f162992e
Merge "Remove unused functions in TrafficController"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-06-17 02:38:57 +00:00
ea95231d63
Merge "Use 'cmd package list packages' to get the app uid."
Sudheer Shanka   authored and   Gerrit Code Review   commited 2022-06-17 02:12:01 +00:00
d7054da22b
Use 'cmd package list packages' to get the app uid.
Bug: 236278861
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java#testDataSaverMode_reinstall
Change-Id: Ie68a3a26a5b3e67d4c8224ca53b3b28de6b317e8
Merged-In: Ie68a3a26a5b3e67d4c8224ca53b3b28de6b317e8

Sudheer Shanka   commited 2022-06-17 02:11:53 +00:00
3a398f91b3
Merge changes I70384830,Ie97c2611,I7064edda,I290136b4,Ide697f65, ...
* changes:
  ethernet: add test that covers link up / down behavior
  ethernet: add updateConfiguration support to EthernetManagerTest
  ethernet: add support for enable/disableInterface in tests
  ethernet: clean up HandlerExecutor usage in test
  ethernet: address test review comments
  ethernet: get MTU size directly from TestNetworkInterface

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-06-17 01:54:47 +00:00
bbae90476d
Merge "Add jarjar rules generator"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-06-17 01:09:11 +00:00
49d6b5d80b
Add unit tests for IKEv2 VPN setup and MOBIKE
Add unit tests for IKEv2 VPN setup and handling network change.

Bug: 192077544
Test: atest VpnTest (new tests)
Change-Id: Idd13a3ae57a521901c576bdd33ca0170e94be048

Yan Yan   commited 2022-06-17 00:14:32 +00:00
4b0e4b1f17
Merge "switch netd_configuration_map from hash map to array"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-06-16 23:54:15 +00:00
a899aa253a
Merge "verify CLAT_MARK matches aidl constant."
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-06-16 23:08:41 +00:00
3b4612b15a
switch netd_configuration_map from hash map to array
This eliminates the need for netd_updatable BpfHandler.cpp
to initialize the hash map with a zero.

On startup the map will be freshly initialized and thus zero.

On restart it might not be empty, but it doesn't matter to netd.
Furthermore the mainline component of the system server will
re-initialize it again anyway:
see service/native/TrafficController.cpp initMaps()

This does remove the ability to call deleteValue on a key,
since that would always return -EINVAL, but since we don't
currently do that, that's really a feature.

(It does suggest though that we should have a BpfMapNonNullable
 class which is writeable, but without a deleteValue() function)

Additionally BpfMap arrays are more efficient for the kernel bpf jit
compiler, as - on newer kernels - it can optimize the read/write
into a simple memory access (as opposed to a bpf helper call).

Before:
  $ adb shell ls -l /sys/fs/bpf/netd_shared/map_netd_configuration_map
  -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:20 /sys/fs/bpf/netd_shared/ map_netd_configuration_map

After:
  $ adbz shell ls -l /sys/fs/bpf/netd_shared/map_netd_configuration_map
  -r--rw---- 1 root net_bw_acct 0 2022-06-16 15:03 /sys/fs/bpf/netd_shared/map_netd_configuration_map

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

Maciej Żenczykowski   commited 2022-06-16 22:53:42 +00:00
b10e055f4b
verify CLAT_MARK matches aidl constant.
Bug: 235778483
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ife3ad35b2e5451727a3795a0e78dd820293c0eae

Maciej Żenczykowski   commited 2022-06-16 21:39:32 +00:00
ce9108f01a
ethernet: add test that covers link up / down behavior
Test: atest EthernetManagerTest
Change-Id: I703848309ffbe3993bdcd9666def4a64039f905f

Patrick Rohr   commited 2022-06-16 12:23:22 -07:00
5cfb761d6c
ethernet: add updateConfiguration support to EthernetManagerTest
Test: m -- test only change
Change-Id: Ie97c2611b45d97ca504e6b536ae957d442b314ae

Patrick Rohr   commited 2022-06-16 12:19:50 -07:00
7312d3e0d6
ethernet: add support for enable/disableInterface in tests
Adds an outcome receiver and wraps the EthernetManager#enableInterface
and EthernetManager#disableInterface APIs.

Test: m -- test only change
Change-Id: I7064edda3ebbdd91e2bf28651fdf85b9a7cf2134

Patrick Rohr   commited 2022-06-16 12:14:17 -07:00
901ff96210
ethernet: clean up HandlerExecutor usage in test
Test: atest EthernetManagerTest
Change-Id: I290136b4628e6ee7756772faa477467b04aade2e

Patrick Rohr   commited 2022-06-16 12:14:15 -07:00
7083beb088