summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2018-11-02 14:51:18 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-11-02 14:51:18 +0000
commitf4d39e21dff96005e8d152e34e6ac588c90b76b0 (patch)
tree1e6adea294be47fac45f142919de54c23c93eab7
parent1eb32e2ffd899e0e70d4cea1c5f5817fd52def1f (diff)
parent1b8700f70e4cf520fcb76202d2a22bfb528c5560 (diff)
Merge "Installd: Add selinux check"
-rw-r--r--cmds/installd/tests/installd_dexopt_test.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmds/installd/tests/installd_dexopt_test.cpp b/cmds/installd/tests/installd_dexopt_test.cpp
index f216c53be4..eb69e780f3 100644
--- a/cmds/installd/tests/installd_dexopt_test.cpp
+++ b/cmds/installd/tests/installd_dexopt_test.cpp
@@ -143,6 +143,20 @@ static const char kDexFile[] =
"AAAACADojmFLPcugSwoBAAAUAgAACwAYAAAAAAAAAAAAoIEAAAAAY2xhc3Nlcy5kZXhVVAUAA/Ns"
"+ll1eAsAAQQj5QIABIgTAABQSwUGAAAAAAEAAQBRAAAATwEAAAAA";
+class DexoptTestEnvTest : public testing::Test {
+};
+
+TEST_F(DexoptTestEnvTest, CheckSelinux) {
+ ASSERT_EQ(1, is_selinux_enabled());
+
+ // Crude cutout for virtual devices.
+#if !defined(__i386__) && !defined(__x86_64__)
+ constexpr bool kIsX86 = false;
+#else
+ constexpr bool kIsX86 = true;
+#endif
+ ASSERT_TRUE(1 == security_getenforce() || kIsX86);
+}
class DexoptTest : public testing::Test {
protected: