Merge "vts_fs_test: Relax filesystem constraints for fixed partitions."
This commit is contained in:
commit
8aee6d4a41
1 changed files with 21 additions and 15 deletions
|
@ -55,6 +55,21 @@ TEST(fs, ErofsSupported) {
|
|||
}
|
||||
|
||||
TEST(fs, PartitionTypes) {
|
||||
// Requirements only apply to Android 13+, 5.10+ devices.
|
||||
int vsr_level = GetVsrLevel();
|
||||
if (vsr_level < __ANDROID_API_T__) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
struct utsname uts;
|
||||
ASSERT_EQ(uname(&uts), 0);
|
||||
|
||||
unsigned int major, minor;
|
||||
ASSERT_EQ(sscanf(uts.release, "%u.%u", &major, &minor), 2);
|
||||
if (major < 5 || (major == 5 && minor < 10)) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
android::fs_mgr::Fstab fstab;
|
||||
ASSERT_TRUE(android::fs_mgr::ReadFstabFromFile("/proc/mounts", &fstab));
|
||||
|
||||
|
@ -64,12 +79,7 @@ TEST(fs, PartitionTypes) {
|
|||
ASSERT_TRUE(android::base::Readlink("/dev/block/by-name/super", &super_bdev));
|
||||
ASSERT_TRUE(android::base::Readlink("/dev/block/by-name/userdata", &userdata_bdev));
|
||||
|
||||
int vsr_level = GetVsrLevel();
|
||||
|
||||
std::vector<std::string> must_be_f2fs;
|
||||
if (vsr_level >= __ANDROID_API_T__) {
|
||||
must_be_f2fs.emplace_back("/data");
|
||||
}
|
||||
std::vector<std::string> must_be_f2fs = {"/data"};
|
||||
if (vsr_level >= __ANDROID_API_U__) {
|
||||
must_be_f2fs.emplace_back("/metadata");
|
||||
}
|
||||
|
@ -98,17 +108,13 @@ TEST(fs, PartitionTypes) {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (vsr_level < __ANDROID_API_T__) {
|
||||
continue;
|
||||
}
|
||||
if (vsr_level == __ANDROID_API_T__ && parent_bdev != super_bdev) {
|
||||
// Only check for dynamic partitions at this VSR level.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entry.flags & MS_RDONLY) {
|
||||
std::vector<std::string> allowed = {"erofs", "ext4", "f2fs"};
|
||||
if (parent_bdev != super_bdev) {
|
||||
// Ignore non-AOSP partitions (eg anything outside of super).
|
||||
continue;
|
||||
}
|
||||
|
||||
std::vector<std::string> allowed = {"erofs", "ext4", "f2fs"};
|
||||
EXPECT_NE(std::find(allowed.begin(), allowed.end(), entry.fs_type), allowed.end())
|
||||
<< entry.mount_point;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue