Remove RootTargetPreparer from art_standalone_artd_tests.

This test is part of ART MTS. We cannot use root because MTS runs on
user builds. In fact, most of the test cases don't need root.

This CL skips a test case that requires root. The test case will be
fixed later. Tracked by b/289037540.

Bug: 288989992
Test: atest art_standalone_artd_tests
Change-Id: I111c5d42c1020c353cbf5eebb0e49f26ea5bc2cb
Merged-In: I111c5d42c1020c353cbf5eebb0e49f26ea5bc2cb
diff --git a/artd/art_standalone_artd_tests.xml b/artd/art_standalone_artd_tests.xml
index 9125046..8a48b84 100644
--- a/artd/art_standalone_artd_tests.xml
+++ b/artd/art_standalone_artd_tests.xml
@@ -15,8 +15,6 @@
 -->
 <!-- Note: This test config file for {MODULE} is generated from a template. -->
 <configuration description="Runs {MODULE}.">
-    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
-
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
         <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}/{MODULE}" />
diff --git a/artd/artd_test.cc b/artd/artd_test.cc
index 44ddae9..f433fcd 100644
--- a/artd/artd_test.cc
+++ b/artd/artd_test.cc
@@ -114,6 +114,8 @@
 using PrimaryRefProfilePath = ProfilePath::PrimaryRefProfilePath;
 using TmpProfilePath = ProfilePath::TmpProfilePath;
 
+constexpr uid_t kRootUid = 0;
+
 ScopeGuard<std::function<void()>> ScopedSetLogger(android::base::LogFunction&& logger) {
   android::base::LogFunction old_logger = android::base::SetLogger(std::move(logger));
   return make_scope_guard([old_logger = std::move(old_logger)]() mutable {
@@ -1837,6 +1839,11 @@
 }
 
 TEST_F(ArtdTest, cleanup) {
+  // TODO(b/289037540): Fix this.
+  if (getuid() != kRootUid) {
+    GTEST_SKIP() << "This test requires root access";
+  }
+
   std::vector<std::string> gc_removed_files;
   std::vector<std::string> gc_kept_files;