diff options
author | David Anderson <dvander@google.com> | 2019-06-26 14:48:52 -0700 |
---|---|---|
committer | David Anderson <dvander@google.com> | 2019-07-03 19:16:28 +0000 |
commit | b294e22684954938075171d0401b82c1fc90a497 (patch) | |
tree | 8ad8dc0bb91b319f8f5a241e96a954789e6377b9 | |
parent | 8c9388a1188ef98b9f36d5e8b6dbd462ad08f6e1 (diff) | |
download | gsid-b294e22684954938075171d0401b82c1fc90a497.tar.gz |
Use fstab to find the block device for /metadata.
Bug: 136060211
Test: gsi_boot_test passes
Change-Id: I1c5f24a98651c9dbbfe80cfad9e61612f6882236
Merged-In: I1c5f24a98651c9dbbfe80cfad9e61612f6882236
-rw-r--r-- | tests/boot_tests.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/boot_tests.cpp b/tests/boot_tests.cpp index a9a199e..a8b623d 100644 --- a/tests/boot_tests.cpp +++ b/tests/boot_tests.cpp @@ -37,7 +37,13 @@ TEST(MetadataPartition, FirstStageMount) { } TEST(MetadataPartition, MinimumSize) { - unique_fd fd(open("/dev/block/by-name/metadata", O_RDONLY | O_CLOEXEC)); + Fstab fstab; + ASSERT_TRUE(ReadDefaultFstab(&fstab)); + + auto entry = GetEntryForMountPoint(&fstab, "/metadata"); + ASSERT_NE(entry, nullptr); + + unique_fd fd(open(entry->blk_device.c_str(), O_RDONLY | O_CLOEXEC)); ASSERT_GE(fd, 0); uint64_t size = get_block_device_size(fd); |