Add a test asserting that default fstab has /data entry
When aosp/1149619 is merged, userspace reboot will start to depend on
the fact that default fstab has an entry for /data, hence this test
to make sure that this is the case.
Bug: 135984674
Test: atest CtsFsMgrTestCases
Change-Id: I7a3c181a6b27a7b4dfc344ff04be712f3fe3376e
diff --git a/fs_mgr/tests/fs_mgr_test.cpp b/fs_mgr/tests/fs_mgr_test.cpp
index a7ea817..639ba3a 100644
--- a/fs_mgr/tests/fs_mgr_test.cpp
+++ b/fs_mgr/tests/fs_mgr_test.cpp
@@ -1081,3 +1081,10 @@
EXPECT_EQ("none5", entry->mount_point);
EXPECT_EQ("/dev/path2", entry->zram_backing_dev_path);
}
+
+TEST(fs_mgr, DefaultFstabContainsUserdata) {
+ Fstab fstab;
+ ASSERT_TRUE(ReadDefaultFstab(&fstab)) << "Failed to read default fstab";
+ ASSERT_NE(nullptr, GetEntryForMountPoint(&fstab, "/data"))
+ << "Default fstab doesn't contain /data entry";
+}