Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 303252a2 authored by Bart Van Assche's avatar Bart Van Assche Committed by Automerger Merge Worker
Browse files

Merge "service_test: Only run the ServiceStopTest as root" into main am:...

Merge "service_test: Only run the ServiceStopTest as root" into main am: a34c125c am: 7fc41b6c am: 9863de3d

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2854013



Change-Id: I20cb349342c82401103f83208d8fa1b21270fe1a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents bdf660b8 9863de3d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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