summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2023-10-23 21:41:28 +0000
committerPhilip Chen <philipchen@google.com>2023-10-23 21:43:23 +0000
commit35817eeb55b91beaf2c68345bb4fac707e43156b (patch)
tree90f6fcef95466bedf665b09307276df957fb6c7e
parent3a60e825126bbcfebecd57a728a1a87cacc5b497 (diff)
downloadcore-35817eeb55b91beaf2c68345bb4fac707e43156b.tar.gz
vts_fs_test: Do not check /metadata for automotive
This aligns with GAS req 4.0. Bug: 307215040 Test: build Change-Id: I2115e147d484d066f892ea50eeca626e64beebfc
-rw-r--r--fs_mgr/tests/vts_fs_test.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/fs_mgr/tests/vts_fs_test.cpp b/fs_mgr/tests/vts_fs_test.cpp
index 4d771fa04..bf003eef7 100644
--- a/fs_mgr/tests/vts_fs_test.cpp
+++ b/fs_mgr/tests/vts_fs_test.cpp
@@ -30,6 +30,24 @@ static int GetVsrLevel() {
return android::base::GetIntProperty("ro.vendor.api_level", -1);
}
+// Returns true iff the device has the specified feature.
+bool DeviceSupportsFeature(const char* feature) {
+ bool device_supports_feature = false;
+ FILE* p = popen("pm list features", "re");
+ if (p) {
+ char* line = NULL;
+ size_t len = 0;
+ while (getline(&line, &len, p) > 0) {
+ if (strstr(line, feature)) {
+ device_supports_feature = true;
+ break;
+ }
+ }
+ pclose(p);
+ }
+ return device_supports_feature;
+}
+
TEST(fs, ErofsSupported) {
// T-launch GKI kernels and higher must support EROFS.
if (GetVsrLevel() < __ANDROID_API_T__) {
@@ -80,7 +98,8 @@ TEST(fs, PartitionTypes) {
ASSERT_TRUE(android::base::Readlink("/dev/block/by-name/userdata", &userdata_bdev));
std::vector<std::string> must_be_f2fs = {"/data"};
- if (vsr_level >= __ANDROID_API_U__) {
+ if (vsr_level >= __ANDROID_API_U__ &&
+ !DeviceSupportsFeature("android.hardware.type.automotive")) {
must_be_f2fs.emplace_back("/metadata");
}