Use fstab to find the block device for /metadata.

Bug: 136060211
Test: gsi_boot_test passes
Change-Id: I1c5f24a98651c9dbbfe80cfad9e61612f6882236
Merged-In: I1c5f24a98651c9dbbfe80cfad9e61612f6882236
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, 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);