Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37e87429 authored by Ningyuan Wang's avatar Ningyuan Wang
Browse files

Add VTS tests for wps related APIs in ISupplicantIface

This covers the following APIs by adding tests to
ISupplicantStaIface and ISupplicantP2pIface:
ISupplicantIface::setWpsDeviceName(),
ISupplicantIface::setWpsDeviceType(),
ISupplicantIface::setWpsManufacturer(),
ISupplicantIface::setWpsModelName(),
ISupplicantIface::setWpsModelNumber(),
ISupplicantIface::setWpsSerialNumber(),
ISupplicantIface::setWpsConfigMethods()

Bug: 33457575
Test: VTS tests pass

Change-Id: I0adf6b81ed6da8b1dead9dfa09c778acf4f03a8c
parent 61d3d5ee
Loading
Loading
Loading
Loading
+70 −0
Original line number Original line Diff line number Diff line
@@ -42,6 +42,13 @@ constexpr uint8_t kTestMacAddr[] = {0x56, 0x67, 0x67, 0xf4, 0x56, 0x92};
constexpr uint8_t kTestPeerMacAddr[] = {0x56, 0x67, 0x55, 0xf4, 0x56, 0x92};
constexpr uint8_t kTestPeerMacAddr[] = {0x56, 0x67, 0x55, 0xf4, 0x56, 0x92};
constexpr char kTestConnectPin[] = "34556665";
constexpr char kTestConnectPin[] = "34556665";
constexpr char kTestGroupIfName[] = "TestGroup";
constexpr char kTestGroupIfName[] = "TestGroup";
constexpr char kTestWpsDeviceName[] = "TestWpsDeviceName";
constexpr char kTestWpsManufacturer[] = "TestManufacturer";
constexpr char kTestWpsModelName[] = "TestModelName";
constexpr char kTestWpsModelNumber[] = "TestModelNumber";
constexpr char kTestWpsSerialNumber[] = "TestSerialNumber";
constexpr uint8_t kTestWpsDeviceType[] = {[0 ... 7] = 0x01};
constexpr uint16_t kTestWpsConfigMethods = 0xffff;
constexpr uint32_t kTestConnectGoIntent = 6;
constexpr uint32_t kTestConnectGoIntent = 6;
constexpr uint32_t kTestFindTimeout = 5;
constexpr uint32_t kTestFindTimeout = 5;
constexpr uint32_t kTestSetGroupIdleTimeout = 6;
constexpr uint32_t kTestSetGroupIdleTimeout = 6;
@@ -464,3 +471,66 @@ TEST_F(SupplicantP2pIfaceHidlTest, SetPowerSave) {
        SupplicantStatusCode::SUCCESS,
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(p2p_iface_, setPowerSave, kTestGroupIfName, false).code);
        HIDL_INVOKE(p2p_iface_, setPowerSave, kTestGroupIfName, false).code);
}
}

/*
 * SetWpsDeviceName
 */
TEST_F(SupplicantP2pIfaceHidlTest, SetWpsDeviceName) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(p2p_iface_, setWpsDeviceName, kTestWpsDeviceName).code);
}

/*
 * SetWpsDeviceType
 */
TEST_F(SupplicantP2pIfaceHidlTest, SetWpsDeviceType) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(p2p_iface_, setWpsDeviceType, kTestWpsDeviceType).code);
}

/*
 * SetWpsManufacturer
 */
TEST_F(SupplicantP2pIfaceHidlTest, SetWpsManufacturer) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(p2p_iface_, setWpsManufacturer, kTestWpsManufacturer).code);
}

/*
 * SetWpsModelName
 */
TEST_F(SupplicantP2pIfaceHidlTest, SetWpsModelName) {
    EXPECT_EQ(SupplicantStatusCode::SUCCESS,
              HIDL_INVOKE(p2p_iface_, setWpsModelName, kTestWpsModelName).code);
}

/*
 * SetWpsModelNumber
 */
TEST_F(SupplicantP2pIfaceHidlTest, SetWpsModelNumber) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(p2p_iface_, setWpsModelNumber, kTestWpsModelNumber).code);
}

/*
 * SetWpsSerialNumber
 */
TEST_F(SupplicantP2pIfaceHidlTest, SetWpsSerialNumber) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(p2p_iface_, setWpsSerialNumber, kTestWpsSerialNumber).code);
}

