From b8baa8dd34d4cc7b2fa5717495340999deb097ee Mon Sep 17 00:00:00 2001 From: Daniel Rosenberg Date: Fri, 7 Apr 2023 13:02:42 -0700 Subject: [PATCH] Require root for StartConsole Test This test requires root to run. Skip if not root. Bug: 270052268 Test: CtsInitTestCases init#StartConsole Change-Id: I8b54acf97cda4bc2cfa15d0e34c678ec2b13f83e --- init/init_test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init/init_test.cpp b/init/init_test.cpp index 1e69ede0b..295aad41b 100644 --- a/init/init_test.cpp +++ b/init/init_test.cpp @@ -201,6 +201,10 @@ TEST(init, StartConsole) { GTEST_SKIP() << "Must run on userdebug/eng builds. b/262090304"; return; } + if (getuid() != 0) { + GTEST_SKIP() << "Must be run as root."; + return; + } std::string init_script = R"init( service console /system/bin/sh class core