Loading wifi/hostapd/1.2/vts/functional/Android.bp +6 −3 Original line number Diff line number Diff line Loading @@ -26,11 +26,14 @@ cc_test { "android.hardware.wifi.hostapd@1.0", "android.hardware.wifi.hostapd@1.1", "android.hardware.wifi.hostapd@1.2", "android.hardware.wifi.hostapd@1.3", "android.hardware.wifi@1.0", "libgmock", "libwifi-system", "libwifi-system-iface", ], test_suites: ["general-tests", "vts"], test_suites: [ "general-tests", "vts", ], } wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp +37 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <android/hardware/wifi/1.0/IWifi.h> #include <android/hardware/wifi/hostapd/1.2/IHostapd.h> #include <android/hardware/wifi/hostapd/1.3/IHostapd.h> #include "hostapd_hidl_call_util.h" #include "hostapd_hidl_test_utils.h" Loading Loading @@ -216,12 +217,20 @@ class HostapdHidlTest std::string hostapd_instance_name_; }; bool is_1_3(const sp<IHostapd>& hostapd) { sp<::android::hardware::wifi::hostapd::V1_3::IHostapd> hostapd_1_3 = ::android::hardware::wifi::hostapd::V1_3::IHostapd::castFrom(hostapd); return hostapd_1_3.get() != nullptr; } /** * Adds an access point with PSK network config & ACS enabled. * Access point creation should pass. */ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcs) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -233,6 +242,8 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcs) { */ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndFreqRange) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcsAndFreqRange(), getPskNwParams()); Loading @@ -245,6 +256,8 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndFreqRange) { */ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndInvalidFreqRange) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcsAndInvalidFreqRange(), getPskNwParams()); Loading @@ -257,6 +270,8 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndInvalidFreqRange) { */ TEST_P(HostapdHidlTest, AddOpenAccessPointWithAcs) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcs(), getOpenNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -267,6 +282,8 @@ TEST_P(HostapdHidlTest, AddOpenAccessPointWithAcs) { * Access point creation should pass. */ TEST_P(HostapdHidlTest, AddPskAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -277,6 +294,8 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithoutAcs) { * Access point creation should pass. */ TEST_P(HostapdHidlTest, AddOpenAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getOpenNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -288,6 +307,8 @@ TEST_P(HostapdHidlTest, AddOpenAccessPointWithoutAcs) { */ TEST_P(HostapdHidlTest, AddSaeTransitionAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getSaeTransitionNwParams()); Loading @@ -300,6 +321,8 @@ TEST_P(HostapdHidlTest, AddSaeTransitionAccessPointWithoutAcs) { */ TEST_P(HostapdHidlTest, AddSAEAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getSaeNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -311,6 +334,8 @@ TEST_P(HostapdHidlTest, AddSAEAccessPointWithoutAcs) { */ TEST_P(HostapdHidlTest, RemoveAccessPointWithAcs) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status_1_2 = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status_1_2.code); Loading @@ -326,6 +351,8 @@ TEST_P(HostapdHidlTest, RemoveAccessPointWithAcs) { * Access point creation & removal should pass. */ TEST_P(HostapdHidlTest, RemoveAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status_1_2 = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status_1_2.code); Loading @@ -341,6 +368,8 @@ TEST_P(HostapdHidlTest, RemoveAccessPointWithoutAcs) { * Access point creation should fail. */ TEST_P(HostapdHidlTest, AddPskAccessPointWithInvalidChannel) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithInvalidChannel(), getPskNwParams()); Loading @@ -352,6 +381,8 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithInvalidChannel) { * Access point creation should fail. */ TEST_P(HostapdHidlTest, AddInvalidPskAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getInvalidPskNwParams()); Loading @@ -364,6 +395,8 @@ TEST_P(HostapdHidlTest, AddInvalidPskAccessPointWithoutAcs) { */ TEST_P(HostapdHidlTest, AddInvalidSaeTransitionAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getInvalidSaeTransitionNwParams()); Loading @@ -376,6 +409,8 @@ TEST_P(HostapdHidlTest, AddInvalidSaeTransitionAccessPointWithoutAcs) { */ TEST_P(HostapdHidlTest, AddInvalidSaeAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getInvalidSaeNwParams()); Loading @@ -398,6 +433,8 @@ TEST_P(HostapdHidlTest, DisconnectClientWhenIfaceNotAvailable) { * when hotspot interface available. */ TEST_P(HostapdHidlTest, DisconnectClientWhenIfacAvailable) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status_1_2 = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getOpenNwParams()); Loading Loading
wifi/hostapd/1.2/vts/functional/Android.bp +6 −3 Original line number Diff line number Diff line Loading @@ -26,11 +26,14 @@ cc_test { "android.hardware.wifi.hostapd@1.0", "android.hardware.wifi.hostapd@1.1", "android.hardware.wifi.hostapd@1.2", "android.hardware.wifi.hostapd@1.3", "android.hardware.wifi@1.0", "libgmock", "libwifi-system", "libwifi-system-iface", ], test_suites: ["general-tests", "vts"], test_suites: [ "general-tests", "vts", ], }
wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp +37 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <android/hardware/wifi/1.0/IWifi.h> #include <android/hardware/wifi/hostapd/1.2/IHostapd.h> #include <android/hardware/wifi/hostapd/1.3/IHostapd.h> #include "hostapd_hidl_call_util.h" #include "hostapd_hidl_test_utils.h" Loading Loading @@ -216,12 +217,20 @@ class HostapdHidlTest std::string hostapd_instance_name_; }; bool is_1_3(const sp<IHostapd>& hostapd) { sp<::android::hardware::wifi::hostapd::V1_3::IHostapd> hostapd_1_3 = ::android::hardware::wifi::hostapd::V1_3::IHostapd::castFrom(hostapd); return hostapd_1_3.get() != nullptr; } /** * Adds an access point with PSK network config & ACS enabled. * Access point creation should pass. */ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcs) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -233,6 +242,8 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcs) { */ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndFreqRange) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcsAndFreqRange(), getPskNwParams()); Loading @@ -245,6 +256,8 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndFreqRange) { */ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndInvalidFreqRange) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcsAndInvalidFreqRange(), getPskNwParams()); Loading @@ -257,6 +270,8 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndInvalidFreqRange) { */ TEST_P(HostapdHidlTest, AddOpenAccessPointWithAcs) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcs(), getOpenNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -267,6 +282,8 @@ TEST_P(HostapdHidlTest, AddOpenAccessPointWithAcs) { * Access point creation should pass. */ TEST_P(HostapdHidlTest, AddPskAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -277,6 +294,8 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithoutAcs) { * Access point creation should pass. */ TEST_P(HostapdHidlTest, AddOpenAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getOpenNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -288,6 +307,8 @@ TEST_P(HostapdHidlTest, AddOpenAccessPointWithoutAcs) { */ TEST_P(HostapdHidlTest, AddSaeTransitionAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getSaeTransitionNwParams()); Loading @@ -300,6 +321,8 @@ TEST_P(HostapdHidlTest, AddSaeTransitionAccessPointWithoutAcs) { */ TEST_P(HostapdHidlTest, AddSAEAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getSaeNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -311,6 +334,8 @@ TEST_P(HostapdHidlTest, AddSAEAccessPointWithoutAcs) { */ TEST_P(HostapdHidlTest, RemoveAccessPointWithAcs) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status_1_2 = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status_1_2.code); Loading @@ -326,6 +351,8 @@ TEST_P(HostapdHidlTest, RemoveAccessPointWithAcs) { * Access point creation & removal should pass. */ TEST_P(HostapdHidlTest, RemoveAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status_1_2 = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status_1_2.code); Loading @@ -341,6 +368,8 @@ TEST_P(HostapdHidlTest, RemoveAccessPointWithoutAcs) { * Access point creation should fail. */ TEST_P(HostapdHidlTest, AddPskAccessPointWithInvalidChannel) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithInvalidChannel(), getPskNwParams()); Loading @@ -352,6 +381,8 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithInvalidChannel) { * Access point creation should fail. */ TEST_P(HostapdHidlTest, AddInvalidPskAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getInvalidPskNwParams()); Loading @@ -364,6 +395,8 @@ TEST_P(HostapdHidlTest, AddInvalidPskAccessPointWithoutAcs) { */ TEST_P(HostapdHidlTest, AddInvalidSaeTransitionAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getInvalidSaeTransitionNwParams()); Loading @@ -376,6 +409,8 @@ TEST_P(HostapdHidlTest, AddInvalidSaeTransitionAccessPointWithoutAcs) { */ TEST_P(HostapdHidlTest, AddInvalidSaeAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getInvalidSaeNwParams()); Loading @@ -398,6 +433,8 @@ TEST_P(HostapdHidlTest, DisconnectClientWhenIfaceNotAvailable) { * when hotspot interface available. */ TEST_P(HostapdHidlTest, DisconnectClientWhenIfacAvailable) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; auto status_1_2 = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(), getOpenNwParams()); Loading