summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2019-11-22 21:05:29 +0000
committerandroid-build-prod (mdb) <android-build-team-robot@google.com>2019-11-22 21:05:29 +0000
commitbd18cfdc06e1d4a90acb96b2da5e9de8b5dfa0b4 (patch)
treea584c74b9a1ec5fb0965c5566a397a466bd145ea
parentc4cd8ed446dbde39df701dab0525e5ef5b9824ec (diff)
parent4e46e7d3fe99de2ece1f12b814f9771fba5d137c (diff)
downloadplatform_system_hardware_interfaces-android10-tests-release.tar.gz
platform_system_hardware_interfaces-android10-tests-release.tar.bz2
platform_system_hardware_interfaces-android10-tests-release.zip
Change-Id: I6b9d869f9625d9a393b1fef344255c693e49e512
-rw-r--r--wifi/keystore/1.0/vts/functional/VtsHalWifiKeystoreV1_0TargetTest.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/wifi/keystore/1.0/vts/functional/VtsHalWifiKeystoreV1_0TargetTest.cpp b/wifi/keystore/1.0/vts/functional/VtsHalWifiKeystoreV1_0TargetTest.cpp
index 13a07f89..12096b4d 100644
--- a/wifi/keystore/1.0/vts/functional/VtsHalWifiKeystoreV1_0TargetTest.cpp
+++ b/wifi/keystore/1.0/vts/functional/VtsHalWifiKeystoreV1_0TargetTest.cpp
@@ -254,21 +254,24 @@ TEST_F(WifiKeystoreHalTest, Sign_empty_data) {
GTEST_SKIP() << "Device not running a debuggable build, cannot make test keys";
}
- IKeystore::KeystoreStatusCode statusCode;
+ bool callbackInvoked = false;
- auto callback = [&statusCode](IKeystore::KeystoreStatusCode status,
- const ::android::hardware::hidl_vec<uint8_t>& /*value*/) {
- statusCode = status;
+ auto callback = [&callbackInvoked](IKeystore::KeystoreStatusCode /*status*/,
+ const ::android::hardware::hidl_vec<uint8_t>& /*value*/) {
+ // The result is ignored; this callback is a no-op.
+ callbackInvoked = true;
return;
};
bool result = generateKey(kTestKeyName, KeyPurpose::SIGNING, AID_WIFI);
EXPECT_EQ(result, true);
- // The data to sign is empty, and a failure is expected
+ // The data to sign is empty. The return code is not important, and the attempt could be
+ // interpreted as valid or an error case. The goal is to determine that the callback
+ // was invokved.
::android::hardware::hidl_vec<uint8_t> dataToSign;
keystore->sign(kTestKeyName, dataToSign, callback);
- EXPECT_EQ(IKeystore::KeystoreStatusCode::ERROR_UNKNOWN, statusCode);
+ EXPECT_EQ(true, callbackInvoked);
}
TEST_F(WifiKeystoreHalTest, Sign_wrong_key_purpose) {