From 3fd567437c093ed4c7fa06d0bec1c622f5b00416 Mon Sep 17 00:00:00 2001 From: sangyun Date: Wed, 24 Jan 2024 13:40:54 +0900 Subject: [PATCH] Allows to skip old tests for new networks. If the getDataRegistrationState interface is tested on a new RAT (e.g. 5g) that was not supported in this version, this allows the test to be skipped for newer networks. Bug: 303672201 Test: atest VtsHalRadioV1_0TargetTest:PerInstance/RadioHidlTest Change-Id: I1bbaefd1f1f41bb4b46fb515e5a1bc6b80153c74 --- radio/1.0/vts/functional/radio_hidl_hal_data.cpp | 8 +++++++- radio/1.2/vts/functional/radio_hidl_hal_api.cpp | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp index 38cb33b07e..e89f4ee5df 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp @@ -16,6 +16,7 @@ #include #include +#include #include using namespace ::android::hardware::radio::V1_0; @@ -72,11 +73,16 @@ TEST_P(RadioHidlTest, getDataRegistrationState) { CellIdentityTdscdma cit = cellIdentities.cellIdentityTdscdma[0]; hidl_mcc = cit.mcc; hidl_mnc = cit.mnc; - } else { + } else if (cellInfoType == CellInfoType::CDMA) { // CellIndentityCdma has no mcc and mnc. EXPECT_EQ(CellInfoType::CDMA, cellInfoType); EXPECT_EQ(1, cellIdentities.cellIdentityCdma.size()); checkMccMnc = false; + } else { + // This test can be skipped for newer networks if a new RAT (e.g. 5g) that was not + // supported in this version is added to the response from a modem that supports a new + // version of this interface. + GTEST_SKIP() << "Exempt from 1.0 test: camped on a new network:" << (int)cellInfoType; } // Check only one CellIdentity is size 1, and others must be 0. diff --git a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp index 2bce2f957b..51ca96734f 100644 --- a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp @@ -807,11 +807,16 @@ TEST_P(RadioHidlTest_v1_2, getDataRegistrationState) { cellIdentities.cellIdentityTdscdma[0]; hidl_mcc = cit.base.mcc; hidl_mnc = cit.base.mnc; - } else { + } else if (cellInfoType == CellInfoType::CDMA) { // CellIndentityCdma has no mcc and mnc. EXPECT_EQ(CellInfoType::CDMA, cellInfoType); EXPECT_EQ(1, cellIdentities.cellIdentityCdma.size()); checkMccMnc = false; + } else { + // This test can be skipped for newer networks if a new RAT (e.g. 5g) that was not + // supported in this version is added to the response from a modem that supports a new + // version of this interface. + GTEST_SKIP() << "Exempt from 1.2 test: camped on a new network:" << (int)cellInfoType; } // Check only one CellIdentity is size 1, and others must be 0.