summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2024-03-06 18:46:12 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-03-06 18:46:12 +0000
commit31ec98299e74859729b6c30b4ce5037167cfca07 (patch)
tree19cb00ba27af8c8facd28fbf6f40a9fefc816a58
parent64896f83215f978be01a610a568dbc9b68f84e9e (diff)
parent51077a61fa8d58ebbe5aa5248e435ccff213cfec (diff)
downloadgsid-31ec98299e74859729b6c30b4ce5037167cfca07.tar.gz
Merge "Add to check if device has metadata partition" into main
-rw-r--r--tests/boot_tests.cpp11
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));