mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Wifi: Fix VTS test backward compatibility
This commit fixes backward compatibility for the vts tests. For devices supporting IWifiChip@1.3 HAL interface, getCapabilities_1_3() should be used instead of getCapabilities() in older HAL version vts tests. Bug: 120912623 Test: VTS tests run successfully for all HAL versions Test: run vts -m VtsHalWifiV1_0TargetTest Test: run vts -m VtsHalWifiV1_1TargetTest Test: run vts -m VtsHalWifiV1_2TargetTest Test: run vts -m VtsHalWifiV1_3TargetTest Change-Id: Ife61bbbbdc8f7c0862f511fbe2b76519bec98941
This commit is contained in:
@@ -45,6 +45,7 @@ cc_test {
|
||||
static_libs: [
|
||||
"VtsHalWifiV1_0TargetTestUtil",
|
||||
"android.hardware.wifi@1.0",
|
||||
"android.hardware.wifi@1.1",
|
||||
"android.hardware.wifi@1.2",
|
||||
"android.hardware.wifi@1.3",
|
||||
],
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <android-base/logging.h>
|
||||
|
||||
#include <android/hardware/wifi/1.0/IWifiChip.h>
|
||||
#include <android/hardware/wifi/1.3/IWifiChip.h>
|
||||
|
||||
#include <VtsHalHidlTargetTestBase.h>
|
||||
|
||||
@@ -87,7 +88,19 @@ class WifiChipHidlTest : public ::testing::VtsHalHidlTargetTestBase {
|
||||
|
||||
uint32_t configureChipForStaIfaceAndGetCapabilities() {
|
||||
configureChipForIfaceType(IfaceType::STA, true);
|
||||
const auto& status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
|
||||
|
||||
sp<::android::hardware::wifi::V1_3::IWifiChip> chip_converted =
|
||||
::android::hardware::wifi::V1_3::IWifiChip::castFrom(wifi_chip_);
|
||||
|
||||
std::pair<WifiStatus, uint32_t> status_and_caps;
|
||||
|
||||
if (chip_converted != nullptr) {
|
||||
// Call the newer HAL version
|
||||
status_and_caps = HIDL_INVOKE(chip_converted, getCapabilities_1_3);
|
||||
} else {
|
||||
status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
|
||||
}
|
||||
|
||||
if (status_and_caps.first.code != WifiStatusCode::SUCCESS) {
|
||||
EXPECT_EQ(WifiStatusCode::ERROR_NOT_SUPPORTED, status_and_caps.first.code);
|
||||
return 0;
|
||||
|
||||
@@ -24,6 +24,8 @@ cc_test {
|
||||
"VtsHalWifiV1_0TargetTestUtil",
|
||||
"android.hardware.wifi@1.0",
|
||||
"android.hardware.wifi@1.1",
|
||||
"android.hardware.wifi@1.2",
|
||||
"android.hardware.wifi@1.3",
|
||||
],
|
||||
test_suites: ["general-tests"],
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <android/hardware/wifi/1.1/IWifi.h>
|
||||
#include <android/hardware/wifi/1.1/IWifiChip.h>
|
||||
#include <android/hardware/wifi/1.3/IWifiChip.h>
|
||||
|
||||
#include <VtsHalHidlTargetTestBase.h>
|
||||
|
||||
@@ -58,7 +59,19 @@ class WifiChipHidlTest : public ::testing::VtsHalHidlTargetTestBase {
|
||||
ChipModeId mode_id;
|
||||
EXPECT_TRUE(configureChipToSupportIfaceType(
|
||||
wifi_chip_, IfaceType::STA, &mode_id));
|
||||
const auto& status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
|
||||
|
||||
sp<::android::hardware::wifi::V1_3::IWifiChip> chip_converted =
|
||||
::android::hardware::wifi::V1_3::IWifiChip::castFrom(wifi_chip_);
|
||||
|
||||
std::pair<WifiStatus, uint32_t> status_and_caps;
|
||||
|
||||
if (chip_converted != nullptr) {
|
||||
// Call the newer HAL version
|
||||
status_and_caps = HIDL_INVOKE(chip_converted, getCapabilities_1_3);
|
||||
} else {
|
||||
status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
|
||||
}
|
||||
|
||||
EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
|
||||
return status_and_caps.second;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ cc_test {
|
||||
"android.hardware.wifi@1.0",
|
||||
"android.hardware.wifi@1.1",
|
||||
"android.hardware.wifi@1.2",
|
||||
"android.hardware.wifi@1.3",
|
||||
],
|
||||
test_suites: ["general-tests"],
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <android/hardware/wifi/1.2/IWifiChip.h>
|
||||
#include <android/hardware/wifi/1.2/IWifiChipEventCallback.h>
|
||||
#include <android/hardware/wifi/1.3/IWifiChip.h>
|
||||
|
||||
#include <VtsHalHidlTargetCallbackBase.h>
|
||||
#include <VtsHalHidlTargetTestBase.h>
|
||||
@@ -104,7 +105,19 @@ class WifiChipHidlTest : public ::testing::VtsHalHidlTargetTestBase {
|
||||
ChipModeId mode_id;
|
||||
EXPECT_TRUE(
|
||||
configureChipToSupportIfaceType(wifi_chip_, IfaceType::STA, &mode_id));
|
||||
const auto& status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
|
||||
|
||||
sp<::android::hardware::wifi::V1_3::IWifiChip> chip_converted =
|
||||
::android::hardware::wifi::V1_3::IWifiChip::castFrom(wifi_chip_);
|
||||
|
||||
std::pair<WifiStatus, uint32_t> status_and_caps;
|
||||
|
||||
if (chip_converted != nullptr) {
|
||||
// Call the newer HAL version
|
||||
status_and_caps = HIDL_INVOKE(chip_converted, getCapabilities_1_3);
|
||||
} else {
|
||||
status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
|
||||
}
|
||||
|
||||
EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
|
||||
return status_and_caps.second;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user