Merge changes Ia3b96e83,I80d924cc into pie-vts-dev
* changes:
Add REQUEST_NOT_SUPPORTED for pin and pin2 Icc VTS
Add SIM_PUK2 for Icc VTS tests
diff --git a/audio/common/all-versions/test/utility/include/utility/ValidateXml.h b/audio/common/all-versions/test/utility/include/utility/ValidateXml.h
index 95080d1..91adfc1 100644
--- a/audio/common/all-versions/test/utility/include/utility/ValidateXml.h
+++ b/audio/common/all-versions/test/utility/include/utility/ValidateXml.h
@@ -45,29 +45,37 @@
xmlFilePath, xsdFilePath)
/** Validate an XML according to an xsd.
- * The XML file must be in at least one of the provided locations.
- * If multiple are found, all are validated.
+ * All file named xmlFileName in each xmlFileLocations folder must be valid if present.
+ * @tparam atLeastOneRequired If true, at least one file has to be found.
+ * If false, no found file is a success.
*/
+template <bool atLeastOneRequired = true>
::testing::AssertionResult validateXmlMultipleLocations(
const char* xmlFileNameExpr, const char* xmlFileLocationsExpr, const char* xsdFilePathExpr,
const char* xmlFileName, std::vector<const char*> xmlFileLocations, const char* xsdFilePath);
-/** ASSERT that an XML is valid according to an xsd.
- * The XML file must be in at least one of the provided locations.
- * If multiple are found, all are validated.
- */
-#define ASSERT_ONE_VALID_XML_MULTIPLE_LOCATIONS(xmlFileName, xmlFileLocations, xsdFilePath) \
- ASSERT_PRED_FORMAT3( \
- ::android::hardware::audio::common::test::utility::validateXmlMultipleLocations, \
+/** ASSERT that all found XML are valid according to an xsd. */
+#define ASSERT_VALID_XML_MULTIPLE_LOCATIONS(xmlFileName, xmlFileLocations, xsdFilePath) \
+ ASSERT_PRED_FORMAT3( \
+ ::android::hardware::audio::common::test::utility::validateXmlMultipleLocations<false>, \
xmlFileName, xmlFileLocations, xsdFilePath)
-/** EXPECT an XML to be valid according to an xsd.
- * The XML file must be in at least one of the provided locations.
- * If multiple are found, all are validated.
- */
-#define EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS(xmlFileName, xmlFileLocations, xsdFilePath) \
- EXPECT_PRED_FORMAT3( \
- ::android::hardware::audio::common::test::utility::validateXmlMultipleLocations, \
+/** EXPECT that all found XML are valid according to an xsd. */
+#define EXPECT_VALID_XML_MULTIPLE_LOCATIONS(xmlFileName, xmlFileLocations, xsdFilePath) \
+ EXPECT_PRED_FORMAT3( \
+ ::android::hardware::audio::common::test::utility::validateXmlMultipleLocations<false>, \
+ xmlFileName, xmlFileLocations, xsdFilePath)
+
+/** ASSERT that all found XML are valid according to an xsd. At least one must be found. */
+#define ASSERT_ONE_VALID_XML_MULTIPLE_LOCATIONS(xmlFileName, xmlFileLocations, xsdFilePath) \
+ ASSERT_PRED_FORMAT3( \
+ ::android::hardware::audio::common::test::utility::validateXmlMultipleLocations<true>, \
+ xmlFileName, xmlFileLocations, xsdFilePath)
+
+/** EXPECT that all found XML are valid according to an xsd. At least one must be found. */
+#define EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS(xmlFileName, xmlFileLocations, xsdFilePath) \
+ EXPECT_PRED_FORMAT3( \
+ ::android::hardware::audio::common::test::utility::validateXmlMultipleLocations<true>, \
xmlFileName, xmlFileLocations, xsdFilePath)
} // namespace utility
diff --git a/audio/common/all-versions/test/utility/src/ValidateXml.cpp b/audio/common/all-versions/test/utility/src/ValidateXml.cpp
index 5030af5..1a906d6 100644
--- a/audio/common/all-versions/test/utility/src/ValidateXml.cpp
+++ b/audio/common/all-versions/test/utility/src/ValidateXml.cpp
@@ -129,6 +129,7 @@
return ::testing::AssertionSuccess();
}
+template <bool atLeastOneRequired>
::testing::AssertionResult validateXmlMultipleLocations(
const char* xmlFileNameExpr, const char* xmlFileLocationsExpr, const char* xsdFilePathExpr,
const char* xmlFileName, std::vector<const char*> xmlFileLocations, const char* xsdFilePath) {
@@ -150,7 +151,7 @@
}
}
- if (foundFiles.empty()) {
+ if (atLeastOneRequired && foundFiles.empty()) {
errors.push_back("No xml file found in provided locations.\n");
}
@@ -160,9 +161,20 @@
<< " While validating all: " << xmlFileNameExpr
<< "\n Which is: " << xmlFileName
<< "\n In the following folders: " << xmlFileLocationsExpr
- << "\n Which is: " << ::testing::PrintToString(xmlFileLocations);
+ << "\n Which is: " << ::testing::PrintToString(xmlFileLocations)
+ << (atLeastOneRequired ? "Where at least one file must be found."
+ : "Where no file might exist.");
}
+template ::testing::AssertionResult validateXmlMultipleLocations<true>(const char*, const char*,
+ const char*, const char*,
+ std::vector<const char*>,
+ const char*);
+template ::testing::AssertionResult validateXmlMultipleLocations<false>(const char*, const char*,
+ const char*, const char*,
+ std::vector<const char*>,
+ const char*);
+
} // namespace utility
} // namespace test
} // namespace common
diff --git a/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp b/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
index c764ea6..761330f 100644
--- a/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
+++ b/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
@@ -555,11 +555,11 @@
address.device = deviceType;
auto ret = device->setConnectedState(address, state);
ASSERT_TRUE(ret.isOk());
- if (res == Result::NOT_SUPPORTED) {
+ if (ret == Result::NOT_SUPPORTED) {
doc::partialTest("setConnectedState is not supported");
return;
}
- ASSERT_OK(res);
+ ASSERT_OK(ret);
}
}
}
diff --git a/audio/effect/2.0/vts/functional/ValidateAudioEffectsConfiguration.cpp b/audio/effect/2.0/vts/functional/ValidateAudioEffectsConfiguration.cpp
index d0bc690..bf080d3 100644
--- a/audio/effect/2.0/vts/functional/ValidateAudioEffectsConfiguration.cpp
+++ b/audio/effect/2.0/vts/functional/ValidateAudioEffectsConfiguration.cpp
@@ -27,6 +27,6 @@
using namespace android::effectsConfig;
std::vector<const char*> locations(std::begin(DEFAULT_LOCATIONS), std::end(DEFAULT_LOCATIONS));
- EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS(DEFAULT_NAME, locations,
- "/data/local/tmp/audio_effects_conf_V2_0.xsd");
+ EXPECT_VALID_XML_MULTIPLE_LOCATIONS(DEFAULT_NAME, locations,
+ "/data/local/tmp/audio_effects_conf_V2_0.xsd");
}
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 0d92c37..c6c00d2 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -4044,10 +4044,10 @@
<< static_cast<uint32_t>(inflightReq.errorCode);
}
}
-
- ret = session->close();
- ASSERT_TRUE(ret.isOk());
}
+
+ ret = session->close();
+ ASSERT_TRUE(ret.isOk());
}
}
diff --git a/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
index 010a46d..c26f60a 100644
--- a/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
+++ b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
@@ -404,7 +404,11 @@
ASSERT_TRUE(result.isOk());
EXPECT_TRUE(result);
- auto resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_ALL);
+ auto resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_POSITION);
+
+ ASSERT_TRUE(resultVoid.isOk());
+
+ resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_TIME);
ASSERT_TRUE(resultVoid.isOk());
@@ -472,6 +476,16 @@
}
}
+/*
+ * SchedulingCapabilities:
+ * Verifies that 2018+ hardware supports Scheduling capabilities.
+ */
+TEST_F(GnssHalTest, SchedulingCapabilities) {
+ if (info_called_count_ > 0 && last_info_.yearOfHw >= 2018) {
+ EXPECT_TRUE(last_capabilities_ & IGnssCallback::Capabilities::SCHEDULING);
+ }
+}
+
int main(int argc, char** argv) {
::testing::AddGlobalTestEnvironment(GnssHidlEnvironment::Instance());
::testing::InitGoogleTest(&argc, argv);
diff --git a/gnss/1.1/vts/functional/gnss_hal_test.cpp b/gnss/1.1/vts/functional/gnss_hal_test.cpp
index 46d61e5..433f5cb 100644
--- a/gnss/1.1/vts/functional/gnss_hal_test.cpp
+++ b/gnss/1.1/vts/functional/gnss_hal_test.cpp
@@ -83,6 +83,7 @@
*/
while (wait(TIMEOUT_SEC) == std::cv_status::no_timeout) {
}
+ location_called_count_ = 0;
}
void GnssHalTest::SetPositionMode(const int min_interval_msec, const bool low_power_mode) {
@@ -97,17 +98,17 @@
EXPECT_TRUE(result);
}
-bool GnssHalTest::StartAndGetSingleLocation() {
+bool GnssHalTest::StartAndCheckFirstLocation() {
auto result = gnss_hal_->start();
EXPECT_TRUE(result.isOk());
EXPECT_TRUE(result);
/*
- * GPS signals initially optional for this test, so don't expect fast fix,
- * or no timeout, unless signal is present
+ * GnssLocationProvider support of AGPS SUPL & XtraDownloader is not available in VTS,
+ * so allow time to demodulate ephemeris over the air.
*/
- const int kFirstGnssLocationTimeoutSeconds = 15;
+ const int kFirstGnssLocationTimeoutSeconds = 75;
wait(kFirstGnssLocationTimeoutSeconds);
EXPECT_EQ(location_called_count_, 1);
@@ -195,7 +196,7 @@
SetPositionMode(kMinIntervalMsec, kLowPowerMode);
- EXPECT_TRUE(StartAndGetSingleLocation());
+ EXPECT_TRUE(StartAndCheckFirstLocation());
for (int i = 1; i < count; i++) {
EXPECT_EQ(std::cv_status::no_timeout, wait(kLocationTimeoutSubsequentSec));
diff --git a/gnss/1.1/vts/functional/gnss_hal_test.h b/gnss/1.1/vts/functional/gnss_hal_test.h
index 269366a..64478b5 100644
--- a/gnss/1.1/vts/functional/gnss_hal_test.h
+++ b/gnss/1.1/vts/functional/gnss_hal_test.h
@@ -107,12 +107,15 @@
void SetUpGnssCallback();
/*
- * StartAndGetSingleLocation:
- * Helper function to get one Location and check fields
+ * StartAndCheckFirstLocation:
+ * Helper function to start location, and check the first one.
+ *
+ * <p> Note this leaves the Location request active, to enable Stop call vs. other call
+ * reordering tests.
*
* returns true if a location was successfully generated
*/
- bool StartAndGetSingleLocation();
+ bool StartAndCheckFirstLocation();
/*
* CheckLocation:
diff --git a/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp b/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp
index cce46f1..72e5e14 100644
--- a/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp
+++ b/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp
@@ -60,24 +60,46 @@
*/
TEST_F(GnssHalTest, GetLocationLowPower) {
const int kMinIntervalMsec = 5000;
- const int kLocationTimeoutSubsequentSec = (kMinIntervalMsec / 1000) + 1;
- const int kNoLocationPeriodSec = 2;
+ const int kLocationTimeoutSubsequentSec = (kMinIntervalMsec / 1000) * 2;
+ const int kNoLocationPeriodSec = (kMinIntervalMsec / 1000) / 2;
const int kLocationsToCheck = 5;
const bool kLowPowerMode = true;
+ // Warmup period - VTS doesn't have AGPS access via GnssLocationProvider
+ StartAndCheckLocations(5);
+ StopAndClearLocations();
+
+ // Start of Low Power Mode test
SetPositionMode(kMinIntervalMsec, kLowPowerMode);
- EXPECT_TRUE(StartAndGetSingleLocation());
+ // Don't expect true - as without AGPS access
+ if (!StartAndCheckFirstLocation()) {
+ ALOGW("GetLocationLowPower test - no first low power location received.");
+ }
for (int i = 1; i < kLocationsToCheck; i++) {
// Verify that kMinIntervalMsec is respected by waiting kNoLocationPeriodSec and
// ensure that no location is received yet
+
wait(kNoLocationPeriodSec);
- EXPECT_EQ(location_called_count_, i);
- EXPECT_EQ(std::cv_status::no_timeout,
- wait(kLocationTimeoutSubsequentSec - kNoLocationPeriodSec));
- EXPECT_EQ(location_called_count_, i + 1);
- CheckLocation(last_location_, true);
+ // Tolerate (ignore) one extra location right after the first one
+ // to handle startup edge case scheduling limitations in some implementations
+ if ((i == 1) && (location_called_count_ == 2)) {
+ CheckLocation(last_location_, true);
+ continue; // restart the quiet wait period after this too-fast location
+ }
+ EXPECT_LE(location_called_count_, i);
+ if (location_called_count_ != i) {
+ ALOGW("GetLocationLowPower test - not enough locations received. %d vs. %d expected ",
+ location_called_count_, i);
+ }
+
+ if (std::cv_status::no_timeout !=
+ wait(kLocationTimeoutSubsequentSec - kNoLocationPeriodSec)) {
+ ALOGW("GetLocationLowPower test - timeout awaiting location %d", i);
+ } else {
+ CheckLocation(last_location_, true);
+ }
}
StopAndClearLocations();
@@ -177,7 +199,8 @@
StartAndCheckLocations(kLocationsToAwait);
- EXPECT_GE((int)list_gnss_sv_status_.size(), kLocationsToAwait);
+ // Tolerate 1 less sv status to handle edge cases in reporting.
+ EXPECT_GE((int)list_gnss_sv_status_.size() + 1, kLocationsToAwait);
ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations", (int)list_gnss_sv_status_.size(),
kLocationsToAwait);
@@ -217,7 +240,8 @@
location_called_count_ = 0;
StartAndCheckLocations(kLocationsToAwait);
- EXPECT_GE((int)list_gnss_sv_status_.size(), kLocationsToAwait);
+ // Tolerate 1 less sv status to handle edge cases in reporting.
+ EXPECT_GE((int)list_gnss_sv_status_.size() + 1, kLocationsToAwait);
ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations", (int)list_gnss_sv_status_.size(),
kLocationsToAwait);
for (const auto& gnss_sv_status : list_gnss_sv_status_) {
@@ -236,13 +260,13 @@
ASSERT_TRUE(result.isOk());
EXPECT_TRUE(result);
- location_called_count_ = 0;
StopAndClearLocations();
list_gnss_sv_status_.clear();
StartAndCheckLocations(kLocationsToAwait);
- EXPECT_GE((int)list_gnss_sv_status_.size(), kLocationsToAwait);
+ // Tolerate 1 less sv status to handle edge cases in reporting.
+ EXPECT_GE((int)list_gnss_sv_status_.size() + 1, kLocationsToAwait);
ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations", (int)list_gnss_sv_status_.size(),
kLocationsToAwait);
@@ -278,7 +302,8 @@
StartAndCheckLocations(kLocationsToAwait);
- EXPECT_GE((int)list_gnss_sv_status_.size(), kLocationsToAwait);
+ // Tolerate 1 less sv status to handle edge cases in reporting.
+ EXPECT_GE((int)list_gnss_sv_status_.size() + 1, kLocationsToAwait);
ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations", (int)list_gnss_sv_status_.size(),
kLocationsToAwait);
@@ -328,7 +353,8 @@
location_called_count_ = 0;
StartAndCheckLocations(kLocationsToAwait);
- EXPECT_GE((int)list_gnss_sv_status_.size(), kLocationsToAwait);
+ // Tolerate 1 less sv status to handle edge cases in reporting.
+ EXPECT_GE((int)list_gnss_sv_status_.size() + 1, kLocationsToAwait);
ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations", (int)list_gnss_sv_status_.size(),
kLocationsToAwait);
for (const auto& gnss_sv_status : list_gnss_sv_status_) {
@@ -353,23 +379,8 @@
* Ensure successfully injecting a location.
*/
TEST_F(GnssHalTest, InjectBestLocation) {
- GnssLocation gnssLocation = {.gnssLocationFlags = 0, // set below
- .latitudeDegrees = 43.0,
- .longitudeDegrees = -180,
- .altitudeMeters = 1000,
- .speedMetersPerSec = 0,
- .bearingDegrees = 0,
- .horizontalAccuracyMeters = 0.1,
- .verticalAccuracyMeters = 0.1,
- .speedAccuracyMetersPerSecond = 0.1,
- .bearingAccuracyDegrees = 0.1,
- .timestamp = 1534567890123L};
- gnssLocation.gnssLocationFlags |=
- GnssLocationFlags::HAS_LAT_LONG | GnssLocationFlags::HAS_ALTITUDE |
- GnssLocationFlags::HAS_SPEED | GnssLocationFlags::HAS_HORIZONTAL_ACCURACY |
- GnssLocationFlags::HAS_VERTICAL_ACCURACY | GnssLocationFlags::HAS_SPEED_ACCURACY |
- GnssLocationFlags::HAS_BEARING | GnssLocationFlags::HAS_BEARING_ACCURACY;
-
+ StartAndCheckLocations(1);
+ GnssLocation gnssLocation = last_location_;
CheckLocation(gnssLocation, true);
auto result = gnss_hal_->injectBestLocation(gnssLocation);
@@ -377,7 +388,7 @@
ASSERT_TRUE(result.isOk());
EXPECT_TRUE(result);
- auto resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_ALL);
+ auto resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_POSITION);
ASSERT_TRUE(resultVoid.isOk());
}
diff --git a/radio/1.2/vts/functional/radio_response.cpp b/radio/1.2/vts/functional/radio_response.cpp
index dab63a3..c5c7b14 100644
--- a/radio/1.2/vts/functional/radio_response.cpp
+++ b/radio/1.2/vts/functional/radio_response.cpp
@@ -653,7 +653,9 @@
return Void();
}
-Return<void> RadioResponse_v1_2::setIndicationFilterResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse_v1_2::setIndicationFilterResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_v1_2.notify(info.serial);
return Void();
}