summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBranden Archer <brarcher@google.com>2019-09-03 13:21:18 -0700
committerBranden Archer <brarcher@google.com>2019-11-19 23:51:04 +0000
commit4e46e7d3fe99de2ece1f12b814f9771fba5d137c (patch)
treea584c74b9a1ec5fb0965c5566a397a466bd145ea
parentc4cd8ed446dbde39df701dab0525e5ef5b9824ec (diff)
downloadinterfaces-android10-tests-dev.tar.gz
Relax expected outcome of Sign_empty_key_nameandroid10-tests-dev
Signing empty data is valid, and enforcing the expectation of an error is incorrect. Updating the test to reflect that the response from signing empty data is not important, though the call returning is important. Fixes: 144610831 Change-Id: Idf9d4f08652ea91b26e89264b861091116c8df64 (cherry picked from commit 0922fdcdf011b9981829c95818aac8c296d3ed19)
-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 13a07f8..12096b4 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) {