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

Commit 2f050868 authored by Daniel Rosenberg's avatar Daniel Rosenberg
Browse files

Only run GentleKill test as root

Without root, Service::Start() fails due to lack of permissions.

Bug: 267559075
Test: run cts -m CtsInitTestCases -t init#GentleKill
      atest init#GentleKill
      Will skip under cts, pass under atest
Change-Id: I69e8be7000718bdba1c2acd9675b5645c0891afc
parent 22387708
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -679,6 +679,10 @@ pid_t ForkExecvpAsync(const std::vector<std::string>& args) {
}

TEST(init, GentleKill) {
    if (getuid() != 0) {
        GTEST_SKIP() << "Must be run as root.";
        return;
    }
    std::string init_script = R"init(
service test_gentle_kill /system/bin/sleep 1000
    disabled