Commit graph android_packages_modules_Co.../tests
Message SHA1
Merge "Always wait for interface to be up in EthernetManagerTest" am: adf8f72856 am: 7cc696eb1b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2062850

Change-Id: I28c60909f879ccd8217545a21888dae40bf264ee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Patrick Rohr   authored and   Automerger Merge Worker   commited 2022-05-20 13:16:22 +00:00
b6ddec4e3f
Merge "Move ipconfig file inside apex data directory" into tm-dev am: 9f57db4bda
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18514356

Change-Id: Ibb2d1c50fb68622d38f9c5db319de13f40147e96
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

TreeHugger Robot   authored and   Automerger Merge Worker   commited 2022-05-20 12:54:13 +00:00
b1dea19099
Move ipconfig file inside apex data directory
In order to support rollbacks, the ethernet ipconfig file needs to be
written to the data apex's data directory. We still need to support
reading from the legacy location to be backwards compatible.

If the apex file path already exists, then read the IP configuration
from there directly, otherwise, check if the legacy file path exists,
if yes, read the legacy IP configuration and copy it to the new apex
file path.

Support for default IpConfiguration is also being removed in this CL.
The default IpConfiguration (configuration entry for interface "0")
was a way to transition from supporting a single interface to
supporting multiple interfaces and was introduced in P. Every device
that has used such a configuration and has connected to an ethernet
network since upgrading to P+ has already removed the "0" config and
has assigned it to the first interface (probably "eth0"). There has
never been an API to set this, but if someone wanted to install a
default IpConfiguration, they could just configure "eth0" instead.

Bug: 224919694
Test: atest EthernetConfigStoreTest --iterations
Test: manually test
      - adb push <fake ipconfig.txt> /data/misc/ethernet/
      - adb reboot
      - read the IP config from legacy path and the same config
        file is created in the apex file path
      - adb reboot
      - read the IP config from the apex file path directly
Change-Id: Ifb82a5d7fa13d17ea8fd3a42a19cd020cb95e26a
(cherry picked from commit 47641d75d9)
Merged-In: Ifb82a5d7fa13d17ea8fd3a42a19cd020cb95e26a

Patrick Rohr   authored and   Cherrypicker Worker   commited 2022-05-20 07:50:55 +00:00
64468d1494
Merge "Always wait for interface to be up in EthernetManagerTest"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-05-20 05:53:00 +00:00
adf8f72856
Merge "Move ipconfig file inside apex data directory"
Xiao Ma   authored and   Gerrit Code Review   commited 2022-05-20 05:43:40 +00:00
56c6392586
Merge changes I91e987d6,I03e7cda7 into tm-dev
* changes:
  Changing automotive ethernet allowed UIDs check
  Allow ethernet on automotive to set allowed UIDs

TreeHugger Robot   authored and   Android (Google) Code Review   commited 2022-05-20 03:29:14 +00:00
0657071494
Always wait for interface to be up in EthernetManagerTest
Adds a global listener that is used to wait for an interface to show up
in EthernetTracker when it is newly created. This prevents races when
the interface is used directly after creation.

This test should fix the testCallback flakes.

Test: atest EthernetManagerTest
Bug: 227008268
Change-Id: I37d2ec63aea9f4de6010e13150bc236ee07e2f85

Patrick Rohr   commited 2022-05-19 20:21:44 -07:00
5f45a3742a
Move ipconfig file inside apex data directory
In order to support rollbacks, the ethernet ipconfig file needs to be
written to the data apex's data directory. We still need to support
reading from the legacy location to be backwards compatible.

If the apex file path already exists, then read the IP configuration
from there directly, otherwise, check if the legacy file path exists,
if yes, read the legacy IP configuration and copy it to the new apex
file path.

Support for default IpConfiguration is also being removed in this CL.
The default IpConfiguration (configuration entry for interface "0")
was a way to transition from supporting a single interface to
supporting multiple interfaces and was introduced in P. Every device
that has used such a configuration and has connected to an ethernet
network since upgrading to P+ has already removed the "0" config and
has assigned it to the first interface (probably "eth0"). There has
never been an API to set this, but if someone wanted to install a
default IpConfiguration, they could just configure "eth0" instead.

