check_vintf: --check-one accepts properties.
Fixes: 148601741
Test: with vendor SKU
Change-Id: I057c05d77cdfd3b7ed8dbdc7504dcb40407ee916
Merged-In: I057c05d77cdfd3b7ed8dbdc7504dcb40407ee916
diff --git a/check_vintf.cpp b/check_vintf.cpp
index d4dc3bc..b5a4553 100644
--- a/check_vintf.cpp
+++ b/check_vintf.cpp
@@ -362,13 +362,15 @@
return vintfObject->checkCompatibility(error, flags);
}
-int checkDirmaps(const Dirmap& dirmap) {
+int checkDirmaps(const Dirmap& dirmap, const Properties& props) {
+ auto hostPropertyFetcher = std::make_unique<PresetPropertyFetcher>();
+ hostPropertyFetcher->setProperties(props);
auto exitCode = EX_OK;
for (auto&& [prefix, mappedPath] : dirmap) {
auto vintfObject =
VintfObject::Builder()
.setFileSystem(std::make_unique<HostFileSystem>(dirmap, NAME_NOT_FOUND))
- .setPropertyFetcher(std::make_unique<PropertyFetcherNoOp>())
+ .setPropertyFetcher(std::move(hostPropertyFetcher))
.setRuntimeInfoFactory(std::make_unique<StaticRuntimeInfoFactory>(nullptr))
.build();
@@ -439,9 +441,10 @@
}
auto dirmap = getDirmap(iterateValues(args, DIR_MAP));
+ auto properties = getProperties(iterateValues(args, PROPERTY));
if (!iterateValues(args, CHECK_ONE).empty()) {
- return checkDirmaps(dirmap);
+ return checkDirmaps(dirmap, properties);
}
auto checkCompat = iterateValues(args, CHECK_COMPAT);
@@ -458,8 +461,6 @@
args.emplace(DIR_MAP, "/:" + *rootdirs.begin());
}
- auto properties = getProperties(iterateValues(args, PROPERTY));
-
std::shared_ptr<StaticRuntimeInfo> runtimeInfo;
auto kernelArgs = iterateValues(args, KERNEL);
if (!kernelArgs.empty()) {