Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2022 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #define LOG_TAG "VtsHalAutomotiveVehicle" |
| 18 | |
| 19 | #include <IVhalClient.h> |
| 20 | #include <VehicleHalTypes.h> |
| 21 | #include <VehicleUtils.h> |
Yu Shan | f3698fd | 2023-12-18 12:29:00 -0800 | [diff] [blame] | 22 | #include <VersionForVehicleProperty.h> |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 23 | #include <aidl/Gtest.h> |
| 24 | #include <aidl/Vintf.h> |
| 25 | #include <aidl/android/hardware/automotive/vehicle/IVehicle.h> |
| 26 | #include <android-base/stringprintf.h> |
| 27 | #include <android-base/thread_annotations.h> |
| 28 | #include <android/binder_process.h> |
Yu Shan | f3698fd | 2023-12-18 12:29:00 -0800 | [diff] [blame] | 29 | #include <gmock/gmock.h> |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 30 | #include <gtest/gtest.h> |
| 31 | #include <hidl/GtestPrinter.h> |
| 32 | #include <hidl/ServiceManagement.h> |
| 33 | #include <inttypes.h> |
| 34 | #include <utils/Log.h> |
Yu Shan | 4569ef5 | 2022-03-18 14:34:25 -0700 | [diff] [blame] | 35 | #include <utils/SystemClock.h> |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 36 | |
| 37 | #include <chrono> |
| 38 | #include <mutex> |
| 39 | #include <unordered_map> |
| 40 | #include <unordered_set> |
| 41 | #include <vector> |
| 42 | |
| 43 | using ::aidl::android::hardware::automotive::vehicle::IVehicle; |
| 44 | using ::aidl::android::hardware::automotive::vehicle::StatusCode; |
| 45 | using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; |
| 46 | using ::aidl::android::hardware::automotive::vehicle::VehicleArea; |
| 47 | using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; |
| 48 | using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess; |
Aaqib Ismail | 2048670 | 2022-10-27 16:58:50 -0700 | [diff] [blame] | 49 | using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode; |
| 50 | using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup; |
Yu Shan | ead15a2 | 2024-01-24 16:14:21 -0800 | [diff] [blame] | 51 | using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 52 | using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; |
Yu Shan | f3698fd | 2023-12-18 12:29:00 -0800 | [diff] [blame] | 53 | using ::aidl::android::hardware::automotive::vehicle::VersionForVehicleProperty; |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 54 | using ::android::getAidlHalInstanceNames; |
Yu Shan | ead15a2 | 2024-01-24 16:14:21 -0800 | [diff] [blame] | 55 | using ::android::uptimeMillis; |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 56 | using ::android::base::ScopedLockAssertion; |
| 57 | using ::android::base::StringPrintf; |
Chen Cheng | faf9adc | 2022-06-22 23:09:09 +0000 | [diff] [blame] | 58 | using ::android::frameworks::automotive::vhal::ErrorCode; |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 59 | using ::android::frameworks::automotive::vhal::HalPropError; |
| 60 | using ::android::frameworks::automotive::vhal::IHalPropConfig; |
| 61 | using ::android::frameworks::automotive::vhal::IHalPropValue; |
| 62 | using ::android::frameworks::automotive::vhal::ISubscriptionCallback; |
| 63 | using ::android::frameworks::automotive::vhal::IVhalClient; |
Yu Shan | ead15a2 | 2024-01-24 16:14:21 -0800 | [diff] [blame] | 64 | using ::android::frameworks::automotive::vhal::VhalClientResult; |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 65 | using ::android::hardware::getAllHalInstanceNames; |
| 66 | using ::android::hardware::Sanitize; |
Yu Shan | f3698fd | 2023-12-18 12:29:00 -0800 | [diff] [blame] | 67 | using ::android::hardware::automotive::vehicle::isSystemProp; |
| 68 | using ::android::hardware::automotive::vehicle::propIdToString; |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 69 | using ::android::hardware::automotive::vehicle::toInt; |
Yu Shan | f3698fd | 2023-12-18 12:29:00 -0800 | [diff] [blame] | 70 | using ::testing::Ge; |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 71 | |
| 72 | constexpr int32_t kInvalidProp = 0x31600207; |
Yu Shan | ead15a2 | 2024-01-24 16:14:21 -0800 | [diff] [blame] | 73 | // The timeout for retrying getting prop value after setting prop value. |
| 74 | constexpr int64_t kRetryGetPropAfterSetPropTimeoutMillis = 10'000; |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 75 | |
| 76 | struct ServiceDescriptor { |
| 77 | std::string name; |
| 78 | bool isAidlService; |
| 79 | }; |
| 80 | |
| 81 | class VtsVehicleCallback final : public ISubscriptionCallback { |
| 82 | private: |
| 83 | std::mutex mLock; |
| 84 | std::unordered_map<int32_t, size_t> mEventsCount GUARDED_BY(mLock); |
Yu Shan | 4569ef5 | 2022-03-18 14:34:25 -0700 | [diff] [blame] | 85 | std::unordered_map<int32_t, std::vector<int64_t>> mEventTimestamps GUARDED_BY(mLock); |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 86 | std::condition_variable mEventCond; |
| 87 | |
| 88 | public: |
| 89 | void onPropertyEvent(const std::vector<std::unique_ptr<IHalPropValue>>& values) override { |
| 90 | { |
| 91 | std::lock_guard<std::mutex> lockGuard(mLock); |
| 92 | for (auto& value : values) { |
Yu Shan | 4569ef5 | 2022-03-18 14:34:25 -0700 | [diff] [blame] | 93 | int32_t propId = value->getPropId(); |
| 94 | mEventsCount[propId] += 1; |
| 95 | mEventTimestamps[propId].push_back(value->getTimestamp()); |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 96 | } |
| 97 | } |
| 98 | mEventCond.notify_one(); |
| 99 | } |
| 100 | |
| 101 | void onPropertySetError([[maybe_unused]] const std::vector<HalPropError>& errors) override { |
| 102 | // Do nothing. |
| 103 | } |
| 104 | |
| 105 | template <class Rep, class Period> |
| 106 | bool waitForExpectedEvents(int32_t propId, size_t expectedEvents, |
| 107 | const std::chrono::duration<Rep, Period>& timeout) { |
| 108 | std::unique_lock<std::mutex> uniqueLock(mLock); |
| 109 | return mEventCond.wait_for(uniqueLock, timeout, [this, propId, expectedEvents] { |
| 110 | ScopedLockAssertion lockAssertion(mLock); |
| 111 | return mEventsCount[propId] >= expectedEvents; |
| 112 | }); |
| 113 | } |
| 114 | |
Yu Shan | 4569ef5 | 2022-03-18 14:34:25 -0700 | [diff] [blame] | 115 | std::vector<int64_t> getEventTimestamps(int32_t propId) { |
| 116 | { |
| 117 | std::lock_guard<std::mutex> lockGuard(mLock); |
| 118 | return mEventTimestamps[propId]; |
| 119 | } |
| 120 | } |
| 121 | |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 122 | void reset() { |
| 123 | std::lock_guard<std::mutex> lockGuard(mLock); |
| 124 | mEventsCount.clear(); |
| 125 | } |
| 126 | }; |
| 127 | |
| 128 | class VtsHalAutomotiveVehicleTargetTest : public testing::TestWithParam<ServiceDescriptor> { |
Yu Shan | ec5d5b0 | 2023-10-09 14:43:36 -0700 | [diff] [blame] | 129 | protected: |
Yu Shan | 0ebd876 | 2023-10-11 11:31:04 -0700 | [diff] [blame] | 130 | bool checkIsSupported(int32_t propertyId); |
Yu Shan | ec5d5b0 | 2023-10-09 14:43:36 -0700 | [diff] [blame] | 131 | |
Yu Shan | ead15a2 | 2024-01-24 16:14:21 -0800 | [diff] [blame] | 132 | static bool isUnavailable(const VhalClientResult<std::unique_ptr<IHalPropValue>>& result); |
| 133 | static bool isResultOkayWithValue( |
| 134 | const VhalClientResult<std::unique_ptr<IHalPropValue>>& result, int32_t value); |
| 135 | |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 136 | public: |
Aaqib Ismail | 2048670 | 2022-10-27 16:58:50 -0700 | [diff] [blame] | 137 | void verifyProperty(VehicleProperty propId, VehiclePropertyAccess access, |
| 138 | VehiclePropertyChangeMode changeMode, VehiclePropertyGroup group, |
| 139 | VehicleArea area, VehiclePropertyType propertyType); |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 140 | virtual void SetUp() override { |
| 141 | auto descriptor = GetParam(); |
| 142 | if (descriptor.isAidlService) { |
| 143 | mVhalClient = IVhalClient::tryCreateAidlClient(descriptor.name.c_str()); |
| 144 | } else { |
| 145 | mVhalClient = IVhalClient::tryCreateHidlClient(descriptor.name.c_str()); |
| 146 | } |
| 147 | |
| 148 | ASSERT_NE(mVhalClient, nullptr) << "Failed to connect to VHAL"; |
| 149 | |
| 150 | mCallback = std::make_shared<VtsVehicleCallback>(); |
| 151 | } |
| 152 | |
| 153 | static bool isBooleanGlobalProp(int32_t property) { |
| 154 | return (property & toInt(VehiclePropertyType::MASK)) == |
| 155 | toInt(VehiclePropertyType::BOOLEAN) && |
| 156 | (property & toInt(VehicleArea::MASK)) == toInt(VehicleArea::GLOBAL); |
| 157 | } |
| 158 | |
| 159 | protected: |
| 160 | std::shared_ptr<IVhalClient> mVhalClient; |
| 161 | std::shared_ptr<VtsVehicleCallback> mCallback; |
| 162 | }; |
| 163 | |
| 164 | TEST_P(VtsHalAutomotiveVehicleTargetTest, useAidlBackend) { |
| 165 | if (!mVhalClient->isAidlVhal()) { |
| 166 | GTEST_SKIP() << "AIDL backend is not available, HIDL backend is used instead"; |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | TEST_P(VtsHalAutomotiveVehicleTargetTest, useHidlBackend) { |
| 171 | if (mVhalClient->isAidlVhal()) { |
| 172 | GTEST_SKIP() << "AIDL backend is available, HIDL backend is not used"; |
| 173 | } |
| 174 | } |
| 175 | |
Yu Shan | ec5d5b0 | 2023-10-09 14:43:36 -0700 | [diff] [blame] | 176 | // Test getAllPropConfigs() returns at least 1 property configs. |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 177 | TEST_P(VtsHalAutomotiveVehicleTargetTest, getAllPropConfigs) { |
| 178 | ALOGD("VtsHalAutomotiveVehicleTargetTest::getAllPropConfigs"); |
| 179 | |
| 180 | auto result = mVhalClient->getAllPropConfigs(); |
| 181 | |
| 182 | ASSERT_TRUE(result.ok()) << "Failed to get all property configs, error: " |
| 183 | << result.error().message(); |
Yu Shan | ec5d5b0 | 2023-10-09 14:43:36 -0700 | [diff] [blame] | 184 | ASSERT_GE(result.value().size(), 1u) << StringPrintf( |
| 185 | "Expect to get at least 1 property config, got %zu", result.value().size()); |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 186 | } |
| 187 | |
Yu Shan | ec5d5b0 | 2023-10-09 14:43:36 -0700 | [diff] [blame] | 188 | // Test getPropConfigs() can query properties returned by getAllPropConfigs. |
| 189 | TEST_P(VtsHalAutomotiveVehicleTargetTest, getPropConfigsWithValidProps) { |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 190 | ALOGD("VtsHalAutomotiveVehicleTargetTest::getRequiredPropConfigs"); |
| 191 | |
Yu Shan | ec5d5b0 | 2023-10-09 14:43:36 -0700 | [diff] [blame] | 192 | std::vector<int32_t> properties; |
| 193 | auto result = mVhalClient->getAllPropConfigs(); |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 194 | |
Yu Shan | ec5d5b0 | 2023-10-09 14:43:36 -0700 | [diff] [blame] | 195 | ASSERT_TRUE(result.ok()) << "Failed to get all property configs, error: " |
| 196 | << result.error().message(); |
| 197 | for (const auto& cfgPtr : result.value()) { |
| 198 | properties.push_back(cfgPtr->getPropId()); |
| 199 | } |
| 200 | |
| 201 | result = mVhalClient->getPropConfigs(properties); |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 202 | |
| 203 | ASSERT_TRUE(result.ok()) << "Failed to get required property config, error: " |
| 204 | << result.error().message(); |
Yu Shan | ec5d5b0 | 2023-10-09 14:43:36 -0700 | [diff] [blame] | 205 | ASSERT_EQ(result.value().size(), properties.size()) << StringPrintf( |
| 206 | "Expect to get exactly %zu configs, got %zu", properties.size(), result.value().size()); |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 207 | } |
| 208 | |
| 209 | // Test getPropConfig() with an invalid propertyId returns an error code. |
| 210 | TEST_P(VtsHalAutomotiveVehicleTargetTest, getPropConfigsWithInvalidProp) { |
| 211 | ALOGD("VtsHalAutomotiveVehicleTargetTest::getPropConfigsWithInvalidProp"); |
| 212 | |
| 213 | auto result = mVhalClient->getPropConfigs({kInvalidProp}); |
| 214 | |
| 215 | ASSERT_FALSE(result.ok()) << StringPrintf( |
| 216 | "Expect failure to get prop configs for invalid prop: %" PRId32, kInvalidProp); |
| 217 | ASSERT_NE(result.error().message(), "") << "Expect error message not to be empty"; |
| 218 | } |
| 219 | |
Yu Shan | f3698fd | 2023-12-18 12:29:00 -0800 | [diff] [blame] | 220 | // Test system property IDs returned by getPropConfigs() are defined in the VHAL property interface. |
| 221 | TEST_P(VtsHalAutomotiveVehicleTargetTest, testPropConfigs_onlyDefinedSystemPropertyIdsReturned) { |
| 222 | if (!mVhalClient->isAidlVhal()) { |
| 223 | GTEST_SKIP() << "Skip for HIDL VHAL because HAL interface run-time version is only" |
| 224 | << "introduced for AIDL"; |
| 225 | } |
| 226 | |
| 227 | auto result = mVhalClient->getAllPropConfigs(); |
| 228 | ASSERT_TRUE(result.ok()) << "Failed to get all property configs, error: " |
| 229 | << result.error().message(); |
| 230 | |
| 231 | int32_t vhalVersion = mVhalClient->getRemoteInterfaceVersion(); |
| 232 | const auto& configs = result.value(); |
| 233 | for (size_t i = 0; i < configs.size(); i++) { |
| 234 | int32_t propId = configs[i]->getPropId(); |
| 235 | if (!isSystemProp(propId)) { |
| 236 | continue; |
| 237 | } |
| 238 | |
| 239 | std::string propName = propIdToString(propId); |
| 240 | auto it = VersionForVehicleProperty.find(static_cast<VehicleProperty>(propId)); |
| 241 | bool found = (it != VersionForVehicleProperty.end()); |
| 242 | EXPECT_TRUE(found) << "System Property: " << propName |
| 243 | << " is not defined in VHAL property interface"; |
| 244 | if (!found) { |
| 245 | continue; |
| 246 | } |
| 247 | int32_t requiredVersion = it->second; |
| 248 | EXPECT_THAT(vhalVersion, Ge(requiredVersion)) |
| 249 | << "System Property: " << propName << " requires VHAL version: " << requiredVersion |
| 250 | << ", but the current VHAL version" |
| 251 | << " is " << vhalVersion << ", must not be supported"; |
| 252 | } |
| 253 | } |
| 254 | |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 255 | // Test get() return current value for properties. |
| 256 | TEST_P(VtsHalAutomotiveVehicleTargetTest, get) { |
| 257 | ALOGD("VtsHalAutomotiveVehicleTargetTest::get"); |
| 258 | |
| 259 | int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); |
Yu Shan | 0ebd876 | 2023-10-11 11:31:04 -0700 | [diff] [blame] | 260 | if (!checkIsSupported(propId)) { |
| 261 | GTEST_SKIP() << "Property: " << propId << " is not supported, skip the test"; |
| 262 | } |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 263 | auto result = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(propId)); |
| 264 | |
| 265 | ASSERT_TRUE(result.ok()) << StringPrintf("Failed to get value for property: %" PRId32 |
| 266 | ", error: %s", |
| 267 | propId, result.error().message().c_str()); |
| 268 | ASSERT_NE(result.value(), nullptr) << "Result value must not be null"; |
| 269 | } |
| 270 | |
| 271 | // Test get() with an invalid propertyId return an error codes. |
| 272 | TEST_P(VtsHalAutomotiveVehicleTargetTest, getInvalidProp) { |
| 273 | ALOGD("VtsHalAutomotiveVehicleTargetTest::getInvalidProp"); |
| 274 | |
| 275 | auto result = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(kInvalidProp)); |
| 276 | |
| 277 | ASSERT_FALSE(result.ok()) << StringPrintf( |
| 278 | "Expect failure to get property for invalid prop: %" PRId32, kInvalidProp); |
| 279 | } |
| 280 | |
Yu Shan | ead15a2 | 2024-01-24 16:14:21 -0800 | [diff] [blame] | 281 | bool VtsHalAutomotiveVehicleTargetTest::isResultOkayWithValue( |
| 282 | const VhalClientResult<std::unique_ptr<IHalPropValue>>& result, int32_t value) { |
| 283 | return result.ok() && result.value() != nullptr && |
| 284 | result.value()->getStatus() == VehiclePropertyStatus::AVAILABLE && |
| 285 | result.value()->getInt32Values().size() == 1 && |
| 286 | result.value()->getInt32Values()[0] == value; |
| 287 | } |
| 288 | |
| 289 | bool VtsHalAutomotiveVehicleTargetTest::isUnavailable( |
| 290 | const VhalClientResult<std::unique_ptr<IHalPropValue>>& result) { |
| 291 | if (result.ok()) { |
| 292 | return false; |
| 293 | } |
| 294 | if (result.error().code() == ErrorCode::NOT_AVAILABLE_FROM_VHAL) { |
| 295 | return true; |
| 296 | } |
| 297 | if (result.value() != nullptr && |
| 298 | result.value()->getStatus() == VehiclePropertyStatus::UNAVAILABLE) { |
| 299 | return true; |
| 300 | } |
| 301 | |
| 302 | return false; |
| 303 | } |
| 304 | |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 305 | // Test set() on read_write properties. |
| 306 | TEST_P(VtsHalAutomotiveVehicleTargetTest, setProp) { |
| 307 | ALOGD("VtsHalAutomotiveVehicleTargetTest::setProp"); |
| 308 | |
| 309 | // skip hvac related properties |
| 310 | std::unordered_set<int32_t> hvacProps = {toInt(VehicleProperty::HVAC_DEFROSTER), |
| 311 | toInt(VehicleProperty::HVAC_AC_ON), |
| 312 | toInt(VehicleProperty::HVAC_MAX_AC_ON), |
| 313 | toInt(VehicleProperty::HVAC_MAX_DEFROST_ON), |
| 314 | toInt(VehicleProperty::HVAC_RECIRC_ON), |
| 315 | toInt(VehicleProperty::HVAC_DUAL_ON), |
| 316 | toInt(VehicleProperty::HVAC_AUTO_ON), |
| 317 | toInt(VehicleProperty::HVAC_POWER_ON), |
| 318 | toInt(VehicleProperty::HVAC_AUTO_RECIRC_ON), |
| 319 | toInt(VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON)}; |
| 320 | auto result = mVhalClient->getAllPropConfigs(); |
| 321 | ASSERT_TRUE(result.ok()); |
| 322 | |
| 323 | for (const auto& cfgPtr : result.value()) { |
| 324 | const IHalPropConfig& cfg = *cfgPtr; |
| 325 | int32_t propId = cfg.getPropId(); |
| 326 | // test on boolean and writable property |
| 327 | if (cfg.getAccess() == toInt(VehiclePropertyAccess::READ_WRITE) && |
| 328 | isBooleanGlobalProp(propId) && !hvacProps.count(propId)) { |
| 329 | auto propToGet = mVhalClient->createHalPropValue(propId); |
| 330 | auto getValueResult = mVhalClient->getValueSync(*propToGet); |
| 331 | |
Yu Shan | ead15a2 | 2024-01-24 16:14:21 -0800 | [diff] [blame] | 332 | if (isUnavailable(getValueResult)) { |
| 333 | ALOGW("getProperty for %" PRId32 |
| 334 | " returns NOT_AVAILABLE, " |
| 335 | "skip testing setProp", |
| 336 | propId); |
| 337 | return; |
| 338 | } |
| 339 | |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 340 | ASSERT_TRUE(getValueResult.ok()) |
| 341 | << StringPrintf("Failed to get value for property: %" PRId32 ", error: %s", |
| 342 | propId, getValueResult.error().message().c_str()); |
| 343 | ASSERT_NE(getValueResult.value(), nullptr) |
| 344 | << StringPrintf("Result value must not be null for property: %" PRId32, propId); |
| 345 | |
| 346 | const IHalPropValue& value = *getValueResult.value(); |
| 347 | size_t intValueSize = value.getInt32Values().size(); |
| 348 | ASSERT_EQ(intValueSize, 1u) << StringPrintf( |
| 349 | "Expect exactly 1 int value for boolean property: %" PRId32 ", got %zu", propId, |
| 350 | intValueSize); |
| 351 | |
Yu Shan | ead15a2 | 2024-01-24 16:14:21 -0800 | [diff] [blame] | 352 | int32_t setValue = value.getInt32Values()[0] == 1 ? 0 : 1; |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 353 | auto propToSet = mVhalClient->createHalPropValue(propId); |
| 354 | propToSet->setInt32Values({setValue}); |
| 355 | auto setValueResult = mVhalClient->setValueSync(*propToSet); |
| 356 | |
Yu Shan | ead15a2 | 2024-01-24 16:14:21 -0800 | [diff] [blame] | 357 | if (!setValueResult.ok() && |
| 358 | setValueResult.error().code() == ErrorCode::NOT_AVAILABLE_FROM_VHAL) { |
| 359 | ALOGW("setProperty for %" PRId32 |
| 360 | " returns NOT_AVAILABLE, " |
| 361 | "skip verifying getProperty returns the same value", |
| 362 | propId); |
| 363 | return; |
| 364 | } |
| 365 | |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 366 | ASSERT_TRUE(setValueResult.ok()) |
| 367 | << StringPrintf("Failed to set value for property: %" PRId32 ", error: %s", |
| 368 | propId, setValueResult.error().message().c_str()); |
Yu Shan | ead15a2 | 2024-01-24 16:14:21 -0800 | [diff] [blame] | 369 | // Retry getting the value until we pass the timeout. getValue might not return |
| 370 | // the expected value immediately since setValue is async. |
| 371 | auto timeoutMillis = uptimeMillis() + kRetryGetPropAfterSetPropTimeoutMillis; |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 372 | |
Yu Shan | ead15a2 | 2024-01-24 16:14:21 -0800 | [diff] [blame] | 373 | while (true) { |
| 374 | getValueResult = mVhalClient->getValueSync(*propToGet); |
| 375 | if (isResultOkayWithValue(getValueResult, setValue)) { |
| 376 | break; |
| 377 | } |
| 378 | if (uptimeMillis() >= timeoutMillis) { |
| 379 | // Reach timeout, the following assert should fail. |
| 380 | break; |
| 381 | } |
| 382 | // Sleep for 100ms between each getValueSync retry. |
| 383 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); |
| 384 | } |
| 385 | |
| 386 | if (isUnavailable(getValueResult)) { |
| 387 | ALOGW("getProperty for %" PRId32 |
| 388 | " returns NOT_AVAILABLE, " |
| 389 | "skip verifying the return value", |
| 390 | propId); |
| 391 | return; |
| 392 | } |
| 393 | |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 394 | ASSERT_TRUE(getValueResult.ok()) |
| 395 | << StringPrintf("Failed to get value for property: %" PRId32 ", error: %s", |
| 396 | propId, getValueResult.error().message().c_str()); |
| 397 | ASSERT_NE(getValueResult.value(), nullptr) |
| 398 | << StringPrintf("Result value must not be null for property: %" PRId32, propId); |
| 399 | ASSERT_EQ(getValueResult.value()->getInt32Values(), std::vector<int32_t>({setValue})) |
| 400 | << StringPrintf("Boolean value not updated after set for property: %" PRId32, |
| 401 | propId); |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | // Test set() on an read_only property. |
| 407 | TEST_P(VtsHalAutomotiveVehicleTargetTest, setNotWritableProp) { |
| 408 | ALOGD("VtsHalAutomotiveVehicleTargetTest::setNotWritableProp"); |
| 409 | |
| 410 | int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); |
Yu Shan | 0ebd876 | 2023-10-11 11:31:04 -0700 | [diff] [blame] | 411 | if (!checkIsSupported(propId)) { |
| 412 | GTEST_SKIP() << "Property: " << propId << " is not supported, skip the test"; |
| 413 | } |
Yu Shan | ec5d5b0 | 2023-10-09 14:43:36 -0700 | [diff] [blame] | 414 | |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 415 | auto getValueResult = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(propId)); |
| 416 | ASSERT_TRUE(getValueResult.ok()) |
| 417 | << StringPrintf("Failed to get value for property: %" PRId32 ", error: %s", propId, |
| 418 | getValueResult.error().message().c_str()); |
| 419 | |
| 420 | auto setValueResult = mVhalClient->setValueSync(*getValueResult.value()); |
| 421 | |
| 422 | ASSERT_FALSE(setValueResult.ok()) << "Expect set a read-only value to fail"; |
Chen Cheng | faf9adc | 2022-06-22 23:09:09 +0000 | [diff] [blame] | 423 | ASSERT_EQ(setValueResult.error().code(), ErrorCode::ACCESS_DENIED_FROM_VHAL); |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 424 | } |
| 425 | |
shrikar | 8a14023 | 2023-03-07 16:57:59 +0000 | [diff] [blame] | 426 | // Test get(), set() and getAllPropConfigs() on VehicleProperty::INVALID. |
| 427 | TEST_P(VtsHalAutomotiveVehicleTargetTest, getSetPropertyIdInvalid) { |
| 428 | ALOGD("VtsHalAutomotiveVehicleTargetTest::getSetPropertyIdInvalid"); |
| 429 | |
| 430 | int32_t propId = toInt(VehicleProperty::INVALID); |
| 431 | auto getValueResult = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(propId)); |
| 432 | ASSERT_FALSE(getValueResult.ok()) << "Expect get on VehicleProperty::INVALID to fail"; |
| 433 | ASSERT_EQ(getValueResult.error().code(), ErrorCode::INVALID_ARG); |
| 434 | |
| 435 | auto propToSet = mVhalClient->createHalPropValue(propId); |
| 436 | propToSet->setInt32Values({0}); |
| 437 | auto setValueResult = mVhalClient->setValueSync(*propToSet); |
| 438 | ASSERT_FALSE(setValueResult.ok()) << "Expect set on VehicleProperty::INVALID to fail"; |
| 439 | ASSERT_EQ(setValueResult.error().code(), ErrorCode::INVALID_ARG); |
| 440 | |
| 441 | auto result = mVhalClient->getAllPropConfigs(); |
| 442 | ASSERT_TRUE(result.ok()); |
| 443 | for (const auto& cfgPtr : result.value()) { |
| 444 | const IHalPropConfig& cfg = *cfgPtr; |
| 445 | ASSERT_FALSE(cfg.getPropId() == propId) << "Expect VehicleProperty::INVALID to not be " |
| 446 | "included in propConfigs"; |
| 447 | } |
| 448 | } |
| 449 | |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 450 | // Test subscribe() and unsubscribe(). |
| 451 | TEST_P(VtsHalAutomotiveVehicleTargetTest, subscribeAndUnsubscribe) { |
| 452 | ALOGD("VtsHalAutomotiveVehicleTargetTest::subscribeAndUnsubscribe"); |
| 453 | |
| 454 | int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); |
Yu Shan | 0ebd876 | 2023-10-11 11:31:04 -0700 | [diff] [blame] | 455 | if (!checkIsSupported(propId)) { |
| 456 | GTEST_SKIP() << "Property: " << propId << " is not supported, skip the test"; |
| 457 | } |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 458 | |
Yu Shan | 4569ef5 | 2022-03-18 14:34:25 -0700 | [diff] [blame] | 459 | auto propConfigsResult = mVhalClient->getPropConfigs({propId}); |
| 460 | |
| 461 | ASSERT_TRUE(propConfigsResult.ok()) << "Failed to get property config for PERF_VEHICLE_SPEED: " |
| 462 | << "error: " << propConfigsResult.error().message(); |
| 463 | ASSERT_EQ(propConfigsResult.value().size(), 1u) |
| 464 | << "Expect to return 1 config for PERF_VEHICLE_SPEED"; |
| 465 | auto& propConfig = propConfigsResult.value()[0]; |
| 466 | float minSampleRate = propConfig->getMinSampleRate(); |
| 467 | float maxSampleRate = propConfig->getMaxSampleRate(); |
| 468 | |
| 469 | if (minSampleRate < 1) { |
| 470 | GTEST_SKIP() << "Sample rate for vehicle speed < 1 times/sec, skip test since it would " |
| 471 | "take too long"; |
| 472 | } |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 473 | |
| 474 | auto client = mVhalClient->getSubscriptionClient(mCallback); |
| 475 | ASSERT_NE(client, nullptr) << "Failed to get subscription client"; |
| 476 | |
Yu Shan | 4569ef5 | 2022-03-18 14:34:25 -0700 | [diff] [blame] | 477 | auto result = client->subscribe({{.propId = propId, .sampleRate = minSampleRate}}); |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 478 | |
| 479 | ASSERT_TRUE(result.ok()) << StringPrintf("Failed to subscribe to property: %" PRId32 |
| 480 | ", error: %s", |
| 481 | propId, result.error().message().c_str()); |
Yu Shan | 4569ef5 | 2022-03-18 14:34:25 -0700 | [diff] [blame] | 482 | |
| 483 | if (mVhalClient->isAidlVhal()) { |
| 484 | // Skip checking timestamp for HIDL because the behavior for sample rate and timestamp is |
| 485 | // only specified clearly for AIDL. |
| 486 | |
| 487 | // Timeout is 2 seconds, which gives a 1 second buffer. |
| 488 | ASSERT_TRUE(mCallback->waitForExpectedEvents(propId, std::floor(minSampleRate), |
| 489 | std::chrono::seconds(2))) |
| 490 | << "Didn't get enough events for subscribing to minSampleRate"; |
| 491 | } |
| 492 | |
| 493 | result = client->subscribe({{.propId = propId, .sampleRate = maxSampleRate}}); |
| 494 | |
| 495 | ASSERT_TRUE(result.ok()) << StringPrintf("Failed to subscribe to property: %" PRId32 |
| 496 | ", error: %s", |
| 497 | propId, result.error().message().c_str()); |
| 498 | |
| 499 | if (mVhalClient->isAidlVhal()) { |
| 500 | ASSERT_TRUE(mCallback->waitForExpectedEvents(propId, std::floor(maxSampleRate), |
| 501 | std::chrono::seconds(2))) |
| 502 | << "Didn't get enough events for subscribing to maxSampleRate"; |
| 503 | |
| 504 | std::unordered_set<int64_t> timestamps; |
| 505 | // Event event should have a different timestamp. |
| 506 | for (const int64_t& eventTimestamp : mCallback->getEventTimestamps(propId)) { |
| 507 | ASSERT_TRUE(timestamps.find(eventTimestamp) == timestamps.end()) |
| 508 | << "two events for the same property must not have the same timestamp"; |
| 509 | timestamps.insert(eventTimestamp); |
| 510 | } |
| 511 | } |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 512 | |
| 513 | result = client->unsubscribe({propId}); |
| 514 | ASSERT_TRUE(result.ok()) << StringPrintf("Failed to unsubscribe to property: %" PRId32 |
| 515 | ", error: %s", |
| 516 | propId, result.error().message().c_str()); |
| 517 | |
| 518 | mCallback->reset(); |
| 519 | ASSERT_FALSE(mCallback->waitForExpectedEvents(propId, 10, std::chrono::seconds(1))) |
| 520 | << "Expect not to get events after unsubscription"; |
| 521 | } |
| 522 | |
| 523 | // Test subscribe() with an invalid property. |
| 524 | TEST_P(VtsHalAutomotiveVehicleTargetTest, subscribeInvalidProp) { |
| 525 | ALOGD("VtsHalAutomotiveVehicleTargetTest::subscribeInvalidProp"); |
| 526 | |
| 527 | std::vector<SubscribeOptions> options = { |
| 528 | SubscribeOptions{.propId = kInvalidProp, .sampleRate = 10.0}}; |
| 529 | |
| 530 | auto client = mVhalClient->getSubscriptionClient(mCallback); |
| 531 | ASSERT_NE(client, nullptr) << "Failed to get subscription client"; |
| 532 | |
| 533 | auto result = client->subscribe(options); |
| 534 | |
| 535 | ASSERT_FALSE(result.ok()) << StringPrintf("Expect subscribing to property: %" PRId32 " to fail", |
| 536 | kInvalidProp); |
| 537 | } |
| 538 | |
Yu Shan | 4569ef5 | 2022-03-18 14:34:25 -0700 | [diff] [blame] | 539 | // Test the timestamp returned in GetValues results is the timestamp when the value is retrieved. |
| 540 | TEST_P(VtsHalAutomotiveVehicleTargetTest, testGetValuesTimestampAIDL) { |
| 541 | if (!mVhalClient->isAidlVhal()) { |
| 542 | GTEST_SKIP() << "Skip checking timestamp for HIDL because the behavior is only specified " |
| 543 | "for AIDL"; |
| 544 | } |
| 545 | |
| 546 | int32_t propId = toInt(VehicleProperty::PARKING_BRAKE_ON); |
Yu Shan | 0ebd876 | 2023-10-11 11:31:04 -0700 | [diff] [blame] | 547 | if (!checkIsSupported(propId)) { |
| 548 | GTEST_SKIP() << "Property: " << propId << " is not supported, skip the test"; |
| 549 | } |
Yu Shan | 4569ef5 | 2022-03-18 14:34:25 -0700 | [diff] [blame] | 550 | auto prop = mVhalClient->createHalPropValue(propId); |
| 551 | |
| 552 | auto result = mVhalClient->getValueSync(*prop); |
| 553 | |
| 554 | ASSERT_TRUE(result.ok()) << StringPrintf("Failed to get value for property: %" PRId32 |
| 555 | ", error: %s", |
| 556 | propId, result.error().message().c_str()); |
| 557 | ASSERT_NE(result.value(), nullptr) << "Result value must not be null"; |
| 558 | ASSERT_EQ(result.value()->getInt32Values().size(), 1u) << "Result must contain 1 int value"; |
| 559 | |
| 560 | bool parkBrakeOnValue1 = (result.value()->getInt32Values()[0] == 1); |
| 561 | int64_t timestampValue1 = result.value()->getTimestamp(); |
| 562 | |
| 563 | result = mVhalClient->getValueSync(*prop); |
| 564 | |
| 565 | ASSERT_TRUE(result.ok()) << StringPrintf("Failed to get value for property: %" PRId32 |
| 566 | ", error: %s", |
| 567 | propId, result.error().message().c_str()); |
| 568 | ASSERT_NE(result.value(), nullptr) << "Result value must not be null"; |
| 569 | ASSERT_EQ(result.value()->getInt32Values().size(), 1u) << "Result must contain 1 int value"; |
| 570 | |
| 571 | bool parkBarkeOnValue2 = (result.value()->getInt32Values()[0] == 1); |
| 572 | int64_t timestampValue2 = result.value()->getTimestamp(); |
| 573 | |
| 574 | if (parkBarkeOnValue2 == parkBrakeOnValue1) { |
| 575 | ASSERT_EQ(timestampValue2, timestampValue1) |
| 576 | << "getValue result must contain a timestamp updated when the value was updated, if" |
| 577 | "the value does not change, expect the same timestamp"; |
| 578 | } else { |
| 579 | ASSERT_GT(timestampValue2, timestampValue1) |
| 580 | << "getValue result must contain a timestamp updated when the value was updated, if" |
| 581 | "the value changes, expect the newer value has a larger timestamp"; |
| 582 | } |
| 583 | } |
| 584 | |
Aaqib Ismail | 2048670 | 2022-10-27 16:58:50 -0700 | [diff] [blame] | 585 | // Helper function to compare actual vs expected property config |
| 586 | void VtsHalAutomotiveVehicleTargetTest::verifyProperty(VehicleProperty propId, |
| 587 | VehiclePropertyAccess access, |
| 588 | VehiclePropertyChangeMode changeMode, |
| 589 | VehiclePropertyGroup group, VehicleArea area, |
| 590 | VehiclePropertyType propertyType) { |
| 591 | int expectedPropId = toInt(propId); |
| 592 | int expectedAccess = toInt(access); |
| 593 | int expectedChangeMode = toInt(changeMode); |
| 594 | int expectedGroup = toInt(group); |
| 595 | int expectedArea = toInt(area); |
| 596 | int expectedPropertyType = toInt(propertyType); |
| 597 | |
Eva Chen | 17bc578 | 2023-01-06 22:59:58 -0800 | [diff] [blame] | 598 | auto result = mVhalClient->getAllPropConfigs(); |
| 599 | ASSERT_TRUE(result.ok()) << "Failed to get all property configs, error: " |
| 600 | << result.error().message(); |
| 601 | |
| 602 | // Check if property is implemented by getting all configs and looking to see if the expected |
| 603 | // property id is in that list. |
| 604 | bool isExpectedPropIdImplemented = false; |
| 605 | for (const auto& cfgPtr : result.value()) { |
| 606 | const IHalPropConfig& cfg = *cfgPtr; |
| 607 | if (expectedPropId == cfg.getPropId()) { |
| 608 | isExpectedPropIdImplemented = true; |
| 609 | break; |
| 610 | } |
| 611 | } |
| 612 | |
| 613 | if (!isExpectedPropIdImplemented) { |
| 614 | GTEST_SKIP() << StringPrintf("Property %" PRId32 " has not been implemented", |
| 615 | expectedPropId); |
| 616 | } |
| 617 | |
| 618 | result = mVhalClient->getPropConfigs({expectedPropId}); |
Aaqib Ismail | 2048670 | 2022-10-27 16:58:50 -0700 | [diff] [blame] | 619 | ASSERT_TRUE(result.ok()) << "Failed to get required property config, error: " |
| 620 | << result.error().message(); |
| 621 | |
Aaqib Ismail | 2048670 | 2022-10-27 16:58:50 -0700 | [diff] [blame] | 622 | ASSERT_EQ(result.value().size(), 1u) |
| 623 | << StringPrintf("Expect to get exactly 1 config, got %zu", result.value().size()); |
| 624 | |
| 625 | const auto& config = result.value().at(0); |
| 626 | int actualPropId = config->getPropId(); |
| 627 | int actualAccess = config->getAccess(); |
| 628 | int actualChangeMode = config->getChangeMode(); |
| 629 | int actualGroup = actualPropId & toInt(VehiclePropertyGroup::MASK); |
| 630 | int actualArea = actualPropId & toInt(VehicleArea::MASK); |
| 631 | int actualPropertyType = actualPropId & toInt(VehiclePropertyType::MASK); |
| 632 | |
| 633 | ASSERT_EQ(actualPropId, expectedPropId) |
| 634 | << StringPrintf("Expect to get property ID: %i, got %i", expectedPropId, actualPropId); |
| 635 | |
| 636 | if (expectedAccess == toInt(VehiclePropertyAccess::READ_WRITE)) { |
| 637 | ASSERT_TRUE(actualAccess == expectedAccess || |
| 638 | actualAccess == toInt(VehiclePropertyAccess::READ)) |
| 639 | << StringPrintf("Expect to get VehiclePropertyAccess: %i or %i, got %i", |
| 640 | expectedAccess, toInt(VehiclePropertyAccess::READ), actualAccess); |
| 641 | } else { |
| 642 | ASSERT_EQ(actualAccess, expectedAccess) << StringPrintf( |
| 643 | "Expect to get VehiclePropertyAccess: %i, got %i", expectedAccess, actualAccess); |
| 644 | } |
| 645 | |
| 646 | ASSERT_EQ(actualChangeMode, expectedChangeMode) |
| 647 | << StringPrintf("Expect to get VehiclePropertyChangeMode: %i, got %i", |
| 648 | expectedChangeMode, actualChangeMode); |
| 649 | ASSERT_EQ(actualGroup, expectedGroup) << StringPrintf( |
| 650 | "Expect to get VehiclePropertyGroup: %i, got %i", expectedGroup, actualGroup); |
| 651 | ASSERT_EQ(actualArea, expectedArea) |
| 652 | << StringPrintf("Expect to get VehicleArea: %i, got %i", expectedArea, actualArea); |
| 653 | ASSERT_EQ(actualPropertyType, expectedPropertyType) |
| 654 | << StringPrintf("Expect to get VehiclePropertyType: %i, got %i", expectedPropertyType, |
| 655 | actualPropertyType); |
| 656 | } |
| 657 | |
shrikar | 3456364 | 2023-02-14 02:57:17 +0000 | [diff] [blame] | 658 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLocationCharacterizationConfig) { |
| 659 | verifyProperty(VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ, |
| 660 | VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM, |
| 661 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 662 | } |
| 663 | |
Eva Chen | 544b24b | 2023-12-05 00:13:53 -0800 | [diff] [blame] | 664 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorPositionConfig) { |
| 665 | verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess::READ, |
| 666 | VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM, |
| 667 | VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC); |
| 668 | } |
| 669 | |
Eva Chen | 9e226e5 | 2023-12-06 00:23:18 -0800 | [diff] [blame] | 670 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorOrientationConfig) { |
| 671 | verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess::READ, |
| 672 | VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM, |
Eva Chen | 8818f19 | 2024-01-25 18:21:43 -0800 | [diff] [blame] | 673 | VehicleArea::VENDOR, VehiclePropertyType::FLOAT_VEC); |
Eva Chen | 9e226e5 | 2023-12-06 00:23:18 -0800 | [diff] [blame] | 674 | } |
| 675 | |
Eva Chen | 727aa3f | 2023-12-06 01:13:29 -0800 | [diff] [blame] | 676 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorFieldOfViewConfig) { |
| 677 | verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess::READ, |
| 678 | VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM, |
| 679 | VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC); |
| 680 | } |
| 681 | |
Eva Chen | 968bf44 | 2023-12-06 01:21:51 -0800 | [diff] [blame] | 682 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorDetectionRangeConfig) { |
| 683 | verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess::READ, |
| 684 | VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM, |
| 685 | VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC); |
| 686 | } |
| 687 | |
Eva Chen | df05df5 | 2023-12-06 01:42:55 -0800 | [diff] [blame] | 688 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorSupportedRangesConfig) { |
| 689 | verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES, |
| 690 | VehiclePropertyAccess::READ, VehiclePropertyChangeMode::STATIC, |
| 691 | VehiclePropertyGroup::SYSTEM, VehicleArea::VENDOR, |
| 692 | VehiclePropertyType::INT32_VEC); |
| 693 | } |
| 694 | |
Eva Chen | 7566173 | 2023-12-06 01:51:40 -0800 | [diff] [blame] | 695 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorMeasuredDistanceConfig) { |
| 696 | verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_MEASURED_DISTANCE, |
| 697 | VehiclePropertyAccess::READ, VehiclePropertyChangeMode::CONTINUOUS, |
| 698 | VehiclePropertyGroup::SYSTEM, VehicleArea::VENDOR, |
| 699 | VehiclePropertyType::INT32_VEC); |
| 700 | } |
| 701 | |
shrikar | 668df36 | 2022-12-20 22:08:17 +0000 | [diff] [blame] | 702 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) { |
| 703 | verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, |
| 704 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 705 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 706 | } |
| 707 | |
shrikar | 80cc0c5 | 2023-01-30 16:56:53 +0000 | [diff] [blame] | 708 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistStateConfig) { |
| 709 | verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ, |
| 710 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 711 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 712 | } |
| 713 | |
shrikar | 5d1b816 | 2023-01-25 19:31:23 +0000 | [diff] [blame] | 714 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlEnabledConfig) { |
| 715 | verifyProperty(VehicleProperty::CRUISE_CONTROL_ENABLED, VehiclePropertyAccess::READ_WRITE, |
| 716 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 717 | VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
shrikar | 808a294 | 2022-12-21 17:07:32 +0000 | [diff] [blame] | 718 | } |
| 719 | |
shrikar | d440ed4 | 2023-01-31 00:25:14 +0000 | [diff] [blame] | 720 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlTypeConfig) { |
| 721 | verifyProperty(VehicleProperty::CRUISE_CONTROL_TYPE, VehiclePropertyAccess::READ_WRITE, |
| 722 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 723 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 724 | } |
| 725 | |
shrikar | 2753b9e | 2023-01-31 00:25:14 +0000 | [diff] [blame] | 726 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlStateConfig) { |
| 727 | verifyProperty(VehicleProperty::CRUISE_CONTROL_STATE, VehiclePropertyAccess::READ, |
| 728 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 729 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 730 | } |
| 731 | |
shrikar | 5df0f95 | 2023-02-02 00:15:39 +0000 | [diff] [blame] | 732 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlCommandConfig) { |
| 733 | verifyProperty(VehicleProperty::CRUISE_CONTROL_COMMAND, VehiclePropertyAccess::WRITE, |
| 734 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 735 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 736 | } |
| 737 | |
shrikar | fde8c24 | 2023-02-02 01:10:33 +0000 | [diff] [blame] | 738 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlTargetSpeedConfig) { |
| 739 | verifyProperty(VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess::READ, |
| 740 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 741 | VehicleArea::GLOBAL, VehiclePropertyType::FLOAT); |
| 742 | } |
| 743 | |
shrikar | b9661d3 | 2023-02-02 19:22:50 +0000 | [diff] [blame] | 744 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAdaptiveCruiseControlTargetTimeGapConfig) { |
| 745 | verifyProperty(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, |
| 746 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 747 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 748 | } |
| 749 | |
shrikar | f62d747 | 2023-02-03 00:20:04 +0000 | [diff] [blame] | 750 | TEST_P(VtsHalAutomotiveVehicleTargetTest, |
| 751 | verifyAdaptiveCruiseControlLeadVehicleMeasuredDistanceConfig) { |
| 752 | verifyProperty(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, |
| 753 | VehiclePropertyAccess::READ, VehiclePropertyChangeMode::CONTINUOUS, |
| 754 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 755 | } |
| 756 | |
shrikar | 37833e1 | 2022-12-15 20:13:14 +0000 | [diff] [blame] | 757 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionEnabledConfig) { |
| 758 | verifyProperty(VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE, |
| 759 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 760 | VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 761 | } |
| 762 | |
shrikar | 6d88bf5 | 2023-01-17 17:04:21 +0000 | [diff] [blame] | 763 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionDriverStateConfig) { |
| 764 | verifyProperty(VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyAccess::READ, |
| 765 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 766 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 767 | } |
| 768 | |
shrikar | a678599 | 2023-01-18 23:07:06 +0000 | [diff] [blame] | 769 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionWarningConfig) { |
| 770 | verifyProperty(VehicleProperty::HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess::READ, |
| 771 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 772 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 773 | } |
| 774 | |
Eva Chen | bbb7b6d | 2023-11-21 00:07:14 -0800 | [diff] [blame] | 775 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionSystemEnabledConfig) { |
| 776 | verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, |
| 777 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 778 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 779 | } |
| 780 | |
Eva Chen | 9f1d8c0 | 2023-11-28 16:50:14 -0800 | [diff] [blame] | 781 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionStateConfig) { |
| 782 | verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyAccess::READ, |
| 783 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 784 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 785 | } |
| 786 | |
Eva Chen | 6ec790b | 2023-12-01 23:37:29 -0800 | [diff] [blame] | 787 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionWarningEnabledConfig) { |
| 788 | verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, |
| 789 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 790 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 791 | } |
| 792 | |
Eva Chen | 05c548c | 2023-12-02 01:20:10 -0800 | [diff] [blame] | 793 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionWarningConfig) { |
| 794 | verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, |
| 795 | VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE, |
| 796 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 797 | } |
| 798 | |
Eva Chen | 51770b0 | 2023-12-02 15:27:31 -0800 | [diff] [blame] | 799 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionSystemEnabledConfig) { |
| 800 | verifyProperty(VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, |
| 801 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 802 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 803 | } |
| 804 | |
Eva Chen | a342b72 | 2023-12-04 00:40:45 -0800 | [diff] [blame] | 805 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionStateConfig) { |
| 806 | verifyProperty(VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyAccess::READ, |
| 807 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 808 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 809 | } |
| 810 | |
Eva Chen | c62166e | 2023-12-04 02:17:36 -0800 | [diff] [blame] | 811 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionWarningEnabledConfig) { |
| 812 | verifyProperty(VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, |
| 813 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 814 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 815 | } |
| 816 | |
Eva Chen | 9a0925e | 2023-12-04 03:52:23 -0800 | [diff] [blame] | 817 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionWarningConfig) { |
| 818 | verifyProperty(VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess::READ, |
| 819 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 820 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 821 | } |
| 822 | |
Aaqib Ismail | c69e968 | 2022-11-22 12:50:00 -0800 | [diff] [blame] | 823 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBrakeRegenerationLevelConfig) { |
| 824 | verifyProperty(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL, |
| 825 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 826 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 827 | } |
| 828 | |
shrikar | 2dae80f | 2022-12-21 23:50:17 +0000 | [diff] [blame] | 829 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvStoppingModeConfig) { |
| 830 | verifyProperty(VehicleProperty::EV_STOPPING_MODE, VehiclePropertyAccess::READ_WRITE, |
| 831 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 832 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 833 | } |
| 834 | |
Aaqib Ismail | aec678a | 2022-12-07 16:22:42 -0800 | [diff] [blame] | 835 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvCurrentBatteryCapacityConfig) { |
| 836 | verifyProperty(VehicleProperty::EV_CURRENT_BATTERY_CAPACITY, VehiclePropertyAccess::READ, |
| 837 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 838 | VehicleArea::GLOBAL, VehiclePropertyType::FLOAT); |
| 839 | } |
| 840 | |
shrikar | 8391447 | 2022-12-16 20:28:47 +0000 | [diff] [blame] | 841 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEngineIdleAutoStopEnabledConfig) { |
| 842 | verifyProperty(VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED, |
| 843 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 844 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 845 | } |
| 846 | |
Aaqib Ismail | 2048670 | 2022-10-27 16:58:50 -0700 | [diff] [blame] | 847 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDoorChildLockEnabledConfig) { |
| 848 | verifyProperty(VehicleProperty::DOOR_CHILD_LOCK_ENABLED, VehiclePropertyAccess::READ_WRITE, |
| 849 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 850 | VehicleArea::DOOR, VehiclePropertyType::BOOLEAN); |
| 851 | } |
| 852 | |
Aaqib Ismail | 63d52d1 | 2023-01-30 12:35:10 -0800 | [diff] [blame] | 853 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyWindshieldWipersPeriodConfig) { |
| 854 | verifyProperty(VehicleProperty::WINDSHIELD_WIPERS_PERIOD, VehiclePropertyAccess::READ, |
| 855 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 856 | VehicleArea::WINDOW, VehiclePropertyType::INT32); |
| 857 | } |
| 858 | |
Aaqib Ismail | 732a1d7 | 2023-01-31 10:25:45 -0800 | [diff] [blame] | 859 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyWindshieldWipersStateConfig) { |
| 860 | verifyProperty(VehicleProperty::WINDSHIELD_WIPERS_STATE, VehiclePropertyAccess::READ, |
| 861 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 862 | VehicleArea::WINDOW, VehiclePropertyType::INT32); |
| 863 | } |
| 864 | |
Aaqib Ismail | c37a211 | 2023-02-02 11:30:08 -0800 | [diff] [blame] | 865 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyWindshieldWipersSwitchConfig) { |
| 866 | verifyProperty(VehicleProperty::WINDSHIELD_WIPERS_SWITCH, VehiclePropertyAccess::READ_WRITE, |
| 867 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 868 | VehicleArea::WINDOW, VehiclePropertyType::INT32); |
| 869 | } |
| 870 | |
Aaqib Ismail | 7f941b4 | 2022-11-04 14:55:13 -0700 | [diff] [blame] | 871 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelDepthPosConfig) { |
| 872 | verifyProperty(VehicleProperty::STEERING_WHEEL_DEPTH_POS, VehiclePropertyAccess::READ_WRITE, |
| 873 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 874 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 875 | } |
| 876 | |
Aaqib Ismail | 34fe92f | 2022-11-04 21:41:23 -0700 | [diff] [blame] | 877 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelDepthMoveConfig) { |
| 878 | verifyProperty(VehicleProperty::STEERING_WHEEL_DEPTH_MOVE, VehiclePropertyAccess::READ_WRITE, |
| 879 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 880 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 881 | } |
| 882 | |
Aaqib Ismail | 53b81c9 | 2022-11-07 17:47:04 -0800 | [diff] [blame] | 883 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelHeightPosConfig) { |
| 884 | verifyProperty(VehicleProperty::STEERING_WHEEL_HEIGHT_POS, VehiclePropertyAccess::READ_WRITE, |
| 885 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 886 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 887 | } |
| 888 | |
Aaqib Ismail | 6c4bf19 | 2022-11-08 15:00:32 -0800 | [diff] [blame] | 889 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelHeightMoveConfig) { |
| 890 | verifyProperty(VehicleProperty::STEERING_WHEEL_HEIGHT_MOVE, VehiclePropertyAccess::READ_WRITE, |
| 891 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 892 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 893 | } |
| 894 | |
Aaqib Ismail | 8d05118 | 2022-11-09 13:28:48 -0800 | [diff] [blame] | 895 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelTheftLockEnabledConfig) { |
| 896 | verifyProperty(VehicleProperty::STEERING_WHEEL_THEFT_LOCK_ENABLED, |
| 897 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 898 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 899 | } |
| 900 | |
Aaqib Ismail | 68d3f12 | 2022-11-09 14:43:32 -0800 | [diff] [blame] | 901 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelLockedConfig) { |
| 902 | verifyProperty(VehicleProperty::STEERING_WHEEL_LOCKED, VehiclePropertyAccess::READ_WRITE, |
| 903 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 904 | VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 905 | } |
| 906 | |
Aaqib Ismail | d4d6adf | 2022-11-09 16:59:47 -0800 | [diff] [blame] | 907 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelEasyAccessEnabledConfig) { |
| 908 | verifyProperty(VehicleProperty::STEERING_WHEEL_EASY_ACCESS_ENABLED, |
| 909 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 910 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 911 | } |
| 912 | |
Aaqib Ismail | 0dc7ba0 | 2022-11-10 14:28:09 -0800 | [diff] [blame] | 913 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelLightsStateConfig) { |
| 914 | verifyProperty(VehicleProperty::STEERING_WHEEL_LIGHTS_STATE, VehiclePropertyAccess::READ, |
| 915 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 916 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 917 | } |
| 918 | |
Aaqib Ismail | 4b8688f | 2022-11-15 15:13:35 -0800 | [diff] [blame] | 919 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelLightsSwitchConfig) { |
| 920 | verifyProperty(VehicleProperty::STEERING_WHEEL_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE, |
| 921 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 922 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 923 | } |
| 924 | |
Arati Gerdes | d86c7fd | 2022-12-19 12:32:29 -0800 | [diff] [blame] | 925 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyGloveBoxDoorPosConfig) { |
| 926 | verifyProperty(VehicleProperty::GLOVE_BOX_DOOR_POS, VehiclePropertyAccess::READ_WRITE, |
| 927 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 928 | VehicleArea::SEAT, VehiclePropertyType::INT32); |
| 929 | } |
| 930 | |
Aaqib Ismail | 57be403 | 2023-02-02 14:15:03 -0800 | [diff] [blame] | 931 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyGloveBoxLockedConfig) { |
| 932 | verifyProperty(VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyAccess::READ_WRITE, |
| 933 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 934 | VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); |
| 935 | } |
| 936 | |
shrikar | a136721 | 2022-11-02 16:07:35 +0000 | [diff] [blame] | 937 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyMirrorAutoFoldEnabledConfig) { |
| 938 | verifyProperty(VehicleProperty::MIRROR_AUTO_FOLD_ENABLED, VehiclePropertyAccess::READ_WRITE, |
| 939 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 940 | VehicleArea::MIRROR, VehiclePropertyType::BOOLEAN); |
| 941 | } |
| 942 | |
| 943 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyMirrorAutoTiltEnabledConfig) { |
| 944 | verifyProperty(VehicleProperty::MIRROR_AUTO_TILT_ENABLED, VehiclePropertyAccess::READ_WRITE, |
| 945 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 946 | VehicleArea::MIRROR, VehiclePropertyType::BOOLEAN); |
| 947 | } |
| 948 | |
Aaqib Ismail | 4e6144c | 2022-12-15 15:32:18 -0800 | [diff] [blame] | 949 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatHeadrestHeightPosV2Config) { |
| 950 | verifyProperty(VehicleProperty::SEAT_HEADREST_HEIGHT_POS_V2, VehiclePropertyAccess::READ_WRITE, |
| 951 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 952 | VehicleArea::SEAT, VehiclePropertyType::INT32); |
| 953 | } |
| 954 | |
shrikar | 6ae7916 | 2022-12-16 03:03:25 +0000 | [diff] [blame] | 955 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatWalkInPosConfig) { |
| 956 | verifyProperty(VehicleProperty::SEAT_WALK_IN_POS, VehiclePropertyAccess::READ_WRITE, |
| 957 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 958 | VehicleArea::SEAT, VehiclePropertyType::INT32); |
| 959 | } |
| 960 | |
shrikar | fb65ae5 | 2022-11-03 23:12:51 +0000 | [diff] [blame] | 961 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatFootwellLightsStateConfig) { |
| 962 | verifyProperty(VehicleProperty::SEAT_FOOTWELL_LIGHTS_STATE, VehiclePropertyAccess::READ, |
| 963 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 964 | VehicleArea::SEAT, VehiclePropertyType::INT32); |
| 965 | } |
| 966 | |
shrikar | 93cf1be | 2022-11-30 15:00:52 -0800 | [diff] [blame] | 967 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatFootwellLightsSwitchConfig) { |
| 968 | verifyProperty(VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE, |
| 969 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 970 | VehicleArea::SEAT, VehiclePropertyType::INT32); |
| 971 | } |
| 972 | |
shrikar | 3326de0 | 2022-11-07 23:51:20 +0000 | [diff] [blame] | 973 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatEasyAccessEnabledConfig) { |
| 974 | verifyProperty(VehicleProperty::SEAT_EASY_ACCESS_ENABLED, VehiclePropertyAccess::READ_WRITE, |
| 975 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 976 | VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); |
| 977 | } |
| 978 | |
shrikar | b96e376 | 2022-11-08 16:49:58 -0800 | [diff] [blame] | 979 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatAirbagEnabledConfig) { |
| 980 | verifyProperty(VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyAccess::READ_WRITE, |
| 981 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 982 | VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); |
| 983 | } |
| 984 | |
shrikar | 802ecb5 | 2022-11-09 18:27:06 +0000 | [diff] [blame] | 985 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatCushionSideSupportPosConfig) { |
| 986 | verifyProperty(VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, |
| 987 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 988 | VehiclePropertyGroup::SYSTEM, VehicleArea::SEAT, VehiclePropertyType::INT32); |
| 989 | } |
| 990 | |
shrikar | 1f0ce0d | 2022-11-11 17:46:06 +0000 | [diff] [blame] | 991 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatCushionSideSupportMoveConfig) { |
| 992 | verifyProperty(VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE, |
| 993 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 994 | VehiclePropertyGroup::SYSTEM, VehicleArea::SEAT, VehiclePropertyType::INT32); |
| 995 | } |
| 996 | |
shrikar | eff71b2 | 2022-11-11 11:02:43 -0800 | [diff] [blame] | 997 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatLumbarVerticalPosConfig) { |
| 998 | verifyProperty(VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyAccess::READ_WRITE, |
| 999 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1000 | VehicleArea::SEAT, VehiclePropertyType::INT32); |
| 1001 | } |
| 1002 | |
shrikar | 2a081c5 | 2022-11-11 16:49:58 -0800 | [diff] [blame] | 1003 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatLumbarVerticalMoveConfig) { |
| 1004 | verifyProperty(VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyAccess::READ_WRITE, |
| 1005 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1006 | VehicleArea::SEAT, VehiclePropertyType::INT32); |
| 1007 | } |
| 1008 | |
Aaqib Ismail | 5d53aa3 | 2022-12-13 22:30:23 +0000 | [diff] [blame] | 1009 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAutomaticEmergencyBrakingEnabledConfig) { |
| 1010 | verifyProperty(VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, |
| 1011 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 1012 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 1013 | } |
| 1014 | |
Aaqib Ismail | 28ee23c | 2023-01-04 23:04:46 -0800 | [diff] [blame] | 1015 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAutomaticEmergencyBrakingStateConfig) { |
| 1016 | verifyProperty(VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess::READ, |
| 1017 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1018 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1019 | } |
| 1020 | |
Aaqib Ismail | a251367 | 2022-12-15 00:55:27 +0000 | [diff] [blame] | 1021 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyForwardCollisionWarningEnabledConfig) { |
| 1022 | verifyProperty(VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, |
| 1023 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 1024 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 1025 | } |
| 1026 | |
Aaqib Ismail | 0a1ab29 | 2023-01-19 21:33:56 +0000 | [diff] [blame] | 1027 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyForwardCollisionWarningStateConfig) { |
| 1028 | verifyProperty(VehicleProperty::FORWARD_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ, |
| 1029 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1030 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1031 | } |
| 1032 | |
Aaqib Ismail | 3f7177a | 2022-12-17 09:20:00 -0800 | [diff] [blame] | 1033 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyBlindSpotWarningEnabledConfig) { |
| 1034 | verifyProperty(VehicleProperty::BLIND_SPOT_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE, |
| 1035 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1036 | VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 1037 | } |
| 1038 | |
Aaqib Ismail | 5fc97bb | 2023-01-10 17:07:47 -0800 | [diff] [blame] | 1039 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyBlindSpotWarningStateConfig) { |
| 1040 | verifyProperty(VehicleProperty::BLIND_SPOT_WARNING_STATE, VehiclePropertyAccess::READ, |
| 1041 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1042 | VehicleArea::MIRROR, VehiclePropertyType::INT32); |
| 1043 | } |
| 1044 | |
Aaqib Ismail | 7a46cef | 2022-12-17 10:00:59 -0800 | [diff] [blame] | 1045 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneDepartureWarningEnabledConfig) { |
| 1046 | verifyProperty(VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED, |
| 1047 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 1048 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 1049 | } |
| 1050 | |
Aaqib Ismail | 8462db5 | 2023-01-27 19:59:49 -0800 | [diff] [blame] | 1051 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneDepartureWarningStateConfig) { |
| 1052 | verifyProperty(VehicleProperty::LANE_DEPARTURE_WARNING_STATE, VehiclePropertyAccess::READ, |
| 1053 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1054 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1055 | } |
| 1056 | |
Aaqib Ismail | 20cc66a | 2022-12-22 05:38:28 -0800 | [diff] [blame] | 1057 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneKeepAssistEnabledConfig) { |
| 1058 | verifyProperty(VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE, |
| 1059 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1060 | VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 1061 | } |
| 1062 | |
Aaqib Ismail | 78db2ca | 2023-01-10 17:34:28 -0800 | [diff] [blame] | 1063 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneKeepAssistStateConfig) { |
| 1064 | verifyProperty(VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ, |
| 1065 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1066 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1067 | } |
| 1068 | |
Aaqib Ismail | b1680a7 | 2022-12-14 23:28:49 +0000 | [diff] [blame] | 1069 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistEnabledConfig) { |
| 1070 | verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, |
| 1071 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 1072 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 1073 | } |
| 1074 | |
Aaqib Ismail | 0ffd39c | 2023-01-11 12:19:10 -0800 | [diff] [blame] | 1075 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistCommandConfig) { |
| 1076 | verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyAccess::WRITE, |
| 1077 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1078 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1079 | } |
| 1080 | |
Aaqib Ismail | db03444 | 2023-01-10 18:14:28 -0800 | [diff] [blame] | 1081 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistStateConfig) { |
| 1082 | verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess::READ, |
| 1083 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1084 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1085 | } |
| 1086 | |
Yuncheol Heo | 8fbbfd1 | 2023-09-27 15:43:59 -0700 | [diff] [blame] | 1087 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyClusterHeartbeatConfig) { |
| 1088 | verifyProperty(VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyAccess::WRITE, |
| 1089 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1090 | VehicleArea::GLOBAL, VehiclePropertyType::MIXED); |
| 1091 | } |
| 1092 | |
shrikar | d6f9f8e | 2023-11-02 22:35:28 +0000 | [diff] [blame] | 1093 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyVehicleDrivingAutomationCurrentLevelConfig) { |
| 1094 | verifyProperty(VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, |
| 1095 | VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE, |
| 1096 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1097 | } |
| 1098 | |
shrikar | 420b31d | 2023-11-07 16:15:35 +0000 | [diff] [blame] | 1099 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatAirbagsDeployedConfig) { |
| 1100 | verifyProperty(VehicleProperty::SEAT_AIRBAGS_DEPLOYED, VehiclePropertyAccess::READ, |
| 1101 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1102 | VehicleArea::SEAT, VehiclePropertyType::INT32); |
| 1103 | } |
| 1104 | |
shrikar | 7717aa8 | 2023-11-07 21:05:46 +0000 | [diff] [blame] | 1105 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatBeltPretensionerDeployedConfig) { |
| 1106 | verifyProperty(VehicleProperty::SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyAccess::READ, |
| 1107 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1108 | VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); |
| 1109 | } |
| 1110 | |
shrikar | d816e04 | 2023-11-08 20:12:55 +0000 | [diff] [blame] | 1111 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyImpactDetectedConfig) { |
| 1112 | verifyProperty(VehicleProperty::IMPACT_DETECTED, VehiclePropertyAccess::READ, |
| 1113 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1114 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1115 | } |
| 1116 | |
shrikar | a492e7d | 2023-11-09 00:27:54 +0000 | [diff] [blame] | 1117 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBatteryAverageTemperatureConfig) { |
| 1118 | verifyProperty(VehicleProperty::EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyAccess::READ, |
| 1119 | VehiclePropertyChangeMode::CONTINUOUS, VehiclePropertyGroup::SYSTEM, |
| 1120 | VehicleArea::GLOBAL, VehiclePropertyType::FLOAT); |
| 1121 | } |
| 1122 | |
shrikar | 45df34b | 2023-11-10 21:14:17 +0000 | [diff] [blame] | 1123 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedCollisionWarningEnabledConfig) { |
| 1124 | verifyProperty(VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, |
| 1125 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 1126 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 1127 | } |
| 1128 | |
shrikar | 858c4e1 | 2023-11-14 17:33:11 +0000 | [diff] [blame] | 1129 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedCollisionWarningStateConfig) { |
| 1130 | verifyProperty(VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ, |
| 1131 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1132 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1133 | } |
| 1134 | |
shrikar | 84866f7 | 2023-11-27 00:30:59 +0000 | [diff] [blame] | 1135 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyValetModeEnabledConfig) { |
| 1136 | verifyProperty(VehicleProperty::VALET_MODE_ENABLED, VehiclePropertyAccess::READ_WRITE, |
| 1137 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1138 | VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 1139 | } |
| 1140 | |
shrikar | 33a3369 | 2023-11-30 01:38:01 +0000 | [diff] [blame] | 1141 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyElectronicStabilityControlEnabledConfig) { |
| 1142 | verifyProperty(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED, |
| 1143 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 1144 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 1145 | } |
| 1146 | |
shrikar | a45d1cf | 2023-11-27 17:40:46 +0000 | [diff] [blame] | 1147 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyElectronicStabilityControlStateConfig) { |
| 1148 | verifyProperty(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyAccess::READ, |
| 1149 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1150 | VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1151 | } |
| 1152 | |
shrikar | 7fde8f5 | 2023-11-27 22:47:53 +0000 | [diff] [blame] | 1153 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCrossTrafficMonitoringEnabledConfig) { |
| 1154 | verifyProperty(VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED, |
| 1155 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 1156 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 1157 | } |
| 1158 | |
shrikar | 813ba7c | 2023-11-28 18:35:34 +0000 | [diff] [blame] | 1159 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCrossTrafficMonitoringWarningStateConfig) { |
| 1160 | verifyProperty(VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE, |
| 1161 | VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE, |
| 1162 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1163 | } |
| 1164 | |
shrikar | 5555989 | 2023-12-01 23:35:06 +0000 | [diff] [blame] | 1165 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHeadUpDisplayEnabledConfig) { |
| 1166 | verifyProperty(VehicleProperty::HEAD_UP_DISPLAY_ENABLED, VehiclePropertyAccess::READ_WRITE, |
| 1167 | VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, |
| 1168 | VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); |
| 1169 | } |
| 1170 | |
shrikar | d11b9f8 | 2023-12-04 17:39:28 +0000 | [diff] [blame] | 1171 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedAutomaticEmergencyBrakingEnabledConfig) { |
| 1172 | verifyProperty(VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED, |
| 1173 | VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, |
| 1174 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); |
| 1175 | } |
| 1176 | |
shrikar | bd6ab73 | 2023-12-04 19:07:26 +0000 | [diff] [blame] | 1177 | TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedAutomaticEmergencyBrakingStateConfig) { |
| 1178 | verifyProperty(VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE, |
| 1179 | VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE, |
| 1180 | VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); |
| 1181 | } |
| 1182 | |
Yu Shan | 0ebd876 | 2023-10-11 11:31:04 -0700 | [diff] [blame] | 1183 | bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { |
Yu Shan | ec5d5b0 | 2023-10-09 14:43:36 -0700 | [diff] [blame] | 1184 | auto result = mVhalClient->getPropConfigs({propertyId}); |
Yu Shan | 0ebd876 | 2023-10-11 11:31:04 -0700 | [diff] [blame] | 1185 | return result.ok(); |
Yu Shan | ec5d5b0 | 2023-10-09 14:43:36 -0700 | [diff] [blame] | 1186 | } |
| 1187 | |
Yu Shan | 726d51a | 2022-02-22 17:37:21 -0800 | [diff] [blame] | 1188 | std::vector<ServiceDescriptor> getDescriptors() { |
| 1189 | std::vector<ServiceDescriptor> descriptors; |
| 1190 | for (std::string name : getAidlHalInstanceNames(IVehicle::descriptor)) { |
| 1191 | descriptors.push_back({ |
| 1192 | .name = name, |
| 1193 | .isAidlService = true, |
| 1194 | }); |
| 1195 | } |
| 1196 | for (std::string name : getAllHalInstanceNames(IVehicle::descriptor)) { |
| 1197 | descriptors.push_back({ |
| 1198 | .name = name, |
| 1199 | .isAidlService = false, |
| 1200 | }); |
| 1201 | } |
| 1202 | return descriptors; |
| 1203 | } |
| 1204 | |
| 1205 | GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VtsHalAutomotiveVehicleTargetTest); |
| 1206 | |
| 1207 | INSTANTIATE_TEST_SUITE_P(PerInstance, VtsHalAutomotiveVehicleTargetTest, |
| 1208 | testing::ValuesIn(getDescriptors()), |
| 1209 | [](const testing::TestParamInfo<ServiceDescriptor>& info) { |
| 1210 | std::string name = ""; |
| 1211 | if (info.param.isAidlService) { |
| 1212 | name += "aidl_"; |
| 1213 | } else { |
| 1214 | name += "hidl_"; |
| 1215 | } |
| 1216 | name += info.param.name; |
| 1217 | return Sanitize(name); |
| 1218 | }); |
| 1219 | |
| 1220 | int main(int argc, char** argv) { |
| 1221 | ::testing::InitGoogleTest(&argc, argv); |
| 1222 | ABinderProcess_setThreadPoolMaxThreadCount(1); |
| 1223 | return RUN_ALL_TESTS(); |
| 1224 | } |