From: Krzysztof Jackiewicz Date: Tue, 27 Jan 2015 09:45:28 +0000 (+0100) Subject: CKM:Add compilation flag for MDPP X-Git-Tag: security-manager_5.5_testing~9^2~118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d809178e1f11602965e98a9e78f8dc5df9e40f09;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git CKM:Add compilation flag for MDPP [Issue#] N/A [Feature/Bug] N/A [Problem] Failing CC mode tests [Cause] Compilation flag that disables MDPP logic has been introduced in key-manager [Solution] The same flag added to tests. When MDPP is disabled we expect reading private keys to succeed. [Verification] Compile and install key-manager and tests. Run: ckm-tests --group=CKM_CC_MODE Change-Id: I497c703108b6e2ee21599311beaa0d153c147d13 --- diff --git a/packaging/security-tests.spec b/packaging/security-tests.spec index 0978f8d9..00f4cc64 100644 --- a/packaging/security-tests.spec +++ b/packaging/security-tests.spec @@ -45,6 +45,9 @@ cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DDPL_LOG="ON" \ -DVERSION=%{version} \ -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:DEBUG} \ +%if "%{sec_product_feature_security_mdfpp_enable}" == "1" + -DSECURITY_MDFPP_STATE_ENABLE=1 \ +%endif -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCYNARA_DB_DIR=%{_localstatedir}/cynara/db \ -DAPP_USER=security-tests-app diff --git a/tests/ckm/CMakeLists.txt b/tests/ckm/CMakeLists.txt index 66e51d87..d4c0c9fc 100644 --- a/tests/ckm/CMakeLists.txt +++ b/tests/ckm/CMakeLists.txt @@ -20,6 +20,14 @@ INCLUDE(FindPkgConfig) +# mdpp flag +IF (DEFINED SECURITY_MDFPP_STATE_ENABLED) + MESSAGE("SECURITY_MDFPP_STATE_ENABLE ENABLED !") + ADD_DEFINITIONS("-DSECURITY_MDFPP_STATE_ENABLE") +ELSE (DEFINED SECURITY_MDFPP_STATE_ENABLE) + MESSAGE("SECURITY_MDFPP_STATE_ENABLE DISABLED !") +ENDIF (DEFINED SECURITY_MDFPP_STATE_ENABLE) + # Dependencies PKG_CHECK_MODULES(CKM_DEP libsmack diff --git a/tests/ckm/cc-mode.cpp b/tests/ckm/cc-mode.cpp index dd79f1d3..d740e757 100644 --- a/tests/ckm/cc-mode.cpp +++ b/tests/ckm/cc-mode.cpp @@ -145,6 +145,10 @@ void read_key(ManagerShPtr& manager, const Alias& alias, int expected) { void read_keys(int expected) { +// if mdpp is disabled at compilation time we expect that read_key always succeeds +#ifndef DSECURITY_MDFPP_STATE_ENABLE + expected = CKM_API_SUCCESS; +#endif auto manager = Manager::create(); read_key(manager, rsa_pri_alias, expected);