mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 22:04:26 +00:00
Added VTS tests for setDataProfile and setInitialAttachApn am: 7885653276
am: cefbec0e9b
Change-Id: I9b3b6541878bf0e058b6dd8343efb7dc08ef40e8
This commit is contained in:
@@ -676,3 +676,85 @@ TEST_F(RadioHidlTest_v1_4, setAllowedCarriers_1_4) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(RadioHidlTest_v1_4, setDataProfile_1_4) {
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
// Create a dataProfileInfo
|
||||
android::hardware::radio::V1_4::DataProfileInfo dataProfileInfo;
|
||||
memset(&dataProfileInfo, 0, sizeof(dataProfileInfo));
|
||||
dataProfileInfo.profileId = DataProfileId::DEFAULT;
|
||||
dataProfileInfo.apn = hidl_string("internet");
|
||||
dataProfileInfo.protocol = PdpProtocolType::IPV4V6;
|
||||
dataProfileInfo.roamingProtocol = PdpProtocolType::IPV4V6;
|
||||
dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP;
|
||||
dataProfileInfo.user = hidl_string("username");
|
||||
dataProfileInfo.password = hidl_string("password");
|
||||
dataProfileInfo.type = DataProfileInfoType::THREE_GPP;
|
||||
dataProfileInfo.maxConnsTime = 300;
|
||||
dataProfileInfo.maxConns = 20;
|
||||
dataProfileInfo.waitTime = 0;
|
||||
dataProfileInfo.enabled = true;
|
||||
dataProfileInfo.supportedApnTypesBitmap = 320;
|
||||
dataProfileInfo.bearerBitmap = 161543;
|
||||
dataProfileInfo.mtu = 0;
|
||||
dataProfileInfo.preferred = true;
|
||||
dataProfileInfo.persistent = true;
|
||||
|
||||
// Create a dataProfileInfoList
|
||||
android::hardware::hidl_vec<android::hardware::radio::V1_4::DataProfileInfo>
|
||||
dataProfileInfoList = {dataProfileInfo};
|
||||
|
||||
radio_v1_4->setDataProfile_1_4(serial, dataProfileInfoList);
|
||||
|
||||
EXPECT_EQ(std::cv_status::no_timeout, wait());
|
||||
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_4->rspInfo.type);
|
||||
EXPECT_EQ(serial, radioRsp_v1_4->rspInfo.serial);
|
||||
|
||||
if (cardStatus.base.base.cardState == CardState::ABSENT) {
|
||||
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_4->rspInfo.error,
|
||||
{RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE}));
|
||||
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
|
||||
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_4->rspInfo.error,
|
||||
{RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE}));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(RadioHidlTest_v1_4, setInitialAttachApn_1_4) {
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
// Create a dataProfileInfo
|
||||
android::hardware::radio::V1_4::DataProfileInfo dataProfileInfo;
|
||||
memset(&dataProfileInfo, 0, sizeof(dataProfileInfo));
|
||||
dataProfileInfo.profileId = DataProfileId::DEFAULT;
|
||||
dataProfileInfo.apn = hidl_string("internet");
|
||||
dataProfileInfo.protocol = PdpProtocolType::IPV4V6;
|
||||
dataProfileInfo.roamingProtocol = PdpProtocolType::IPV4V6;
|
||||
dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP;
|
||||
dataProfileInfo.user = hidl_string("username");
|
||||
dataProfileInfo.password = hidl_string("password");
|
||||
dataProfileInfo.type = DataProfileInfoType::THREE_GPP;
|
||||
dataProfileInfo.maxConnsTime = 300;
|
||||
dataProfileInfo.maxConns = 20;
|
||||
dataProfileInfo.waitTime = 0;
|
||||
dataProfileInfo.enabled = true;
|
||||
dataProfileInfo.supportedApnTypesBitmap = 320;
|
||||
dataProfileInfo.bearerBitmap = 161543;
|
||||
dataProfileInfo.mtu = 0;
|
||||
dataProfileInfo.preferred = true;
|
||||
dataProfileInfo.persistent = false;
|
||||
|
||||
radio_v1_4->setInitialAttachApn_1_4(serial, dataProfileInfo);
|
||||
|
||||
EXPECT_EQ(std::cv_status::no_timeout, wait());
|
||||
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_4->rspInfo.type);
|
||||
EXPECT_EQ(serial, radioRsp_v1_4->rspInfo.serial);
|
||||
|
||||
if (cardStatus.base.base.cardState == CardState::ABSENT) {
|
||||
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_4->rspInfo.error,
|
||||
{RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE}));
|
||||
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
|
||||
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_4->rspInfo.error,
|
||||
{RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user