init_kill_services_test: don't always try to kill hwservicemanager

When HIDL is not supported, hwservicemanager will not be running and may
not even be installed on the device.

Ignore-AOSP-First: Disabling HIDL internally first. Will cherry-pick
these test CLs after.

Test: init_kill_services_test
Bug: 218588089
Change-Id: Iae41e35e4669dd62c99ab9f138fc419be2f5fa29
This commit is contained in:
Devin Moore 2024-03-28 21:05:13 +00:00 committed by Steven Moreland
parent bc3476d5dc
commit a5521b0d9f
2 changed files with 9 additions and 1 deletions

View file

@ -10,7 +10,10 @@ package {
cc_test {
name: "init_kill_services_test",
srcs: ["init_kill_services_test.cpp"],
shared_libs: ["libbase"],
shared_libs: [
"libbase",
"libhidlbase",
],
test_suites: ["general-tests"],
// TODO(b/153565474): switch back to auto-generation

View file

@ -18,15 +18,20 @@
#include <android-base/logging.h>
#include <android-base/properties.h>
#include <hidl/ServiceManagement.h>
#include <iostream>
using ::android::base::GetProperty;
using ::android::base::SetProperty;
using ::android::base::WaitForProperty;
using ::android::hardware::isHidlSupported;
using std::literals::chrono_literals::operator""s;
void ExpectKillingServiceRecovers(const std::string& service_name) {
if (!isHidlSupported() && service_name == "hwservicemanager") {
GTEST_SKIP() << "No HIDL support on device so hwservicemanager will not be running";
}
LOG(INFO) << "before we say hi to " << service_name << ", I can't have apexd around!";
// b/280514080 - servicemanager will restart apexd, and apexd will restart the