Bug: 224919694
Test: atest EthernetConfigStoreTest --iterations
Test: manually test
      - adb push <fake ipconfig.txt> /data/misc/ethernet/
      - adb reboot
      - read the IP config from legacy path and the same config
        file is created in the apex file path
      - adb reboot
      - read the IP config from the apex file path directly
Change-Id: Ifb82a5d7fa13d17ea8fd3a42a19cd020cb95e26a

Patrick Rohr   authored and   Xiao Ma   commited 2022-05-20 09:20:54 +09:00
47641d75d9
Merge "Update UriTest for changes to toSafeString" into tm-dev am: d2db378c63
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18282578

Change-Id: Ie7bdb15e3ad2e62e8f3c5c93aac1a82c63713420
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Amith Yamasani   authored and   Automerger Merge Worker   commited 2022-05-19 17:14:44 +00:00
e69c6b35b9
Merge "Update UriTest for changes to toSafeString" into tm-dev
Amith Yamasani   authored and   Android (Google) Code Review   commited 2022-05-19 16:53:29 +00:00
d2db378c63
Changing automotive ethernet allowed UIDs check
Updating the automotive allowed UIDs check to only work if the
capabilities have a single transport equal to ethernet.

CP of https://r.android.com/2101472

Bug: 229419469
Test: atest FrameworksNetTests
Change-Id: I91e987d6b943a3c5986ab88553a6eef0d479b079
Merged-In: I91e987d6b943a3c5986ab88553a6eef0d479b079

James Mattis   commited 2022-05-19 09:13:31 -07:00
a2ea68df28
Merge "Assume all Ethernet interfaces have an MTU of 1500." am: bd77794547 am: 96d88aee2e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2096824

Change-Id: I84b7026c1247335d54bd82a98a248f37c015e964
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-05-19 15:58:28 +00:00
25390ed719
Merge "Assume all Ethernet interfaces have an MTU of 1500."
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-19 15:40:03 +00:00
bd77794547
Merge "bpf_existence_test: block & dscp_policy progs require 5.4+ kernel" into tm-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2022-05-19 15:19:22 +00:00
996b8a0231
Merge changes from topic "stats-migration" into tm-dev am: ac6213123a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18486287

Change-Id: Ic8527bf901cb2a2ade80a623a363a27644ac5d32
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Junyu Lai   authored and   Automerger Merge Worker   commited 2022-05-19 14:55:26 +00:00
f397add671
Don't clobber existing history entries. am: b36e57a004
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18453213

Change-Id: Ibc9975485b6b1a7d5240aefa9366e1f39b856450
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2022-05-19 14:55:25 +00:00
6b98db3000
Ensure NetworkStats migrated snapshot is identical am: 3776d862e2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18452103

Change-Id: I0266b4e2eea0e783db15024027efab1b16a7b13c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2022-05-19 14:55:24 +00:00
7d5660982e
[MS82.1] Support network stats data migration process am: 27e0a9833e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18367994

Change-Id: I3e81555cd0871883571d925422b82d8fd7bdd10b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Junyu Lai   authored and   Automerger Merge Worker   commited 2022-05-19 14:55:21 +00:00
2eefcdcf0c
Add a PersistentInt class. am: 76c0f6f0e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18437645

Change-Id: I9497d4812ab9cafb42e2b6a0653f6094cbc18cfa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2022-05-19 14:55:19 +00:00
e30044bb1f
Merge changes from topic "stats-migration" into tm-dev
* 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.

Junyu Lai   authored and   Android (Google) Code Review   commited 2022-05-19 14:54:01 +00:00
ac6213123a
Allow ethernet on automotive to set allowed UIDs
Allow ethernet factories on automotive devices to set the allowed UIDs
on NetworkCapabilities.

CP of https://r.android.com/2072767

