mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 22:04:26 +00:00
wifi: add VTS tests for IWifiApIface
Bug: 32022435 Bug: 36813739 Test: run VtsHalWifiV1_0Target test Change-Id: I31db3b1bfe5deed5691e0d342762298b4b0d3620
This commit is contained in:
committed by
mukesh agrawal
parent
25197f0f6f
commit
2c5d412af2
@@ -20,9 +20,13 @@
|
||||
|
||||
#include <VtsHalHidlTargetTestBase.h>
|
||||
|
||||
#include "wifi_hidl_call_util.h"
|
||||
#include "wifi_hidl_test_utils.h"
|
||||
|
||||
using ::android::hardware::wifi::V1_0::IfaceType;
|
||||
using ::android::hardware::wifi::V1_0::IWifiApIface;
|
||||
using ::android::hardware::wifi::V1_0::WifiBand;
|
||||
using ::android::hardware::wifi::V1_0::WifiStatusCode;
|
||||
using ::android::sp;
|
||||
|
||||
/**
|
||||
@@ -30,11 +34,15 @@ using ::android::sp;
|
||||
*/
|
||||
class WifiApIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
|
||||
public:
|
||||
virtual void SetUp() override {}
|
||||
virtual void SetUp() override {
|
||||
wifi_ap_iface_ = getWifiApIface();
|
||||
ASSERT_NE(nullptr, wifi_ap_iface_.get());
|
||||
}
|
||||
|
||||
virtual void TearDown() override { stopWifi(); }
|
||||
|
||||
protected:
|
||||
sp<IWifiApIface> wifi_ap_iface_;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -46,3 +54,36 @@ TEST(WifiApIfaceHidlTestNoFixture, Create) {
|
||||
EXPECT_NE(nullptr, getWifiApIface().get());
|
||||
stopWifi();
|
||||
}
|
||||
|
||||
/*
|
||||
* GetType:
|
||||
* Ensures that the correct interface type is returned for AP interface.
|
||||
*/
|
||||
TEST_F(WifiApIfaceHidlTest, GetType) {
|
||||
const auto& status_and_type = HIDL_INVOKE(wifi_ap_iface_, getType);
|
||||
EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_type.first.code);
|
||||
EXPECT_EQ(IfaceType::AP, status_and_type.second);
|
||||
}
|
||||
|
||||
/*
|
||||
* SetCountryCode:
|
||||
* Ensures that a call to set the country code will return with a success
|
||||
* status code.
|
||||
*/
|
||||
TEST_F(WifiApIfaceHidlTest, SetCountryCode) {
|
||||
const android::hardware::hidl_array<int8_t, 2> kCountryCode{
|
||||
std::array<int8_t, 2>{{0x55, 0x53}}};
|
||||
EXPECT_EQ(WifiStatusCode::SUCCESS,
|
||||
HIDL_INVOKE(wifi_ap_iface_, setCountryCode, kCountryCode).code);
|
||||
}
|
||||
|
||||
/*
|
||||
* GetValidFrequenciesForBand:
|
||||
* Ensures that we can retrieve valid frequencies for 2.4 GHz band.
|
||||
*/
|
||||
TEST_F(WifiApIfaceHidlTest, GetValidFrequenciesForBand) {
|
||||
const auto& status_and_freqs = HIDL_INVOKE(
|
||||
wifi_ap_iface_, getValidFrequenciesForBand, WifiBand::BAND_24GHZ);
|
||||
EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_freqs.first.code);
|
||||
EXPECT_GT(status_and_freqs.second.size(), 0u);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user