summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>2019-01-09 12:48:39 +0100
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>2019-02-13 13:37:15 +0100
commit66acb43cae733b2abb503bc5457762762c8829d2 (patch)
treedb8ec5424d24340f98acc332fd27d0ed9e123407
parentc69772a9441cc453cd68fe726f379ae8147dbba4 (diff)
downloadkey-manager-66acb43cae733b2abb503bc5457762762c8829d2.tar.gz
key-manager-66acb43cae733b2abb503bc5457762762c8829d2.tar.bz2
key-manager-66acb43cae733b2abb503bc5457762762c8829d2.zip
Make username shorter in KeyProvider tests
USERNAME_LONG used in KeyProvider tests is 43 characters long while the structure used for storing it has only 32 characters. After adding a size check in WrappedKeyAndInfoContainer::setKeyInfoClient the tests started to fail. This commit makes the passed string fit 32 characters and adds new test. Change-Id: Ida8a574f805c9518d00ee810dbd3c2daed9ace55
-rw-r--r--tests/test_key-provider.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_key-provider.cpp b/tests/test_key-provider.cpp
index 4991c4d..81d381d 100644
--- a/tests/test_key-provider.cpp
+++ b/tests/test_key-provider.cpp
@@ -32,7 +32,7 @@ const CKM::Password INCORRECT_PASSWORD = "AAAAAAAAAAAAAAAAAAAAA";
const CKM::Password NEW_PASSWORD = "NEW12345TIZEN12345NEW";
const std::string USERNAME_SHORT = "AB";
-const std::string USERNAME_LONG = "SOFTWARE_CENTER_SYSTEM_SW_LAB_SECURITY_PART";
+const std::string USERNAME_LONG = "SOFTWARE_CENTER_SYSTEM_SW_LAB";
const std::string CLIENT_ID_1 = "SAMPLE_CLIENT_ID_1";
const std::string CLIENT_ID_2 = "SAMPLE_CLIENT_ID_2";
@@ -171,6 +171,9 @@ BOOST_AUTO_TEST_CASE(wrapped_container)
BOOST_REQUIRE_NO_THROW(wrappedContainer.setKeyInfoSalt(salt.data(), salt.size()));
BOOST_REQUIRE_NO_THROW(wrappedContainer.setKeyInfoClient("key_info_client"));
+ BOOST_REQUIRE_THROW(wrappedContainer.setKeyInfoClient("key_info_client_waaaaay_too_long"),
+ CKM::Exc::InternalError);
+
CKM::WrappedKeyAndInfoContainer wrappedContainer2;
BOOST_REQUIRE_NO_THROW(
wrappedContainer2.setKeyInfo(&wrappedContainer.getWrappedKeyAndInfo().keyInfo));