Skip AP and P2P tests in wifi_chip_aidl_test

if those iface types cannot be created.

Bug: 297959416
Test: atest VtsHalWifiChipTargetTest
Change-Id: I917be24bb46b74fe3fb9d08e8af099b782e19469
This commit is contained in:
Gabriel Biren
2023-09-11 17:15:28 +00:00
parent 70b126cd25
commit e8e161e255

View File

@@ -63,6 +63,10 @@ class WifiChipAidlTest : public testing::TestWithParam<std::string> {
return mode_id;
}
bool isConcurrencyTypeSupported(IfaceConcurrencyType type) {
return doesChipSupportConcurrencyType(wifi_chip_, type);
}
std::shared_ptr<IWifiStaIface> configureChipForStaAndGetIface() {
std::shared_ptr<IWifiStaIface> iface;
configureChipForConcurrencyType(IfaceConcurrencyType::STA);
@@ -532,6 +536,9 @@ TEST_P(WifiChipAidlTest, CreateStaIface) {
* CreateApIface
*/
TEST_P(WifiChipAidlTest, CreateApIface) {
if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) {
GTEST_SKIP() << "AP is not supported";
}
configureChipForApAndGetIface();
}
@@ -549,6 +556,9 @@ TEST_P(WifiChipAidlTest, CreateNanIface) {
* CreateP2pIface
*/
TEST_P(WifiChipAidlTest, CreateP2pIface) {
if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) {
GTEST_SKIP() << "P2P is not supported";
}
configureChipForP2pAndGetIface();
}
@@ -583,6 +593,9 @@ TEST_P(WifiChipAidlTest, GetStaIfaceNames) {
* GetP2pIfaceNames
*/
TEST_P(WifiChipAidlTest, GetP2pIfaceNames) {
if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) {
GTEST_SKIP() << "P2P is not supported";
}
configureChipForConcurrencyType(IfaceConcurrencyType::P2P);
std::vector<std::string> iface_names;
@@ -607,6 +620,9 @@ TEST_P(WifiChipAidlTest, GetP2pIfaceNames) {
* GetApIfaceNames
*/
TEST_P(WifiChipAidlTest, GetApIfaceNames) {
if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) {
GTEST_SKIP() << "AP is not supported";
}
configureChipForConcurrencyType(IfaceConcurrencyType::AP);
std::vector<std::string> iface_names;
@@ -679,6 +695,9 @@ TEST_P(WifiChipAidlTest, GetStaIface) {
* GetP2pIface
*/
TEST_P(WifiChipAidlTest, GetP2pIface) {
if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) {
GTEST_SKIP() << "P2P is not supported";
}
std::shared_ptr<IWifiP2pIface> iface = configureChipForP2pAndGetIface();
std::string iface_name = getP2pIfaceName(iface);
@@ -697,6 +716,9 @@ TEST_P(WifiChipAidlTest, GetP2pIface) {
* GetApIface
*/
TEST_P(WifiChipAidlTest, GetApIface) {
if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) {
GTEST_SKIP() << "AP is not supported";
}
std::shared_ptr<IWifiApIface> iface = configureChipForApAndGetIface();
std::string iface_name = getApIfaceName(iface);
@@ -755,6 +777,9 @@ TEST_P(WifiChipAidlTest, RemoveStaIface) {
* RemoveP2pIface
*/
TEST_P(WifiChipAidlTest, RemoveP2pIface) {
if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) {
GTEST_SKIP() << "P2P is not supported";
}
std::shared_ptr<IWifiP2pIface> iface = configureChipForP2pAndGetIface();
std::string iface_name = getP2pIfaceName(iface);
@@ -771,6 +796,9 @@ TEST_P(WifiChipAidlTest, RemoveP2pIface) {
* RemoveApIface
*/
TEST_P(WifiChipAidlTest, RemoveApIface) {
if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) {
GTEST_SKIP() << "AP is not supported";
}
std::shared_ptr<IWifiApIface> iface = configureChipForApAndGetIface();
std::string iface_name = getApIfaceName(iface);