diff options
author | Jonathan Reichert <jareichert@google.com> | 2022-06-17 08:17:22 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-06-17 08:17:22 +0000 |
commit | 309f54042ff471d66c2d5ef2d3c4ed77e102ea10 (patch) | |
tree | a9b2cb873614a0fd0cddb281eca7c2378af95952 /boot/1.1 | |
parent | 11cb5649139d4ba9f79cad768a7a125628e4dd87 (diff) | |
parent | b2018887d741a68235decdfa01753f23f6263621 (diff) | |
download | interfaces-309f54042ff471d66c2d5ef2d3c4ed77e102ea10.tar.gz |
Merge "To skip VtsHalBootV1_1TargetTest for non Virtual A/B devices"
Diffstat (limited to 'boot/1.1')
-rw-r--r-- | boot/1.1/vts/functional/VtsHalBootV1_1TargetTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/boot/1.1/vts/functional/VtsHalBootV1_1TargetTest.cpp b/boot/1.1/vts/functional/VtsHalBootV1_1TargetTest.cpp index c38f25793f..05f136ef61 100644 --- a/boot/1.1/vts/functional/VtsHalBootV1_1TargetTest.cpp +++ b/boot/1.1/vts/functional/VtsHalBootV1_1TargetTest.cpp @@ -1,4 +1,5 @@ /* + * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,6 +20,7 @@ #include <vector> #include <android-base/logging.h> +#include <android-base/properties.h> #include <android/hardware/boot/1.1/IBootControl.h> #include <android/hardware/boot/1.1/types.h> #include <gmock/gmock.h> @@ -37,9 +39,21 @@ using ::android::hardware::boot::V1_1::IBootControl; using ::android::hardware::boot::V1_1::MergeStatus; using ::testing::Contains; +bool IsVirtualAbEnabled(); + +#define SKIP_IF_NON_VIRTUAL_AB() \ + do { \ + if (!IsVirtualAbEnabled()) GTEST_SKIP() << "Test for Virtual A/B devices only"; \ + } while (0) + +bool IsVirtualAbEnabled() { + return android::base::GetBoolProperty("ro.virtual_ab.enabled", false); +} + class BootHidlTest : public testing::TestWithParam<std::string> { public: virtual void SetUp() override { + SKIP_IF_NON_VIRTUAL_AB(); boot = IBootControl::getService(GetParam()); ASSERT_NE(boot, nullptr); |