diff options
author | Bowgo Tsai <bowgotsai@google.com> | 2017-03-10 09:00:40 +0100 |
---|---|---|
committer | Bowgo Tsai <bowgotsai@google.com> | 2017-03-10 10:27:31 +0100 |
commit | d13b6cf29c71412adac3b0dca5eddcd6c75f5163 (patch) | |
tree | d31cee0706e0d942689c65cd30a0edf94c591c32 /tests | |
parent | Merge "recovery: Fix the FIXME in get_menu_selection()." (diff) | |
download | android_bootable_recovery-d13b6cf29c71412adac3b0dca5eddcd6c75f5163.tar android_bootable_recovery-d13b6cf29c71412adac3b0dca5eddcd6c75f5163.tar.gz android_bootable_recovery-d13b6cf29c71412adac3b0dca5eddcd6c75f5163.tar.bz2 android_bootable_recovery-d13b6cf29c71412adac3b0dca5eddcd6c75f5163.tar.lz android_bootable_recovery-d13b6cf29c71412adac3b0dca5eddcd6c75f5163.tar.xz android_bootable_recovery-d13b6cf29c71412adac3b0dca5eddcd6c75f5163.tar.zst android_bootable_recovery-d13b6cf29c71412adac3b0dca5eddcd6c75f5163.zip |
Diffstat (limited to 'tests')
-rw-r--r-- | tests/common/component_test_util.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/tests/common/component_test_util.h b/tests/common/component_test_util.h index 44322972b..3fee32d62 100644 --- a/tests/common/component_test_util.h +++ b/tests/common/component_test_util.h @@ -24,21 +24,14 @@ // Check if the /misc entry exists in the fstab. static bool parse_misc() { - // The fstab path is "/fstab.${ro.hardware}". - std::string ro_hardware = android::base::GetProperty("ro.hardware", ""); - if (ro_hardware.empty()) { - GTEST_LOG_(INFO) << "Failed to get ro.hardware."; + std::unique_ptr<fstab, decltype(&fs_mgr_free_fstab)> fstab(fs_mgr_read_fstab_default(), + fs_mgr_free_fstab); + if (!fstab) { + GTEST_LOG_(INFO) << "Failed to read default fstab"; return false; } - std::string fstab_path = "/fstab." + ro_hardware; - fstab* fstab = fs_mgr_read_fstab(fstab_path.c_str()); - if (fstab == nullptr) { - GTEST_LOG_(INFO) << "Failed to read " << fstab_path; - return false; - } - - fstab_rec* record = fs_mgr_get_entry_for_mount_point(fstab, "/misc"); + fstab_rec* record = fs_mgr_get_entry_for_mount_point(fstab.get(), "/misc"); if (record == nullptr) { GTEST_LOG_(INFO) << "Failed to find /misc in fstab."; return false; |