Bug: 229419469
Test: atest FrameworksNetTests
Change-Id: I03e7cda75f1c530e0d0e4a756330bc9847a96668
Merged-In: I03e7cda75f1c530e0d0e4a756330bc9847a96668

James Mattis   commited 2022-05-19 07:48:05 -07:00
45f3e41a6a
Merge "Changing automotive ethernet allowed UIDs check" am: 36cae536f0 am: fe4f42ff48
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2101472

Change-Id: I280093a80cdbc7add7bbeaf20bcb5adf09c90f9b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-05-19 14:17:46 +00:00
e7f85a6d71
bpf_existence_test: block & dscp_policy progs require 5.4+ kernel
Bug: 233119387
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8df3c0c1b9f4b60a55472d2402dcea368020985b
(cherry picked from commit 93b8cc1556)
Merged-In: I8df3c0c1b9f4b60a55472d2402dcea368020985b

Maciej Å»enczykowski   authored and   Cherrypicker Worker   commited 2022-05-19 13:52:09 +00:00
588c707f20
Merge "Changing automotive ethernet allowed UIDs check"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-19 13:29:16 +00:00
36cae536f0
Merge "bpf_existence_test: block & dscp_policy progs require 5.4+ kernel" am: 2adcebee36 am: 253a2403f7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2100073

Change-Id: If827e5c66f712af6a3f79c231ea6b2e1a6531623
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Maciej Å»enczykowski   authored and   Automerger Merge Worker   commited 2022-05-19 12:24:25 +00:00
f95b9cc9c7
move netd maps and progs into /sys/fs/bpf/netd_shared/...
(out of current /sys/fs/bpf/net_shared/...)

This will allow genfscon regexp changes in a followup selinux commit.

Note that this has a hard dependency on system/bpf change
  'bpfloader: add support for netd_shared and net_private subdirs'
which also bumps bpfloader to v0.13.

This was merged May 12, 2022 (into both aosp/master and tm-dev)
and it is in Android T starting with Beta 3 release.

This isn't really an issue since amusingly T Beta 2 is already
incompatible with current mainline releases due to the snap
reverting a previous required bpfloader system/bpf change:
  move net_shared bpf programs into net_shared subdirectory
See: http://b/232050459#comment14

So this doesn't break T Beta1/2, since they already don't work,
and Beta3 will work.

Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id5f14d6e3f11cfe35d9d8a9496548a2bc4d022ec
(cherry picked from commit 6d116d0f38)
Merged-In: Id5f14d6e3f11cfe35d9d8a9496548a2bc4d022ec

Maciej Å»enczykowski   commited 2022-05-19 11:46:43 +00:00
a52aca70ee
bpf_existence_test: block & dscp_policy progs require 5.4+ kernel
Bug: 233119387
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8df3c0c1b9f4b60a55472d2402dcea368020985b

Maciej Å»enczykowski   commited 2022-05-19 08:06:41 +00:00
93b8cc1556
Skip PersistentIntTest on S- device
This class is only used in the service runs on T+ devices.
Thus run this test on S- device does not make senses.

Ignore-AOSP-First: in a topic with internal-only changes
Bug: 230289468
Test: atest ConnectivityCoverageTests:PersistentIntTest
      on S device
Change-Id: I97a29df17ef9ee9ab373655f045cdb5c820e06ef

Junyu Lai   commited 2022-05-19 15:09:42 +08:00
c3f7cabe59
Changing automotive ethernet allowed UIDs check
Updating the automotive allowed UIDs check to only work if the
capabilities have a single transport equal to ethernet.

Bug: 229419469
Test: atest FrameworksNetTests
Change-Id: I91e987d6b943a3c5986ab88553a6eef0d479b079

James Mattis   commited 2022-05-18 22:18:14 -07:00
4eff0efb57
Merge "Fix the ethernet setting API bug." into tm-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2022-05-19 05:00:44 +00:00
3f9661fff5
Merge "Updating Eth CTS to account for existing ifaces" into tm-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2022-05-19 04:18:02 +00:00
d241363af5
Assume all Ethernet interfaces have an MTU of 1500.
This avoids races where NetworkInterface.getByName does not return the interface
right after it is created.

