Loading neuralnetworks/1.0/vts/functional/AndroidTest.xml +0 −4 Original line number Diff line number Diff line Loading @@ -26,10 +26,6 @@ </target_preparer> <test class="com.android.tradefed.testtype.GTest" > <!-- b/155577050, temporarily disable the failing tests. Must be deleted after corresponding driver issues are fixed. --> <option name="native-test-flag" value="--gtest_filter=-*Validation*:*CycleTest*:*sample_float_fast*:*sample_float_slow*:*sample_minimal*:*sample_quant*" /> <option name="native-test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsHalNeuralnetworksV1_0TargetTest" /> </test> Loading neuralnetworks/1.1/vts/functional/AndroidTest.xml +0 −4 Original line number Diff line number Diff line Loading @@ -26,10 +26,6 @@ </target_preparer> <test class="com.android.tradefed.testtype.GTest" > <!-- b/155577050, temporarily disable the failing tests. Must be deleted after corresponding driver issues are fixed. --> <option name="native-test-flag" value="--gtest_filter=-*Validation*:*CycleTest*:*sample_float_fast*:*sample_float_slow*:*sample_minimal*:*sample_quant*" /> <option name="native-test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsHalNeuralnetworksV1_1TargetTest" /> </test> Loading neuralnetworks/1.2/vts/functional/AndroidTest.xml +0 −4 Original line number Diff line number Diff line Loading @@ -26,10 +26,6 @@ </target_preparer> <test class="com.android.tradefed.testtype.GTest" > <!-- b/155577050, b/155674368, b/153876253, temporarily disable the test. Must be deleted after corresponding driver issues are fixed. --> <option name="native-test-flag" value="--gtest_filter=-*Validation*:*squeeze*_all*_inputs*:*strided_slice*_all*_inputs*:*transpose*_all*_inputs*:*l2_normalization_axis_corner_case*:*sample_float_fast*:*sample_float_slow*:*sample_minimal*:*sample_quant*" /> <option name="native-test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsHalNeuralnetworksV1_2TargetTest" /> </test> Loading neuralnetworks/1.2/vts/functional/CompilationCachingTests.cpp +38 −9 Original line number Diff line number Diff line Loading @@ -315,7 +315,8 @@ class CompilationCachingTestBase : public testing::Test { void saveModelToCache(const Model& model, const hidl_vec<hidl_handle>& modelCache, const hidl_vec<hidl_handle>& dataCache, sp<IPreparedModel>* preparedModel = nullptr) { sp<IPreparedModel>* preparedModel = nullptr, bool allowGeneralFailure = false) { if (preparedModel != nullptr) *preparedModel = nullptr; // Launch prepare model. Loading @@ -329,7 +330,10 @@ class CompilationCachingTestBase : public testing::Test { // Retrieve prepared model. preparedModelCallback->wait(); ASSERT_EQ(preparedModelCallback->getStatus(), ErrorStatus::NONE); const auto prepareCallbackStatus = preparedModelCallback->getStatus(); if (!allowGeneralFailure || prepareCallbackStatus != ErrorStatus::GENERAL_FAILURE) { ASSERT_EQ(prepareCallbackStatus, ErrorStatus::NONE); } if (preparedModel != nullptr) { *preparedModel = IPreparedModel::castFrom(preparedModelCallback->getPreparedModel()) .withDefault(nullptr); Loading Loading @@ -1022,7 +1026,8 @@ static void copyCacheFiles(const std::vector<std::vector<std::string>>& from, // Number of operations in the large test model. constexpr uint32_t kLargeModelSize = 100; constexpr uint32_t kNumIterationsTOCTOU = 100; constexpr uint32_t kNumSuccessfulIterationsTOCTOU = 100; constexpr uint32_t kMaxNumFailedIterationsTOCTOU = 100; TEST_P(CompilationCachingTest, SaveToCache_TOCTOU) { if (!mIsCachingSupported) return; Loading Loading @@ -1050,18 +1055,30 @@ TEST_P(CompilationCachingTest, SaveToCache_TOCTOU) { // Use a different token for modelAdd. mToken[0]++; // This test is probabilistic, so we run it multiple times. for (uint32_t i = 0; i < kNumIterationsTOCTOU; i++) { // This test is probabilistic, so we run it multiple times. We allow the compilation to fail // because it is not related to the security aspect of the TOCTOU test. However, we need to have // enough successful iterations to ensure the test coverage. uint32_t numSuccessfulIterations = 0, numFailedIterations = 0; while (numSuccessfulIterations < kNumSuccessfulIterationsTOCTOU) { // Save the modelAdd compilation to cache. { hidl_vec<hidl_handle> modelCache, dataCache; createCacheHandles(mModelCache, AccessMode::READ_WRITE, &modelCache); createCacheHandles(mDataCache, AccessMode::READ_WRITE, &dataCache); sp<IPreparedModel> preparedModel = nullptr; // Spawn a thread to copy the cache content concurrently while saving to cache. std::thread thread(copyCacheFiles, std::cref(modelCacheMul), std::cref(mModelCache)); saveModelToCache(modelAdd, modelCache, dataCache); saveModelToCache(modelAdd, modelCache, dataCache, &preparedModel, /*allowGeneralFailure=*/true); thread.join(); if (preparedModel == nullptr) { numFailedIterations++; ASSERT_LE(numFailedIterations, kMaxNumFailedIterationsTOCTOU); } else { numSuccessfulIterations++; } } // Retrieve preparedModel from cache. Loading Loading @@ -1112,14 +1129,26 @@ TEST_P(CompilationCachingTest, PrepareFromCache_TOCTOU) { // Use a different token for modelAdd. mToken[0]++; // This test is probabilistic, so we run it multiple times. for (uint32_t i = 0; i < kNumIterationsTOCTOU; i++) { // This test is probabilistic, so we run it multiple times. We allow the compilation to fail // because it is not related to the security aspect of the TOCTOU test. However, we need to have // enough successful iterations to ensure the test coverage. uint32_t numSuccessfulIterations = 0, numFailedIterations = 0; while (numSuccessfulIterations < kNumSuccessfulIterationsTOCTOU) { // Save the modelAdd compilation to cache. { hidl_vec<hidl_handle> modelCache, dataCache; createCacheHandles(mModelCache, AccessMode::READ_WRITE, &modelCache); createCacheHandles(mDataCache, AccessMode::READ_WRITE, &dataCache); saveModelToCache(modelAdd, modelCache, dataCache); sp<IPreparedModel> preparedModel = nullptr; saveModelToCache(modelAdd, modelCache, dataCache, &preparedModel, /*allowGeneralFailure=*/true); if (preparedModel == nullptr) { numFailedIterations++; ASSERT_LE(numFailedIterations, kMaxNumFailedIterationsTOCTOU); } else { numSuccessfulIterations++; } } // Retrieve preparedModel from cache. Loading neuralnetworks/1.3/vts/functional/AndroidTest.xml +0 −4 Original line number Diff line number Diff line Loading @@ -26,10 +26,6 @@ </target_preparer> <test class="com.android.tradefed.testtype.GTest" > <!-- b/156691406, b/155577050, b/155674368, b/153876253, temporarily disable the test. Must be deleted after corresponding driver issues are fixed. --> <option name="native-test-flag" value="--gtest_filter=-*Validation*:*DynamicOutputShapeTest*:*FencedComputeTest*:*MemoryDomain*:*QuantizationCouplingTest*:*DeadlineTest*:*resize_*_v1_3*:*squeeze*_all*_inputs*:*strided_slice*_all*_inputs*:*transpose*_all*_inputs*:*l2_normalization_axis_corner_case*:*sample_float_fast*:*sample_float_slow*:*sample_minimal*:*sample_quant*" /> <option name="native-test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsHalNeuralnetworksV1_3TargetTest" /> </test> Loading Loading
neuralnetworks/1.0/vts/functional/AndroidTest.xml +0 −4 Original line number Diff line number Diff line Loading @@ -26,10 +26,6 @@ </target_preparer> <test class="com.android.tradefed.testtype.GTest" > <!-- b/155577050, temporarily disable the failing tests. Must be deleted after corresponding driver issues are fixed. --> <option name="native-test-flag" value="--gtest_filter=-*Validation*:*CycleTest*:*sample_float_fast*:*sample_float_slow*:*sample_minimal*:*sample_quant*" /> <option name="native-test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsHalNeuralnetworksV1_0TargetTest" /> </test> Loading
neuralnetworks/1.1/vts/functional/AndroidTest.xml +0 −4 Original line number Diff line number Diff line Loading @@ -26,10 +26,6 @@ </target_preparer> <test class="com.android.tradefed.testtype.GTest" > <!-- b/155577050, temporarily disable the failing tests. Must be deleted after corresponding driver issues are fixed. --> <option name="native-test-flag" value="--gtest_filter=-*Validation*:*CycleTest*:*sample_float_fast*:*sample_float_slow*:*sample_minimal*:*sample_quant*" /> <option name="native-test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsHalNeuralnetworksV1_1TargetTest" /> </test> Loading
neuralnetworks/1.2/vts/functional/AndroidTest.xml +0 −4 Original line number Diff line number Diff line Loading @@ -26,10 +26,6 @@ </target_preparer> <test class="com.android.tradefed.testtype.GTest" > <!-- b/155577050, b/155674368, b/153876253, temporarily disable the test. Must be deleted after corresponding driver issues are fixed. --> <option name="native-test-flag" value="--gtest_filter=-*Validation*:*squeeze*_all*_inputs*:*strided_slice*_all*_inputs*:*transpose*_all*_inputs*:*l2_normalization_axis_corner_case*:*sample_float_fast*:*sample_float_slow*:*sample_minimal*:*sample_quant*" /> <option name="native-test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsHalNeuralnetworksV1_2TargetTest" /> </test> Loading
neuralnetworks/1.2/vts/functional/CompilationCachingTests.cpp +38 −9 Original line number Diff line number Diff line Loading @@ -315,7 +315,8 @@ class CompilationCachingTestBase : public testing::Test { void saveModelToCache(const Model& model, const hidl_vec<hidl_handle>& modelCache, const hidl_vec<hidl_handle>& dataCache, sp<IPreparedModel>* preparedModel = nullptr) { sp<IPreparedModel>* preparedModel = nullptr, bool allowGeneralFailure = false) { if (preparedModel != nullptr) *preparedModel = nullptr; // Launch prepare model. Loading @@ -329,7 +330,10 @@ class CompilationCachingTestBase : public testing::Test { // Retrieve prepared model. preparedModelCallback->wait(); ASSERT_EQ(preparedModelCallback->getStatus(), ErrorStatus::NONE); const auto prepareCallbackStatus = preparedModelCallback->getStatus(); if (!allowGeneralFailure || prepareCallbackStatus != ErrorStatus::GENERAL_FAILURE) { ASSERT_EQ(prepareCallbackStatus, ErrorStatus::NONE); } if (preparedModel != nullptr) { *preparedModel = IPreparedModel::castFrom(preparedModelCallback->getPreparedModel()) .withDefault(nullptr); Loading Loading @@ -1022,7 +1026,8 @@ static void copyCacheFiles(const std::vector<std::vector<std::string>>& from, // Number of operations in the large test model. constexpr uint32_t kLargeModelSize = 100; constexpr uint32_t kNumIterationsTOCTOU = 100; constexpr uint32_t kNumSuccessfulIterationsTOCTOU = 100; constexpr uint32_t kMaxNumFailedIterationsTOCTOU = 100; TEST_P(CompilationCachingTest, SaveToCache_TOCTOU) { if (!mIsCachingSupported) return; Loading Loading @@ -1050,18 +1055,30 @@ TEST_P(CompilationCachingTest, SaveToCache_TOCTOU) { // Use a different token for modelAdd. mToken[0]++; // This test is probabilistic, so we run it multiple times. for (uint32_t i = 0; i < kNumIterationsTOCTOU; i++) { // This test is probabilistic, so we run it multiple times. We allow the compilation to fail // because it is not related to the security aspect of the TOCTOU test. However, we need to have // enough successful iterations to ensure the test coverage. uint32_t numSuccessfulIterations = 0, numFailedIterations = 0; while (numSuccessfulIterations < kNumSuccessfulIterationsTOCTOU) { // Save the modelAdd compilation to cache. { hidl_vec<hidl_handle> modelCache, dataCache; createCacheHandles(mModelCache, AccessMode::READ_WRITE, &modelCache); createCacheHandles(mDataCache, AccessMode::READ_WRITE, &dataCache); sp<IPreparedModel> preparedModel = nullptr; // Spawn a thread to copy the cache content concurrently while saving to cache. std::thread thread(copyCacheFiles, std::cref(modelCacheMul), std::cref(mModelCache)); saveModelToCache(modelAdd, modelCache, dataCache); saveModelToCache(modelAdd, modelCache, dataCache, &preparedModel, /*allowGeneralFailure=*/true); thread.join(); if (preparedModel == nullptr) { numFailedIterations++; ASSERT_LE(numFailedIterations, kMaxNumFailedIterationsTOCTOU); } else { numSuccessfulIterations++; } } // Retrieve preparedModel from cache. Loading Loading @@ -1112,14 +1129,26 @@ TEST_P(CompilationCachingTest, PrepareFromCache_TOCTOU) { // Use a different token for modelAdd. mToken[0]++; // This test is probabilistic, so we run it multiple times. for (uint32_t i = 0; i < kNumIterationsTOCTOU; i++) { // This test is probabilistic, so we run it multiple times. We allow the compilation to fail // because it is not related to the security aspect of the TOCTOU test. However, we need to have // enough successful iterations to ensure the test coverage. uint32_t numSuccessfulIterations = 0, numFailedIterations = 0; while (numSuccessfulIterations < kNumSuccessfulIterationsTOCTOU) { // Save the modelAdd compilation to cache. { hidl_vec<hidl_handle> modelCache, dataCache; createCacheHandles(mModelCache, AccessMode::READ_WRITE, &modelCache); createCacheHandles(mDataCache, AccessMode::READ_WRITE, &dataCache); saveModelToCache(modelAdd, modelCache, dataCache); sp<IPreparedModel> preparedModel = nullptr; saveModelToCache(modelAdd, modelCache, dataCache, &preparedModel, /*allowGeneralFailure=*/true); if (preparedModel == nullptr) { numFailedIterations++; ASSERT_LE(numFailedIterations, kMaxNumFailedIterationsTOCTOU); } else { numSuccessfulIterations++; } } // Retrieve preparedModel from cache. Loading
neuralnetworks/1.3/vts/functional/AndroidTest.xml +0 −4 Original line number Diff line number Diff line Loading @@ -26,10 +26,6 @@ </target_preparer> <test class="com.android.tradefed.testtype.GTest" > <!-- b/156691406, b/155577050, b/155674368, b/153876253, temporarily disable the test. Must be deleted after corresponding driver issues are fixed. --> <option name="native-test-flag" value="--gtest_filter=-*Validation*:*DynamicOutputShapeTest*:*FencedComputeTest*:*MemoryDomain*:*QuantizationCouplingTest*:*DeadlineTest*:*resize_*_v1_3*:*squeeze*_all*_inputs*:*strided_slice*_all*_inputs*:*transpose*_all*_inputs*:*l2_normalization_axis_corner_case*:*sample_float_fast*:*sample_float_slow*:*sample_minimal*:*sample_quant*" /> <option name="native-test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsHalNeuralnetworksV1_3TargetTest" /> </test> Loading