/*
 * SetWpsConfigMethods
 */
TEST_F(SupplicantP2pIfaceHidlTest, SetWpsConfigMethods) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(p2p_iface_, setWpsConfigMethods, kTestWpsConfigMethods)
            .code);
}
+70 −0
Original line number Original line Diff line number Diff line
@@ -47,11 +47,18 @@ constexpr ISupplicantStaIface::Hs20AnqpSubtypes kTestHs20Types[] = {
    ISupplicantStaIface::Hs20AnqpSubtypes::WAN_METRICS,
    ISupplicantStaIface::Hs20AnqpSubtypes::WAN_METRICS,
    ISupplicantStaIface::Hs20AnqpSubtypes::OPERATOR_FRIENDLY_NAME};
    ISupplicantStaIface::Hs20AnqpSubtypes::OPERATOR_FRIENDLY_NAME};
constexpr char kTestHs20IconFile[] = "TestFile";
constexpr char kTestHs20IconFile[] = "TestFile";
constexpr char kTestWpsDeviceName[] = "TestWpsDeviceName";
constexpr char kTestWpsManufacturer[] = "TestManufacturer";
constexpr char kTestWpsModelName[] = "TestModelName";
constexpr char kTestWpsModelNumber[] = "TestModelNumber";
constexpr char kTestWpsSerialNumber[] = "TestSerialNumber";
constexpr char kTestRadioWorkName[] = "TestRadioWork";
constexpr char kTestRadioWorkName[] = "TestRadioWork";
constexpr uint32_t kTestRadioWorkFrequency = 2412;
constexpr uint32_t kTestRadioWorkFrequency = 2412;
constexpr uint32_t kTestRadioWorkTimeout = 8;
constexpr uint32_t kTestRadioWorkTimeout = 8;
constexpr uint32_t kTestRadioWorkId = 16;
constexpr uint32_t kTestRadioWorkId = 16;
constexpr int8_t kTestCountryCode[] = {'U', 'S'};
constexpr int8_t kTestCountryCode[] = {'U', 'S'};
constexpr uint8_t kTestWpsDeviceType[] = {[0 ... 7] = 0x01};
constexpr uint16_t kTestWpsConfigMethods = 0xffff;
}  // namespace
}  // namespace


class SupplicantStaIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
class SupplicantStaIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
@@ -432,6 +439,69 @@ TEST_F(SupplicantStaIfaceHidlTest, SetCountryCode) {
        });
        });
}
}


/*
 * SetWpsDeviceName
 */
TEST_F(SupplicantStaIfaceHidlTest, SetWpsDeviceName) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(sta_iface_, setWpsDeviceName, kTestWpsDeviceName).code);
}

/*
 * SetWpsDeviceType
 */
TEST_F(SupplicantStaIfaceHidlTest, SetWpsDeviceType) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(sta_iface_, setWpsDeviceType, kTestWpsDeviceType).code);
}

/*
 * SetWpsManufacturer
 */
TEST_F(SupplicantStaIfaceHidlTest, SetWpsManufacturer) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(sta_iface_, setWpsManufacturer, kTestWpsManufacturer).code);
}

/*
 * SetWpsModelName
 */
TEST_F(SupplicantStaIfaceHidlTest, SetWpsModelName) {
    EXPECT_EQ(SupplicantStatusCode::SUCCESS,
              HIDL_INVOKE(sta_iface_, setWpsModelName, kTestWpsModelName).code);
}

/*
 * SetWpsModelNumber
 */
TEST_F(SupplicantStaIfaceHidlTest, SetWpsModelNumber) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(sta_iface_, setWpsModelNumber, kTestWpsModelNumber).code);
}

/*
 * SetWpsSerialNumber
 */
TEST_F(SupplicantStaIfaceHidlTest, SetWpsSerialNumber) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(sta_iface_, setWpsSerialNumber, kTestWpsSerialNumber).code);
}

/*
 * SetWpsConfigMethods
 */
TEST_F(SupplicantStaIfaceHidlTest, SetWpsConfigMethods) {
    EXPECT_EQ(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(sta_iface_, setWpsConfigMethods, kTestWpsConfigMethods)
            .code);
}

/*
/*
 * SetExternalSim
 * SetExternalSim
 */
 */