Merge "service_test: Only run the ServiceStopTest as root" into main am: a34c125cad
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2854013 Change-Id: I64013f0097757b529dc809997abc13032f20163e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
cfd44f56de
1 changed files with 5 additions and 0 deletions
|
@ -236,6 +236,11 @@ class ServiceStopTest : public testing::TestWithParam<bool> {};
|
|||
// Service::Stop() if their uid_%d/pid_%d cgroup directory got removed. This test, if run with the
|
||||
// parameter set to 'true', verifies that such services are stopped.
|
||||
TEST_P(ServiceStopTest, stop) {
|
||||
if (getuid() != 0) {
|
||||
GTEST_SKIP() << "Must be run as root.";
|
||||
return;
|
||||
}
|
||||
|
||||
static constexpr std::string_view kServiceName = "ServiceA";
|
||||
static constexpr std::string_view kScriptTemplate = R"init(
|
||||
service $name /system/bin/yes
|
||||
|
|
Loading…
Reference in a new issue