Merge "init: Do full shutdown even for thermal shutdown"
diff --git a/fs_mgr/fs_mgr_verity.cpp b/fs_mgr/fs_mgr_verity.cpp
index 5de0903..7f8e1e2 100644
--- a/fs_mgr/fs_mgr_verity.cpp
+++ b/fs_mgr/fs_mgr_verity.cpp
@@ -841,9 +841,15 @@
// verify the signature on the table
if (verify_verity_signature(verity) < 0) {
+ // Allow signature verification error when the device is unlocked
+ if (fs_mgr_is_device_unlocked()) {
+ retval = FS_MGR_SETUP_VERITY_SKIPPED;
+ LWARNING << "Allow signature verification error when the device is unlocked";
+ goto out;
+ }
if (params.mode == VERITY_MODE_LOGGING) {
// the user has been warned, allow mounting without dm-verity
- retval = FS_MGR_SETUP_VERITY_SUCCESS;
+ retval = FS_MGR_SETUP_VERITY_SKIPPED;
goto out;
}
diff --git a/init/ueventd_test.cpp b/init/ueventd_test.cpp
index 86d7055..4d9a1fa 100644
--- a/init/ueventd_test.cpp
+++ b/init/ueventd_test.cpp
@@ -63,7 +63,10 @@
}
TEST(ueventd, setegid_IsPerThread) {
- if (getuid() != 0) return;
+ if (getuid() != 0) {
+ GTEST_LOG_(INFO) << "Skipping test, must be run as root.";
+ return;
+ }
TemporaryDir dir;
@@ -78,13 +81,20 @@
for (const auto& [file, expected_gid] : files_and_gids) {
struct stat info;
- EXPECT_EQ(0, stat(file.c_str(), &info));
+ ASSERT_EQ(0, stat(file.c_str(), &info));
EXPECT_EQ(expected_gid, info.st_gid);
}
}
TEST(ueventd, setfscreatecon_IsPerThread) {
- if (getuid() != 0) return;
+ if (getuid() != 0) {
+ GTEST_LOG_(INFO) << "Skipping test, must be run as root.";
+ return;
+ }
+ if (!is_selinux_enabled() || security_getenforce() == 1) {
+ GTEST_LOG_(INFO) << "Skipping test, SELinux must be enabled and in permissive mode.";
+ return;
+ }
const char* const contexts[] = {
"u:object_r:audio_device:s0",
@@ -105,7 +115,7 @@
for (const auto& [file, expected_context] : files_and_contexts) {
char* file_context;
- EXPECT_GT(getfilecon(file.c_str(), &file_context), 0);
+ ASSERT_GT(getfilecon(file.c_str(), &file_context), 0);
EXPECT_EQ(expected_context, file_context);
freecon(file_context);
}