summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuchi Kandoi2018-06-06 17:21:41 -0500
committerRuchi Kandoi2018-06-07 10:30:13 -0500
commit147ec3007642dc2403c845022708789a7972687d (patch)
tree6d40d3f5931972284c51f4a84ab8c03f9ac8c271
parent0be954949ddf098fb9ab28c523b04aceeb575323 (diff)
downloadplatform-hardware-interfaces-147ec3007642dc2403c845022708789a7972687d.tar.gz
platform-hardware-interfaces-147ec3007642dc2403c845022708789a7972687d.tar.xz
platform-hardware-interfaces-147ec3007642dc2403c845022708789a7972687d.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 (cherry picked from commit d7700d216f0d854405bb9d99972c79f1af5b1b68)
-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 dab81e2a..3ea3e8dc 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) {
134 EXPECT_LE((unsigned int)2, response.selectResponse.size()); 134 EXPECT_LE((unsigned int)2, response.selectResponse.size());
135 EXPECT_LE(1, response.channelNumber); 135 EXPECT_LE(1, response.channelNumber);
136 std::vector<uint8_t> command = DATA_APDU; 136 std::vector<uint8_t> command = DATA_APDU;
137 command[0] |= response.channelNumber;
137 std::vector<uint8_t> transmitResponse; 138 std::vector<uint8_t> transmitResponse;
138 se_->transmit(command, [&transmitResponse](std::vector<uint8_t> res) { 139 se_->transmit(command, [&transmitResponse](std::vector<uint8_t> res) {
139 transmitResponse.resize(res.size()); 140 transmitResponse.resize(res.size());
@@ -168,7 +169,8 @@ TEST_F(SecureElementHidlTest, openBasicChannel) {
168 } 169 }
169 }); 170 });
170 if (statusReturned == SecureElementStatus::SUCCESS) { 171 if (statusReturned == SecureElementStatus::SUCCESS) {
171 EXPECT_LE((unsigned int)3, response.size()); 172 EXPECT_LE((unsigned int)2, response.size());
173 se_->closeChannel(0);
172 return; 174 return;
173 } 175 }
174 EXPECT_EQ(SecureElementStatus::UNSUPPORTED_OPERATION, statusReturned); 176 EXPECT_EQ(SecureElementStatus::UNSUPPORTED_OPERATION, statusReturned);