From b2018887d741a68235decdfa01753f23f6263621 Mon Sep 17 00:00:00 2001 From: Sivananthinikumari Date: Mon, 13 Jun 2022 18:10:25 +0530 Subject: [PATCH] To skip VtsHalBootV1_1TargetTest for non Virtual A/B devices Snapshot specific testcases are skipped if Virtual A/B is disabled on R launch devices. Bug: 234812188 Change-Id: I9aa17b681c6880e66fd2976e0c9d3cddc6ba2884 --- .../vts/functional/VtsHalBootV1_1TargetTest.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 #include +#include #include #include #include @@ -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 { public: virtual void SetUp() override { + SKIP_IF_NON_VIRTUAL_AB(); boot = IBootControl::getService(GetParam()); ASSERT_NE(boot, nullptr);