Snap for 6686656 from aa8176185e72a346b359a6287972070f471146d8 to sdk-release

Change-Id: Ibbb52f8a23b05e656401ff046384d9d6df5af020
diff --git a/Android.bp b/Android.bp
index 61fbc3d..eaf89a8 100644
--- a/Android.bp
+++ b/Android.bp
@@ -153,6 +153,7 @@
     name: "libbase_test",
     defaults: ["libbase_cflags_defaults"],
     host_supported: true,
+    require_root: true,
     srcs: [
         "cmsg_test.cpp",
         "endian_test.cpp",
diff --git a/properties_test.cpp b/properties_test.cpp
index 94ae690..1655528 100644
--- a/properties_test.cpp
+++ b/properties_test.cpp
@@ -16,6 +16,8 @@
 
 #include "android-base/properties.h"
 
+#include <unistd.h>
+
 #include <gtest/gtest.h>
 
 #include <atomic>
@@ -45,6 +47,11 @@
 }
 
 TEST(properties, too_long) {
+#if !defined(_WIN32)
+  if (getuid() != 0) {
+    GTEST_SKIP() << "Skipping test, must be run as root.";
+  }
+#endif
   // Properties have a fixed limit on the size of their value.
   std::string key("debug.libbase.property_too_long");
   std::string value(92, 'a');