Change-Id: I17a5a22034bafc30023307d5480db18e918fc042
Test: test-only change
Bug: 227008268

Lorenzo Colitti   commited 2022-05-19 02:45:16 +00:00
d0ebb64ad1
Fix the ethernet setting API bug.
After turning off the ethernet settings via api, the ethernet service
can still be started when plugging-in the cable. Improve the api by
ignoring the upcoming interface unsolicited event listener callbacks
and register new interface observer once the ethernet setting is enabled
again.

Bug: 231933028
Test: atest testListenEthernetStateChange_unsolicitedEventListener
Change-Id: I1b1cb7d157f023fca82d75592168bd360a6fa6e1
(cherry picked from commit 94a00dfc64)
Merged-In: I1b1cb7d157f023fca82d75592168bd360a6fa6e1

Xiao Ma   authored and   Cherrypicker Worker   commited 2022-05-19 01:58:15 +00:00
9cae3c8a99
Merge "Add CTS for verifying non-ASCII characters on NsdService" into tm-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2022-05-19 01:16:36 +00:00
b7d8db3e77
Merge "Fix running CtsNetTestCasesLatestSdk errors on NsdManagerTest" into tm-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2022-05-19 01:12:51 +00:00
26df199f45
Merge "Fix the ethernet setting API bug." am: 493ce14eaf am: 4fbfc8b270
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2099112

Change-Id: Ic998f930fcf57d04c04089ea5a7e919325b8acdf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Patrick Rohr   authored and   Automerger Merge Worker   commited 2022-05-18 21:30:57 +00:00
473b5411e2
Merge "Fix the ethernet setting API bug."
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-05-18 20:56:34 +00:00
493ce14eaf
Merge "Revert "Autogenerate connectivity jarjar rules"" into tm-dev
Colin Cross   authored and   Android (Google) Code Review   commited 2022-05-18 19:50:52 +00:00
06ce505fba
Merge changes Ide01c994,Ia9f12a7b am: 708b1ab707 am: f2678a4464
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2100947

Change-Id: I0ba008426458e801983d1b45065f6b1736a34a82
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Colin Cross   authored and   Automerger Merge Worker   commited 2022-05-18 19:00:04 +00:00
a2887bb928
Revert "Autogenerate connectivity jarjar rules"
This reverts commit 53eb35cd82.

Reason for revert: b/233081774, caused long build times in FrameworkNetTests

Change-Id: Ide01c994f694b55fc0e87bb0e81584ac44196e68
Merged-In: Ide01c994f694b55fc0e87bb0e81584ac44196e68
(cherry picked from commit ece3171cf0)

Colin Cross   commited 2022-05-18 11:43:11 -07:00
8e50171f0d
Merge changes Ide01c994,Ia9f12a7b
* changes:
  Revert "Autogenerate connectivity jarjar rules"
  Revert "Clarify comment in gen_jarjar.py"

Colin Cross   authored and   Gerrit Code Review   commited 2022-05-18 18:34:32 +00:00
708b1ab707
Revert "Autogenerate connectivity jarjar rules"
This reverts commit 53eb35cd82.

Reason for revert: b/233081774, caused long build times in FrameworkNetTests

Change-Id: Ide01c994f694b55fc0e87bb0e81584ac44196e68

Colin Cross   commited 2022-05-18 18:30:27 +00:00
ece3171cf0
Updating Eth CTS to account for existing ifaces
Updating EthernetManagerTest to account for existing ethernet
interfaces. Specifically, testCallbacks() assumed the test interface
created would be the only ethernet interface on the device. This would
cause the test to fail if other ethernet interfaces existed.

CP of https://r.android.com/2075319

Bug: 230305098
Test: atest CtsNetTestCases:android.net.cts.EthernetManagerTest
Change-Id: I675c4ef5c2bd96d01a057bdfec1794d6bfcf82bb
Merged-In: I675c4ef5c2bd96d01a057bdfec1794d6bfcf82bb

