From 1dc8481bc75cf4718774ebdadcc031ac190807dc Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Mon, 29 Jan 2024 17:43:23 +0800 Subject: [PATCH] Bypass Thread HAL SendSpinelFrame test on TV devices The Thread HAL VTS test is built from the staging folder on the android14-tests-dev branch. And the HAL interface doesn't have @VintfStability which means it is unstable interface. Thread HAL interface has been removed from the staging folder and added the @VintfStability on main branch. It reports following errors when runing the VTS that froms android14-tests-dev branch on main branch. `BpBinder: Cannot do a user transaction on a system stability binder in a vendor stability context` This CL bypasses the `SendSpinelFrame` test case of the Thread VTS tests on TV devices. Bug: b/322731574 Test: Run `run vts -m VtsHalThreadNetworkTargetTest` on the TV device Change-Id: Ibf7fe96aafa58cee7ae55a0ef613f0be67548a80 --- .../vts/VtsHalThreadNetworkTargetTest.cpp | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp b/staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp index 3e43f9c8b7..14c5b06d1b 100644 --- a/staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp +++ b/staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp @@ -67,10 +67,33 @@ class ThreadNetworkAidl : public testing::TestWithParam { } virtual void TearDown() override { thread_chip->close(); } + bool DeviceSupportsFeature(const char* feature); + static constexpr char kTvFeatureName[] = "android.software.leanback"; std::shared_ptr thread_chip; }; +bool ThreadNetworkAidl::DeviceSupportsFeature(const char* feature) { + bool device_supports_feature = false; + FILE* p = popen("pm list features", "re"); + char* line = nullptr; + size_t len = 0; + + if (!p) { + return false; + } + + while (getline(&line, &len, p) > 0) { + if (strstr(line, feature)) { + device_supports_feature = true; + break; + } + } + pclose(p); + + return device_supports_feature; +} + TEST_P(ThreadNetworkAidl, Open) { std::shared_ptr callback = ndk::SharedRefBase::make([](auto /* data */) {}); @@ -122,6 +145,10 @@ TEST_P(ThreadNetworkAidl, SendSpinelFrame) { } }); + if (DeviceSupportsFeature(kTvFeatureName)) { + GTEST_SKIP() << "SendSpinelFrame test is bypassed on TV devices"; + } + ASSERT_NE(callback, nullptr); EXPECT_TRUE(thread_chip->open(callback).isOk());