Merge "lmkd: test: access /sys/module/lowmemorykiller/ as u:r:shell:s0"
am: b69cb7071d
Change-Id: I230b476f66a86195bfe5cfb3e153960f205cd496
diff --git a/lmkd/tests/lmkd_test.cpp b/lmkd/tests/lmkd_test.cpp
index f17512d..8c7a75f 100644
--- a/lmkd/tests/lmkd_test.cpp
+++ b/lmkd/tests/lmkd_test.cpp
@@ -210,6 +210,13 @@
pid_t pid;
uid_t uid = getuid();
+ // check if in-kernel LMK driver is present
+ if (!access(INKERNEL_MINFREE_PATH, W_OK)) {
+ GTEST_LOG_(INFO) << "Must not have kernel lowmemorykiller driver,"
+ << " terminating test";
+ return;
+ }
+
ASSERT_FALSE((sock = lmkd_connect()) < 0)
<< "Failed to connect to lmkd process, err=" << strerror(errno);
@@ -282,12 +289,6 @@
GTEST_LOG_(INFO) << "Must be userdebug build, terminating test";
return;
}
- // check if in-kernel LMK driver is present
- if (!access(INKERNEL_MINFREE_PATH, W_OK)) {
- GTEST_LOG_(INFO) << "Must not have kernel lowmemorykiller driver,"
- << " terminating test";
- return;
- }
// if respawned test process then run the test and exit (no analysis)
if (getenv(LMKDTEST_RESPAWN_FLAG) != NULL) {