android_packages_modules_Co.../tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Maciej Żenczykowski 04fb3862a9 Add BPF_MAP_LOCKLESS_FOR_TEST hack for root resolver tests
Per commit description of https://android-review.git.corp.google.com/c/platform/packages/modules/Connectivity/+/3109108 "Use SingleWriterBpfMap in BpfNetMaps":

- firewall.cpp writes to sConfigurationMap, sUidOwnerMap, and
  sDataSaverEnabledMap, but that code only runs in tests because
  it requires root privileges.

So either those maps need to not use SingleWriterBpfMap
in the BpfNetMaps (which would affect performance),
or we need to prevent the tests from grabbing the locks,
or the tests will (presumably) fail.

This avoids grabbing the locks from the test, even though
this is absolutely terrible and likely breaks things...
But in general the entire firewall.cpp file (and libconnectivity_native_test_utils target) are just one
large modularization violation in need of major escalation...

Test via:
  atest resolv_{gold,stress,integration,unit}_test

Without this patch:
  resolv_gold_test: Passed: 16
  resolv_integration_test: Passed: 53, Failed: 2, Ignored: 118, Assumption Failed: 0 (Completed With ERRORS)
  resolv_stress_test: Passed: 2
  resolv_unit_test: Passed: 124, Failed: 2

  4 tests failed
  --------------
  ResolverMultinetworkTest#DnsWithVpn
  PrivateDns/TransportParameterizedTest#BlockDnsQuery/DoT
  CallbackTest#tagSocketCallback
  ResolvGetAddrInfoTest#InvalidParameters

With this patch:
  resolv_gold_test: Passed: 16
  resolv_integration_test: Passed: 178
  resolv_stress_test: Passed: 2
  resolv_unit_test: Passed: 126

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie97d015ef66c3864a23484e7ed190fe7d091af5c
2024-06-14 17:35:29 -07:00
..
benchmark [DON'T BLOCK] Test ownership migration rules 2024-01-31 12:34:50 +00:00
common Stop throwing when the invalid capability is passed 2024-06-05 11:57:18 +09:00
cts Add a local dynamic config for ConnectivityManagerTest to decouple the test config from test logic. 2024-06-13 16:43:47 +08:00
deflake [DON'T BLOCK] Test ownership migration rules 2024-01-31 12:34:50 +00:00
integration Revert^2 "Add blocked reason for internet permission" 2024-05-27 02:12:43 +00:00
mts Build mainline tests with static libc++ and version script 2024-05-20 17:00:24 -07:00
native Add BPF_MAP_LOCKLESS_FOR_TEST hack for root resolver tests 2024-06-14 17:35:29 -07:00
smoketest [DON'T BLOCK] Test ownership migration rules 2024-01-31 12:34:50 +00:00
unit Merge "Do not display "null" in sign-in note details" into main 2024-06-13 09:50:15 +00:00