summaryrefslogtreecommitdiff
path: root/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp')
-rw-r--r--wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp82
1 files changed, 50 insertions, 32 deletions
diff --git a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp
index 504f4c8d2b..6dc9eb4be7 100644
--- a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp
+++ b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp
@@ -41,6 +41,7 @@ constexpr int kIfaceInvalidChannel = 567;
class HostapdHidlTest : public ::testing::VtsHalHidlTargetTestBase {
public:
virtual void SetUp() override {
+ stopSupplicantIfNeeded();
startHostapdAndWaitForHidlService();
hostapd_ = getHostapd();
ASSERT_NE(hostapd_.get(), nullptr);
@@ -138,9 +139,11 @@ TEST(HostapdHidlTestNoFixture, Create) {
* Access point creation should pass.
*/
TEST_F(HostapdHidlTest, AddPskAccessPointWithAcs) {
- auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(),
- getPskNwParams());
- EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ if (!is_1_1(hostapd_)) {
+ auto status = HIDL_INVOKE(hostapd_, addAccessPoint,
+ getIfaceParamsWithAcs(), getPskNwParams());
+ EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ }
}
/**
@@ -148,9 +151,11 @@ TEST_F(HostapdHidlTest, AddPskAccessPointWithAcs) {
* Access point creation should pass.
*/
TEST_F(HostapdHidlTest, AddOpenAccessPointWithAcs) {
- auto status = HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithAcs(),
- getOpenNwParams());
- EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ if (!is_1_1(hostapd_)) {
+ auto status = HIDL_INVOKE(hostapd_, addAccessPoint,
+ getIfaceParamsWithAcs(), getOpenNwParams());
+ EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ }
}
/**
@@ -158,9 +163,11 @@ TEST_F(HostapdHidlTest, AddOpenAccessPointWithAcs) {
* Access point creation should pass.
*/
TEST_F(HostapdHidlTest, AddPskAccessPointWithoutAcs) {
- auto status = HIDL_INVOKE(hostapd_, addAccessPoint,
- getIfaceParamsWithoutAcs(), getPskNwParams());
- EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ if (!is_1_1(hostapd_)) {
+ auto status = HIDL_INVOKE(hostapd_, addAccessPoint,
+ getIfaceParamsWithoutAcs(), getPskNwParams());
+ EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ }
}
/**
@@ -168,9 +175,12 @@ TEST_F(HostapdHidlTest, AddPskAccessPointWithoutAcs) {
* Access point creation should pass.
*/
TEST_F(HostapdHidlTest, AddOpenAccessPointWithoutAcs) {
- auto status = HIDL_INVOKE(hostapd_, addAccessPoint,
- getIfaceParamsWithoutAcs(), getOpenNwParams());
- EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ if (!is_1_1(hostapd_)) {
+ auto status =
+ HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(),
+ getOpenNwParams());
+ EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ }
}
/**
@@ -178,12 +188,14 @@ TEST_F(HostapdHidlTest, AddOpenAccessPointWithoutAcs) {
* Access point creation & removal should pass.
*/
TEST_F(HostapdHidlTest, RemoveAccessPointWithAcs) {
- 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);
+ 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);
+ }
}
/**
@@ -191,12 +203,14 @@ TEST_F(HostapdHidlTest, RemoveAccessPointWithAcs) {
* Access point creation & removal should pass.
*/
TEST_F(HostapdHidlTest, RemoveAccessPointWithoutAcs) {
- auto status = HIDL_INVOKE(hostapd_, addAccessPoint,
- getIfaceParamsWithoutAcs(), getPskNwParams());
- EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
- status =
- HIDL_INVOKE(hostapd_, removeAccessPoint, getPrimaryWlanIfaceName());
- EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ if (!is_1_1(hostapd_)) {
+ auto status = HIDL_INVOKE(hostapd_, addAccessPoint,
+ getIfaceParamsWithoutAcs(), getPskNwParams());
+ EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ status =
+ HIDL_INVOKE(hostapd_, removeAccessPoint, getPrimaryWlanIfaceName());
+ EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+ }
}
/**
@@ -204,10 +218,12 @@ TEST_F(HostapdHidlTest, RemoveAccessPointWithoutAcs) {
* Access point creation should fail.
*/
TEST_F(HostapdHidlTest, AddPskAccessPointWithInvalidChannel) {
- auto status =
- HIDL_INVOKE(hostapd_, addAccessPoint,
- getIfaceParamsWithInvalidChannel(), getPskNwParams());
- EXPECT_NE(HostapdStatusCode::SUCCESS, status.code);
+ if (!is_1_1(hostapd_)) {
+ auto status =
+ HIDL_INVOKE(hostapd_, addAccessPoint,
+ getIfaceParamsWithInvalidChannel(), getPskNwParams());
+ EXPECT_NE(HostapdStatusCode::SUCCESS, status.code);
+ }
}
/**
@@ -215,10 +231,12 @@ TEST_F(HostapdHidlTest, AddPskAccessPointWithInvalidChannel) {
* Access point creation should fail.
*/
TEST_F(HostapdHidlTest, AddInvalidPskAccessPointWithoutAcs) {
- auto status =
- HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(),
- getInvalidPskNwParams());
- EXPECT_NE(HostapdStatusCode::SUCCESS, status.code);
+ if (!is_1_1(hostapd_)) {
+ auto status =
+ HIDL_INVOKE(hostapd_, addAccessPoint, getIfaceParamsWithoutAcs(),
+ getInvalidPskNwParams());
+ EXPECT_NE(HostapdStatusCode::SUCCESS, status.code);
+ }
}
/*