diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2019-07-04 03:11:17 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-07-04 03:11:17 +0000 |
| commit | 24516cb80ff492bd101e865a4558284b78aa6c9b (patch) | |
| tree | 76082fe06c0f187f38e2689e34556459018579f6 | |
| parent | b07197f43ff8c4d7a51a63cc0e9ab36b3ed199ac (diff) | |
| parent | c4cd8ed446dbde39df701dab0525e5ef5b9824ec (diff) | |
| download | platform_system_hardware_interfaces-android10-mainline-release.tar.gz platform_system_hardware_interfaces-android10-mainline-release.tar.bz2 platform_system_hardware_interfaces-android10-mainline-release.zip | |
Snap for 5706892 from c4cd8ed446dbde39df701dab0525e5ef5b9824ec to qt-aml-releaseandroid-mainline-10.0.0_r3android-mainline-10.0.0_r2android-mainline-10.0.0_r1android10-mainline-releaseandroid10-mainline-a-release
Change-Id: Ie88913037217c8f57e211b0a51986bcb6fc9e9dd
| -rw-r--r-- | wifi/keystore/1.0/vts/functional/VtsHalWifiKeystoreV1_0TargetTest.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/wifi/keystore/1.0/vts/functional/VtsHalWifiKeystoreV1_0TargetTest.cpp b/wifi/keystore/1.0/vts/functional/VtsHalWifiKeystoreV1_0TargetTest.cpp index 53b6dd01..13a07f89 100644 --- a/wifi/keystore/1.0/vts/functional/VtsHalWifiKeystoreV1_0TargetTest.cpp +++ b/wifi/keystore/1.0/vts/functional/VtsHalWifiKeystoreV1_0TargetTest.cpp @@ -21,6 +21,7 @@ #include <android/system/wifi/keystore/1.0/IKeystore.h> #include <binder/IServiceManager.h> #include <binder/ProcessState.h> +#include <cutils/properties.h> #include <keymasterV4_0/authorization_set.h> #include <keystore/keystore_promises.h> #include <private/android_filesystem_config.h> @@ -70,6 +71,18 @@ class WifiKeystoreHalTest : public Test { void TearDown() override { resetState(); } + bool isDebuggableBuild() { + char value[PROPERTY_VALUE_MAX] = {0}; + property_get("ro.system.build.type", value, ""); + if (strcmp(value, "userdebug") == 0) { + return true; + } + if (strcmp(value, "eng") == 0) { + return true; + } + return false; + } + /** * Resets the relevant state of the system between tests */ @@ -237,6 +250,10 @@ TEST_F(WifiKeystoreHalTest, Sign_empty_key_name) { } TEST_F(WifiKeystoreHalTest, Sign_empty_data) { + if (!isDebuggableBuild()) { + GTEST_SKIP() << "Device not running a debuggable build, cannot make test keys"; + } + IKeystore::KeystoreStatusCode statusCode; auto callback = [&statusCode](IKeystore::KeystoreStatusCode status, @@ -255,6 +272,10 @@ TEST_F(WifiKeystoreHalTest, Sign_empty_data) { } TEST_F(WifiKeystoreHalTest, Sign_wrong_key_purpose) { + if (!isDebuggableBuild()) { + GTEST_SKIP() << "Device not running a debuggable build, cannot make test keys"; + } + IKeystore::KeystoreStatusCode statusCode; auto callback = [&statusCode](IKeystore::KeystoreStatusCode status, @@ -274,6 +295,10 @@ TEST_F(WifiKeystoreHalTest, Sign_wrong_key_purpose) { } TEST_F(WifiKeystoreHalTest, Sign_wrong_key_type) { + if (!isDebuggableBuild()) { + GTEST_SKIP() << "Device not running a debuggable build, cannot make test keys"; + } + IKeystore::KeystoreStatusCode statusCode; auto callback = [&statusCode](IKeystore::KeystoreStatusCode status, @@ -295,6 +320,10 @@ TEST_F(WifiKeystoreHalTest, Sign_wrong_key_type) { } TEST_F(WifiKeystoreHalTest, Sign_success) { + if (!isDebuggableBuild()) { + GTEST_SKIP() << "Device not running a debuggable build, cannot make test keys"; + } + IKeystore::KeystoreStatusCode statusCode; auto callback = [&statusCode](IKeystore::KeystoreStatusCode status, @@ -364,6 +393,10 @@ TEST_F(WifiKeystoreHalTest, GetBlob_missing_key) { } TEST_F(WifiKeystoreHalTest, GetBlob_wrong_user) { + if (!isDebuggableBuild()) { + GTEST_SKIP() << "Device not running a debuggable build, cannot make test keys"; + } + IKeystore::KeystoreStatusCode statusCode; auto callback = [&statusCode](IKeystore::KeystoreStatusCode status, @@ -383,6 +416,10 @@ TEST_F(WifiKeystoreHalTest, GetBlob_wrong_user) { } TEST_F(WifiKeystoreHalTest, GetBlob_success) { + if (!isDebuggableBuild()) { + GTEST_SKIP() << "Device not running a debuggable build, cannot make test keys"; + } + IKeystore::KeystoreStatusCode statusCode; auto callback = [&statusCode](IKeystore::KeystoreStatusCode status, @@ -449,6 +486,10 @@ TEST_F(WifiKeystoreHalTest, GetPublicKey_wrong_key_name) { } TEST_F(WifiKeystoreHalTest, GetPublicKey_wrong_user) { + if (!isDebuggableBuild()) { + GTEST_SKIP() << "Device not running a debuggable build, cannot make test keys"; + } + IKeystore::KeystoreStatusCode statusCode; auto callback = [&statusCode](IKeystore::KeystoreStatusCode status, @@ -472,6 +513,10 @@ TEST_F(WifiKeystoreHalTest, GetPublicKey_wrong_user) { } TEST_F(WifiKeystoreHalTest, GetPublicKey_wrong_key_type) { + if (!isDebuggableBuild()) { + GTEST_SKIP() << "Device not running a debuggable build, cannot make test keys"; + } + IKeystore::KeystoreStatusCode statusCode; auto callback = [&statusCode](IKeystore::KeystoreStatusCode status, @@ -494,6 +539,10 @@ TEST_F(WifiKeystoreHalTest, GetPublicKey_wrong_key_type) { } TEST_F(WifiKeystoreHalTest, GetPublicKey_success) { + if (!isDebuggableBuild()) { + GTEST_SKIP() << "Device not running a debuggable build, cannot make test keys"; + } + IKeystore::KeystoreStatusCode statusCode; auto callback = [&statusCode](IKeystore::KeystoreStatusCode status, |
