diff options
author | David Anderson <dvander@google.com> | 2019-06-26 14:48:52 -0700 |
---|---|---|
committer | David Anderson <dvander@google.com> | 2019-06-26 16:33:56 -0700 |
commit | dc3613ab24d3cee73a46b0be0992dbe1254dcfb0 (patch) | |
tree | 53d804b0fd0e2352a5cf629b640f69eec16c9e8d /tests | |
parent | b416af6af0bde160121cd7243dc7da95d1ee7cab (diff) | |
download | gsid-dc3613ab24d3cee73a46b0be0992dbe1254dcfb0.tar.gz |
Use fstab to find the block device for /metadata.
Bug: 136060211
Test: gsi_boot_test passes
Change-Id: I1c5f24a98651c9dbbfe80cfad9e61612f6882236
Diffstat (limited to 'tests')
-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); |