Loading wifi/hostapd/1.0/vts/functional/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ cc_library_static { static_libs: [ "VtsHalWifiV1_0TargetTestUtil", "android.hardware.wifi.hostapd@1.0", "android.hardware.wifi.hostapd@1.1", "android.hardware.wifi@1.0", "libcrypto", "libgmock", Loading @@ -43,6 +44,7 @@ cc_test { "VtsHalWifiV1_0TargetTestUtil", "VtsHalWifiHostapdV1_0TargetTestUtil", "android.hardware.wifi.hostapd@1.0", "android.hardware.wifi.hostapd@1.1", "android.hardware.wifi@1.0", "libcrypto", "libgmock", Loading wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp +49 −32 Original line number Diff line number Diff line Loading @@ -138,59 +138,71 @@ TEST(HostapdHidlTestNoFixture, Create) { * Access point creation should pass. */ TEST_F(HostapdHidlTest, AddPskAccessPointWithAcs) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getPskNwParams()); if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds an access point with Open network config & ACS enabled. * Access point creation should pass. */ TEST_F(HostapdHidlTest, AddOpenAccessPointWithAcs) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getOpenNwParams()); if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getOpenNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds an access point with PSK network config & ACS disabled. * Access point creation should pass. */ TEST_F(HostapdHidlTest, AddPskAccessPointWithoutAcs) { if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds an access point with Open network config & ACS disabled. * Access point creation should pass. */ TEST_F(HostapdHidlTest, AddOpenAccessPointWithoutAcs) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(), getOpenNwParams()); if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(), getOpenNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds & then removes an access point with PSK network config & ACS enabled. * Access point creation & removal should pass. */ TEST_F(HostapdHidlTest, RemoveAccessPointWithAcs) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getPskNwParams()); if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); status = HIDL_INVOKE(hostapd_, removeAccessPoint, getPrimaryWlanIfaceName()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds & then removes an access point with PSK network config & ACS disabled. * Access point creation & removal should pass. */ TEST_F(HostapdHidlTest, RemoveAccessPointWithoutAcs) { if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -198,28 +210,33 @@ TEST_F(HostapdHidlTest, RemoveAccessPointWithoutAcs) { HIDL_INVOKE(hostapd_, removeAccessPoint, getPrimaryWlanIfaceName()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds an access point with invalid channel. * Access point creation should fail. */ TEST_F(HostapdHidlTest, AddPskAccessPointWithInvalidChannel) { if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithInvalidChannel(), getPskNwParams()); EXPECT_NE(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds an access point with invalid PSK network config. * Access point creation should fail. */ TEST_F(HostapdHidlTest, AddInvalidPskAccessPointWithoutAcs) { if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(), getInvalidPskNwParams()); EXPECT_NE(HostapdStatusCode::SUCCESS, status.code); } } /* * Terminate Loading wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,12 @@ void startHostapdAndWaitForHidlService() { ASSERT_TRUE(notification_listener->waitForHidlService(200, service_name)); } bool is_1_1(const sp<IHostapd>& hostapd) { sp<::android::hardware::wifi::hostapd::V1_1::IHostapd> hostapd_1_1 = ::android::hardware::wifi::hostapd::V1_1::IHostapd::castFrom(hostapd); return hostapd_1_1.get() != nullptr; } sp<IHostapd> getHostapd() { return ::testing::VtsHalHidlTargetTestBase::getService<IHostapd>( gEnv->getServiceName<IHostapd>()); Loading wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.h +3 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define HOSTAPD_HIDL_TEST_UTILS_H #include <android/hardware/wifi/hostapd/1.0/IHostapd.h> #include <android/hardware/wifi/hostapd/1.1/IHostapd.h> #include <VtsHalHidlTargetTestEnvBase.h> Loading @@ -34,6 +35,8 @@ void startHostapdAndWaitForHidlService(); // These helper functions should be modified to return vectors if we support // multiple instances. android::sp<android::hardware::wifi::hostapd::V1_0::IHostapd> getHostapd(); bool is_1_1(const android::sp<android::hardware::wifi::hostapd::V1_0::IHostapd>& hostapd); class WifiHostapdHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase { Loading Loading
wifi/hostapd/1.0/vts/functional/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ cc_library_static { static_libs: [ "VtsHalWifiV1_0TargetTestUtil", "android.hardware.wifi.hostapd@1.0", "android.hardware.wifi.hostapd@1.1", "android.hardware.wifi@1.0", "libcrypto", "libgmock", Loading @@ -43,6 +44,7 @@ cc_test { "VtsHalWifiV1_0TargetTestUtil", "VtsHalWifiHostapdV1_0TargetTestUtil", "android.hardware.wifi.hostapd@1.0", "android.hardware.wifi.hostapd@1.1", "android.hardware.wifi@1.0", "libcrypto", "libgmock", Loading
wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp +49 −32 Original line number Diff line number Diff line Loading @@ -138,59 +138,71 @@ TEST(HostapdHidlTestNoFixture, Create) { * Access point creation should pass. */ TEST_F(HostapdHidlTest, AddPskAccessPointWithAcs) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getPskNwParams()); if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds an access point with Open network config & ACS enabled. * Access point creation should pass. */ TEST_F(HostapdHidlTest, AddOpenAccessPointWithAcs) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getOpenNwParams()); if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getOpenNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds an access point with PSK network config & ACS disabled. * Access point creation should pass. */ TEST_F(HostapdHidlTest, AddPskAccessPointWithoutAcs) { if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds an access point with Open network config & ACS disabled. * Access point creation should pass. */ TEST_F(HostapdHidlTest, AddOpenAccessPointWithoutAcs) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(), getOpenNwParams()); if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(), getOpenNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds & then removes an access point with PSK network config & ACS enabled. * Access point creation & removal should pass. */ TEST_F(HostapdHidlTest, RemoveAccessPointWithAcs) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getPskNwParams()); if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); status = HIDL_INVOKE(hostapd_, removeAccessPoint, getPrimaryWlanIfaceName()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds & then removes an access point with PSK network config & ACS disabled. * Access point creation & removal should pass. */ TEST_F(HostapdHidlTest, RemoveAccessPointWithoutAcs) { if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); Loading @@ -198,28 +210,33 @@ TEST_F(HostapdHidlTest, RemoveAccessPointWithoutAcs) { HIDL_INVOKE(hostapd_, removeAccessPoint, getPrimaryWlanIfaceName()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds an access point with invalid channel. * Access point creation should fail. */ TEST_F(HostapdHidlTest, AddPskAccessPointWithInvalidChannel) { if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithInvalidChannel(), getPskNwParams()); EXPECT_NE(HostapdStatusCode::SUCCESS, status.code); } } /** * Adds an access point with invalid PSK network config. * Access point creation should fail. */ TEST_F(HostapdHidlTest, AddInvalidPskAccessPointWithoutAcs) { if (!is_1_1(hostapd_)) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(), getInvalidPskNwParams()); EXPECT_NE(HostapdStatusCode::SUCCESS, status.code); } } /* * Terminate Loading
wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,12 @@ void startHostapdAndWaitForHidlService() { ASSERT_TRUE(notification_listener->waitForHidlService(200, service_name)); } bool is_1_1(const sp<IHostapd>& hostapd) { sp<::android::hardware::wifi::hostapd::V1_1::IHostapd> hostapd_1_1 = ::android::hardware::wifi::hostapd::V1_1::IHostapd::castFrom(hostapd); return hostapd_1_1.get() != nullptr; } sp<IHostapd> getHostapd() { return ::testing::VtsHalHidlTargetTestBase::getService<IHostapd>( gEnv->getServiceName<IHostapd>()); Loading
wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.h +3 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define HOSTAPD_HIDL_TEST_UTILS_H #include <android/hardware/wifi/hostapd/1.0/IHostapd.h> #include <android/hardware/wifi/hostapd/1.1/IHostapd.h> #include <VtsHalHidlTargetTestEnvBase.h> Loading @@ -34,6 +35,8 @@ void startHostapdAndWaitForHidlService(); // These helper functions should be modified to return vectors if we support // multiple instances. android::sp<android::hardware::wifi::hostapd::V1_0::IHostapd> getHostapd(); bool is_1_1(const android::sp<android::hardware::wifi::hostapd::V1_0::IHostapd>& hostapd); class WifiHostapdHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase { Loading