diff options
author | Kyeongkab.Nam <Kyeongkab.Nam@sony.com> | 2024-02-27 20:35:53 +0900 |
---|---|---|
committer | Kyeongkab.Nam <Kyeongkab.Nam@sony.com> | 2024-03-01 17:54:20 +0900 |
commit | 51077a61fa8d58ebbe5aa5248e435ccff213cfec (patch) | |
tree | 19cb00ba27af8c8facd28fbf6f40a9fefc816a58 | |
parent | 07e59eed44d73d890f970be0f2d8bb50037caf34 (diff) | |
download | gsid-51077a61fa8d58ebbe5aa5248e435ccff213cfec.tar.gz |
Add to check if device has metadata partition
Bug: 326861691
Test: run vts -m VtsGsiBootTest
Change-Id: I450d26f127b8e92fbc118a957dd5f7cce76b5787
-rw-r--r-- | tests/boot_tests.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/boot_tests.cpp b/tests/boot_tests.cpp index 6264843..c742721 100644 --- a/tests/boot_tests.cpp +++ b/tests/boot_tests.cpp @@ -41,7 +41,15 @@ static bool IsAutomotiveDevice() { return hw_type == "automotive"; } +bool ShouldRequireMetadata() { + int api_level = android::base::GetIntProperty("ro.product.first_api_level", -1); + return api_level >= __ANDROID_API_R__; +} + TEST(MetadataPartition, FirstStageMount) { + if (!ShouldRequireMetadata()) { + GTEST_SKIP(); + } Fstab fstab; if (ReadFstabFromDt(&fstab)) { auto entry = GetEntryForMountPoint(&fstab, "/metadata"); @@ -59,6 +67,9 @@ static int GetVsrLevel() { } TEST(MetadataPartition, MinimumSize) { + if (!ShouldRequireMetadata()) { + GTEST_SKIP(); + } Fstab fstab; ASSERT_TRUE(ReadDefaultFstab(&fstab)); |