James Mattis   commited 2022-05-18 11:12:06 -07:00
22df07055d
Don't clobber existing history entries.
Currently, adding a history to a NetworkStatsCollection.Builder
will overwrite any history that was previously passed in with the
same key. This breaks the importer (which is the primary/only
caller of this code), because the importer re-uses the same
NetworkStatsCollection object to import multiple files.

Instead, simply add any passed-in entries after the ones that
were already there. Require the caller to pass in entries in
order, because NetworkStatsHistory internally assumes that
entris are always sorted.

Ignore-AOSP-First: in a topic with internal-only changes
Bug: 230289468
Test: manually verified this unbreaks the importer
Change-Id: Ic8647ff28fca78d579d5f759f96a864877f8158b

Lorenzo Colitti   authored and   Junyu Lai   commited 2022-05-18 23:51:03 +08:00
b36e57a004
Ensure NetworkStats migrated snapshot is identical
Read migration snapshot both from the platform API and the legacy
method, and Log.wtf if they are different. Use the legacy method data if
they are.

This ensures that using the migration API is a no-op, and that errors
are reported (through Log.wtf) if it would not have been if used as-is.

Ignore-AOSP-First: in a topic with internal-only changes
Test: NetworkStatsServiceTest
Bug: 230289468
Change-Id: I857ad18183d63d1aa16e89f89eb24009648720a2

Remi NGUYEN VAN   authored and   Junyu Lai   commited 2022-05-18 23:51:03 +08:00
3776d862e2
[MS82.1] Support network stats data migration process
This includes:
1. Provide NetworkStatsRecorder#importCollectionLocked to
   allow caller to write a NetworkStatsCollection object to
   a standalone file.
2. Do not clear the collection in NetworkStatsRecorder#
   CombiningRewriter, this is safe since pending set will
   still be cleared during forcePersistLocked.
3. Implement the migration process, including recovery and
   safety measures.

Test: NetworkStatsServiceTest NetworkStatsCollectionTest
Test: manual test with
      adb shell device_config put tethering \
      netstats_store_files_in_apexdata true
      adb shell device_config put tethering \
      netstats_import_legacy_target_attempts 1
Ignore-AOSP-First: in a topic with internal-only changes
Bug: 230289468
Change-Id: Ic2002cbfd5a6b3c2226fa8dab22481f8ce656574

Junyu Lai   commited 2022-05-18 23:34:30 +08:00
27e0a9833e
Add a PersistentInt class.
This implements a simple integer written to disk backed by
AtomicFile.

Bug: 230289468
Test: new unit test
Ignore-AOSP-First: in a topic with internal-only changes
Change-Id: I1c73c8ac2429f92153cfba3b006b4374e75e65df

Lorenzo Colitti   authored and   Junyu Lai   commited 2022-05-18 20:54:50 +08:00
76c0f6f0e8
Fix the ethernet setting API bug.
After turning off the ethernet settings via api, the ethernet service
can still be started when plugging-in the cable. Improve the api by
ignoring the upcoming interface unsolicited event listener callbacks
and register new interface observer once the ethernet setting is enabled
again.

Bug: 231933028
Test: atest testListenEthernetStateChange_unsolicitedEventListener
Change-Id: I1b1cb7d157f023fca82d75592168bd360a6fa6e1

Xiao Ma   commited 2022-05-18 17:23:32 +09:00
94a00dfc64
Merge changes I03e7cda7,I675c4ef5 am: af7101ff0f am: ec586c6cdb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2072767

Change-Id: I7e55796d79e6a88ae2a43f7851ef8bccc6ccea04
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-05-18 04:07:26 +00:00
caf8c958ed
Merge changes I03e7cda7,I675c4ef5
* changes:
  Allow ethernet on automotive to set allowed UIDs
  Updating Eth CTS to account for existing ifaces

Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-18 02:52:24 +00:00
af7101ff0f