Merge "init_kill_services_test: don't always try to kill hwservicemanager" into main

This commit is contained in:
Devin Moore 2024-04-02 16:37:00 +00:00 committed by Gerrit Code Review
commit bc4f870aaa
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