Remove KeyProvider lib initialization from tests 41/238841/2
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 17 Jul 2020 14:57:46 +0000 (16:57 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 20 Jul 2020 08:52:28 +0000 (08:52 +0000)
It's a NOOP on tizen.org.

Change-Id: I915bba5e55a6f21925c363687b1990d24bf2f2cf

unit-tests/main.cpp
unit-tests/test_key-provider.cpp

index 0a2c09d..9c8c753 100644 (file)
@@ -20,7 +20,6 @@
  */
 
 #include <iostream>
-#include <key-provider.h>
 
 #define BOOST_TEST_MODULE KEY_MANAGER_UNIT_TESTS
 #include <boost/test/unit_test.hpp>
@@ -45,28 +44,6 @@ struct TestConfig {
        }
 };
 
-bool isLibInitialized = false;
-
-struct KeyProviderLib {
-       KeyProviderLib()
-       {
-               try {
-                       CKM::KeyProvider::initializeLibrary();
-                       isLibInitialized = true;
-               } catch (const CKM::Exc::Exception &) {
-                       std::cout << "Library initialization failed!" << std::endl;
-               }
-       }
-       ~KeyProviderLib()
-       {
-               try {
-                       CKM::KeyProvider::closeLibrary();
-               } catch (const CKM::Exc::Exception &) {
-                       std::cout << "Library deinitialization failed!" << std::endl;
-               }
-       }
-};
-
 struct LogSetup {
        LogSetup()
        {
@@ -76,7 +53,6 @@ struct LogSetup {
        ~LogSetup() {}
 };
 
-BOOST_GLOBAL_FIXTURE(KeyProviderLib);
 BOOST_GLOBAL_FIXTURE(TestConfig);
 BOOST_GLOBAL_FIXTURE(LogSetup);
 
index deeb1aa..d324f52 100644 (file)
@@ -36,13 +36,9 @@ 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";
 
-extern bool isLibInitialized;
-
 BOOST_AUTO_TEST_SUITE(KEY_PROVIDER_TEST)
 POSITIVE_TEST_CASE(KeyDomainKEK)
 {
-       BOOST_REQUIRE_MESSAGE(isLibInitialized,
-                                                 "Library is not initialized!");
        CKM::KeyProvider keyProvider;
        CKM::RawBuffer rb_test;
        BOOST_REQUIRE_NO_THROW(rb_test =
@@ -54,8 +50,6 @@ POSITIVE_TEST_CASE(KeyDomainKEK)
 
 NEGATIVE_TEST_CASE(KeyDomainKekInvalidPassword)
 {
-       BOOST_REQUIRE_MESSAGE(isLibInitialized,
-                                                 "Library is not initialized!");
        CKM::KeyProvider keyProvider;
        CKM::RawBuffer rb_test;
        BOOST_REQUIRE_NO_THROW(rb_test =
@@ -68,8 +62,6 @@ NEGATIVE_TEST_CASE(KeyDomainKekInvalidPassword)
 
 POSITIVE_TEST_CASE(KeygetPureDomainKEK)
 {
-       BOOST_REQUIRE_MESSAGE(isLibInitialized,
-                                                 "Library is not initialized!");
        CKM::KeyProvider keyProvider;
        CKM::RawBuffer rb_test;
        BOOST_REQUIRE_NO_THROW(rb_test =
@@ -82,8 +74,6 @@ POSITIVE_TEST_CASE(KeygetPureDomainKEK)
 
 POSITIVE_TEST_CASE(KeyGetWrappedDomainKEK)
 {
-       BOOST_REQUIRE_MESSAGE(isLibInitialized,
-                                                 "Library is not initialized!");
        CKM::KeyProvider keyProvider;
        CKM::RawBuffer rb_test;
        BOOST_REQUIRE_NO_THROW(rb_test =
@@ -96,8 +86,6 @@ POSITIVE_TEST_CASE(KeyGetWrappedDomainKEK)
 
 POSITIVE_TEST_CASE(KeyGenerateDEK)
 {
-       BOOST_REQUIRE_MESSAGE(isLibInitialized,
-                                                 "Library is not initialized!");
        CKM::KeyProvider keyProvider;
        CKM::RawBuffer rb_test;
        CKM::RawBuffer rb_DEK1;
@@ -111,8 +99,6 @@ POSITIVE_TEST_CASE(KeyGenerateDEK)
 
 POSITIVE_TEST_CASE(KeyGetPureDEK)
 {
-       BOOST_REQUIRE_MESSAGE(isLibInitialized,
-                                                 "Library is not initialized!");
        CKM::KeyProvider keyProvider;
        CKM::RawBuffer rb_pureDEK1;
        CKM::RawBuffer rb_DEK1;
@@ -128,8 +114,6 @@ POSITIVE_TEST_CASE(KeyGetPureDEK)
 
 POSITIVE_TEST_CASE(KeyReencrypt)
 {
-       BOOST_REQUIRE_MESSAGE(isLibInitialized,
-                                                 "Library is not initialized!");
        CKM::RawBuffer rb_test;
        BOOST_REQUIRE_NO_THROW(rb_test =
                                                           CKM::KeyProvider::generateDomainKEK(USERNAME_LONG, PASSWORD));
@@ -139,8 +123,6 @@ POSITIVE_TEST_CASE(KeyReencrypt)
 
 NEGATIVE_TEST_CASE(KeyReencrypt_incorrect_password)
 {
-       BOOST_REQUIRE_MESSAGE(isLibInitialized,
-                                                 "Library is not initialized!");
        CKM::RawBuffer rb_test;
        BOOST_REQUIRE_NO_THROW(rb_test =
                                                           CKM::KeyProvider::generateDomainKEK(USERNAME_LONG, PASSWORD));
@@ -151,8 +133,6 @@ NEGATIVE_TEST_CASE(KeyReencrypt_incorrect_password)
 
 POSITIVE_TEST_CASE(KeyGetPureDEK_after_reencrypt)
 {
-       BOOST_REQUIRE_MESSAGE(isLibInitialized,
-                                                 "Library is not initialized!");
        CKM::KeyProvider keyProvider;
        CKM::RawBuffer rb_DEK1;
        CKM::RawBuffer rb_test;