summaryrefslogtreecommitdiffstats
path: root/secure_element
diff options
context:
space:
mode:
authorRuchi Kandoi <kandoiruchi@google.com>2018-06-06 15:21:41 -0700
committerRuchi Kandoi <kandoiruchi@google.com>2018-06-07 21:51:50 +0000
commit0845d32131315b1a685f746ec972d1901e8856d4 (patch)
treef06ad09b58d8489dd64be58cd8309804813d9e7e /secure_element
parent913c071391e096bd6b77510b285d746ee97c28ed (diff)
downloadplatform_hardware_interfaces-0845d32131315b1a685f746ec972d1901e8856d4.tar.gz
platform_hardware_interfaces-0845d32131315b1a685f746ec972d1901e8856d4.tar.bz2
platform_hardware_interfaces-0845d32131315b1a685f746ec972d1901e8856d4.zip
secure_element: vts: Fix openBasicChannel and transmit test case
Status Response for basic channel can be only 2 bytes as well. Update the test to test for 2 or more bytes. Basic Channel if opened successfully should be closed. Transmit test case should specify the channel number in the command. Test: atest VtsHalSecureElementV1_0TargetTest Bug: 109833790 Change-Id: I91c943b4297067f6ae6872efb038f1295f92f5c8 Merged-In: I91c943b4297067f6ae6872efb038f1295f92f5c8
Diffstat (limited to 'secure_element')
-rw-r--r--secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp b/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp
index dab81e2a23..3ea3e8dcac 100644
--- a/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp
+++ b/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp
@@ -134,6 +134,7 @@ TEST_F(SecureElementHidlTest, transmit) {
EXPECT_LE((unsigned int)2, response.selectResponse.size());
EXPECT_LE(1, response.channelNumber);
std::vector<uint8_t> command = DATA_APDU;
+ command[0] |= response.channelNumber;
std::vector<uint8_t> transmitResponse;
se_->transmit(command, [&transmitResponse](std::vector<uint8_t> res) {
transmitResponse.resize(res.size());
@@ -168,7 +169,8 @@ TEST_F(SecureElementHidlTest, openBasicChannel) {
}
});
if (statusReturned == SecureElementStatus::SUCCESS) {
- EXPECT_LE((unsigned int)3, response.size());
+ EXPECT_LE((unsigned int)2, response.size());
+ se_->closeChannel(0);
return;
}
EXPECT_EQ(SecureElementStatus::UNSUPPORTED_OPERATION, statusReturned);