platform/core/test/security-tests.git
9 years agoMerging tizen into ckm. Stage 3. 21/38321/1
Krzysztof Jackiewicz [Thu, 16 Apr 2015 10:17:53 +0000 (12:17 +0200)]
Merging tizen into ckm. Stage 3.

Merged remote-tracking branch 'tizen.org/tizen' into ckm

Change-Id: Iffa2e26113f653cf4c6f685bc7e4dc7d25472ae5

9 years agoMerging tizen into ckm. Stage 2. 20/38320/1
Krzysztof Jackiewicz [Thu, 16 Apr 2015 10:08:44 +0000 (12:08 +0200)]
Merging tizen into ckm. Stage 2.

Merged commit '7019d2b04887994ff0f87ab8020cc367ffe1994a' into ckm

Change-Id: I80f23e4825da2bb7167d43863e6ed1331a5f5776

9 years agoRename /tests to /ckm to align with tizen branch 19/38319/1
Krzysztof Jackiewicz [Thu, 16 Apr 2015 10:01:05 +0000 (12:01 +0200)]
Rename /tests to /ckm to align with tizen branch

[Issue#] N/A
[Feature/Bug] N/A
[Problem] N/A
[Cause] N/A
[Solution] Renamed

[Verification] Compile, run tests

Change-Id: Ic24c4b694de04e44ceb6947f6628872f09def079

9 years agoMerging tizen into ckm. Stage 1. 18/38318/1
Krzysztof Jackiewicz [Thu, 16 Apr 2015 09:36:22 +0000 (11:36 +0200)]
Merging tizen into ckm. Stage 1.

Merged commit '4f20901f76f8909da0d07f8b5f8f33e8651ea135' into ckm

Conflicts:
tests/common/dbus_access.cpp
tests/common/dbus_access.h
tests/cynara-tests/common/cynara_test_env.cpp
tests/security-server-tests/security_server_clean_env.cpp

Change-Id: I246988d04c104e990af34f06b10c6b79e3e5793d

9 years agoCKM: Security-server removed from dependencies 17/38317/1
Krzysztof Jackiewicz [Wed, 15 Apr 2015 11:56:56 +0000 (13:56 +0200)]
CKM: Security-server removed from dependencies

[Issue#] N/A
[Feature/Bug] N/A
[Problem] N/A
[Cause] Security server is not used.
[Solution] Removed.

[Verification] Successfull compilation

Change-Id: I398757dcba891feedd15d6ab51fa374e879975fa

9 years agoCKM: tizen.org does not use security-server: disabling security-server tests. 66/38066/2
Maciej J. Karpiuk [Thu, 9 Apr 2015 07:57:05 +0000 (09:57 +0200)]
CKM: tizen.org does not use security-server: disabling security-server tests.

Change-Id: I47c1ed4a6f0522b9c32954696521c19373841bbf

9 years agoCKM: no more "empty password for lockscreen" logics. 36/38236/2
Maciej J. Karpiuk [Tue, 14 Apr 2015 13:15:28 +0000 (15:15 +0200)]
CKM: no more "empty password for lockscreen" logics.

Change-Id: Ie30acad07523218f5474d531cc7fcc579584181f

9 years agoRemove unused members and functions from test runner 67/29167/13
Marcin Niesluchowski [Tue, 21 Oct 2014 15:58:18 +0000 (17:58 +0200)]
Remove unused members and functions from test runner

Conflicts:
src/framework/include/dpl/test/test_runner.h

Change-Id: Id7daab6582ced29db585322775cdfd54be708b0a

9 years agoMerge branch 'cynara' into tizen 38/37338/1
Lukasz Wojciechowski [Tue, 24 Mar 2015 19:32:02 +0000 (20:32 +0100)]
Merge branch 'cynara' into tizen

Conflicts:
src/framework/include/dpl/test/test_runner.h
src/framework/src/test_runner.cpp

Change-Id: I7186c1d1e8f60e453ea5ffe4f7cfd1e1eca3a3bb

9 years agoRemove unused CollectTestsCasesList function 56/29056/12
Marcin Niesluchowski [Thu, 16 Oct 2014 14:17:18 +0000 (16:17 +0200)]
Remove unused CollectTestsCasesList function

Change-Id: Ic846bfbf38e74850be7cdfee6ca5ccc88b9ccfb5

9 years agoRemove unnecessary test result from test runner 00/28800/13
Marcin Niesluchowski [Thu, 16 Oct 2014 08:54:15 +0000 (10:54 +0200)]
Remove unnecessary test result from test runner

Change-Id: I6a5257e0f4325f76219f798bc7e352fbef81376b

9 years agoCreate class for test result 99/28799/15
Marcin Niesluchowski [Wed, 15 Oct 2014 17:26:08 +0000 (19:26 +0200)]
Create class for test result

Change-Id: I5da9105e4577805230929ca7c0057f456ef76090

9 years agoAdd PerformanceResult class 55/29055/14
Marcin Niesluchowski [Mon, 20 Oct 2014 12:49:13 +0000 (14:49 +0200)]
Add PerformanceResult class

Test time measurement framework mechanism refactoring
for performance tests.

Change-Id: I08f3206f0dcd0504cb5bae6fa22f7480d5533a36

9 years agoExtend list of tests done by security-tests-all.sh 68/37268/1
Pawel Wieczorek [Mon, 23 Mar 2015 16:24:58 +0000 (17:24 +0100)]
Extend list of tests done by security-tests-all.sh

Two more packages will be tested by executing security-tests-all.sh:
* libprivilege-control
* key-manager

Change-Id: I8fdefb6ff2c4a51060f2ac09179289b563596961

9 years agoAdd key-manager tests to test runner 67/37267/1
Pawel Wieczorek [Mon, 23 Mar 2015 16:18:48 +0000 (17:18 +0100)]
Add key-manager tests to test runner

Passing "ckm" argument to security-tests.sh script will result in
execution of "ckm-tests" binary. Previously it had to be called
explicitly.

Change-Id: Icacefde32d99832295ddaad045ae31be3d085ca8

9 years agoFix casting from and to void* 99/37199/1
Lukasz Wojciechowski [Fri, 20 Mar 2015 14:09:25 +0000 (15:09 +0100)]
Fix casting from and to void*

There were some places, where reinterpret_cast was used to cast
from or to void* type. This breaks C++ standard.
Fix replaces reinterpret_cast with static_cast.

Change-Id: I9bc5aa3307ce0b0fef4a988d14d06b01f290b853

9 years agoAdd additional libcynara-agent tests 22/37022/4
Radoslaw Bartosiak [Fri, 30 Jan 2015 16:42:31 +0000 (17:42 +0100)]
Add additional libcynara-agent tests

Add test cases for: cynara_agent_initialize(), cynara_agent_finish(),
cynara_agent_get_request(), cynara_agent_put_response()

*) tcag08_get_request_and_respond_with_wrong_id - client shall not
   receive a response.
*) tcag09_get_request_and_correct_responded_id - client shall
   receive the response with correct id.
*) tcag10_cancel_request - client shall receive the confirmation of
   its cancel action.
*) tcag11_cancel_processed_request - the cancelation of the request
   processed by the agent is possible but void.
*) tcag12_create_two_requests - processing of two requests.
*) tcag13_create_many_requests - processing of many requests and
   sending the responses by the agent in LIFO order.
*) tcag14_client_disconnects - the cancel request shall be sent by
   Cynara when client disconnects.
*) tcag15_agent_disconnects - the access denied answer shall be
   sent by Cynara when agent disconnects.

Change-Id: I45c11e79c4977bed6892166a51c336e0414fc02e
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
9 years agoUse proper RUNNER_ASSERT macros 80/36980/3
Lukasz Wojciechowski [Tue, 17 Mar 2015 15:10:06 +0000 (16:10 +0100)]
Use proper RUNNER_ASSERT macros

Don't print errno message, when it's not valid
or related to assert condition.

Change-Id: I7012d5c97c1504df3d78fec0eac997d99560e374

9 years agoAdd inner tests for deferred macros 08/35608/7
Lukasz Wojciechowski [Tue, 3 Feb 2015 18:21:11 +0000 (19:21 +0100)]
Add inner tests for deferred macros

Added 11 test cases cover all possible nestings
of deferred macros.

Change-Id: I35898876f7b2dca740836463a5744fe96972f609

9 years agoAdd inner tests for timeout mechanism 07/35607/7
Lukasz Wojciechowski [Mon, 12 Jan 2015 10:26:10 +0000 (11:26 +0100)]
Add inner tests for timeout mechanism

Inner tests are needed to check if timeout mechanism works correctly
on platform that tests are runned.
Risk of not working is elevated because it uses std::future::wait_for()
method, which implementation had bugs in older compilers.

Change-Id: I3eae4dcab59b1fcec0c46f870653d0ae18c4a85f

9 years agoApply defer macros to callbacks in cynara async client 51/34051/10
Lukasz Wojciechowski [Tue, 20 Jan 2015 14:18:37 +0000 (15:18 +0100)]
Apply defer macros to callbacks in cynara async client

After all cynara library functions were sorrounded with try catch
macros causing all exceptions to be caught, there is no way of
throwning an exception from inside of callback function.

This is where defer macros mechanism can be applied.
Now all exceptions will be rethrown after comming back from
libcynara-client-async API functions.

Change-Id: I9743557631f2b13cecddf33cb072f280ae689d0a

9 years agoAdd defer macros 50/34050/9
Lukasz Wojciechowski [Tue, 20 Jan 2015 14:17:12 +0000 (15:17 +0100)]
Add defer macros

Used to defer throwing TestException exceptions (TestFailed,
TestIgnored) by catching them and rethrowing later.

This mechanism can help in breaking test and passing test result
from places where throwing exceptions is not allowed

Change-Id: Ic9baa96596d15fccbbff4ac81b18f91b2eb89c8e

9 years agoMove non-template functions to timeout.cpp file 49/34049/8
Lukasz Wojciechowski [Tue, 20 Jan 2015 14:15:36 +0000 (15:15 +0100)]
Move non-template functions to timeout.cpp file

Leaving them in timeout.h causes double definition of functions.

Change-Id: Ic425855ffd958b2adbb16672d486fcdcedaa8897

9 years agoDefine a base TestException class 48/34048/9
Lukasz Wojciechowski [Thu, 19 Feb 2015 14:27:36 +0000 (15:27 +0100)]
Define a base TestException class

A new base class DPL::Test::TestException is defined as base for
 * DPL::Test::TestFailed (prev. DPL::Test::TestRunner::TestFailed),
 * DPL::Test::TestIgnored (prev. DPL::Test::TestRunner::Ignored).

All three classes were moved into separate files.

Common base class simplifies handling of exceptions that can be
thrown during tests.

Change-Id: I1fadb09b7781bf22a0090043a46ca48c55c9962b

9 years agoAdd basic libcynara-agent tests 62/33862/7
Lukasz Wojciechowski [Tue, 13 Jan 2015 13:53:47 +0000 (14:53 +0100)]
Add basic libcynara-agent tests

Add basic tests for libcynara-admin library:
* tcag01_set_agent_type_policy_without_plugin - check if setting
 a policy with policy type provided by not loaded plugin fails;
* tcag02_set_agent_type_policy_with_plugin_loaded - checks if
 setting policy with policy type provided by loaded plugin succeeds;
* tcag03_check_with_no_agent - run cynara check that causes usage
 of plugin needing agent (but agent is not running) and verify
 that check returns DENY;
* tcag04_agent_initialize - check initialization and deinitialization
 og agent;
* tcag05_agent_request_timeout - run agent and register it in cynara
 service, break connection by resetting cynara after timeout;
* tcag06_check_with_unregistered_agent - run cynara check that causes
 usage of plugin needing agent (agent is running but not registered)
 and verify that chack returns DENY;
* tcag07_get_request - run simplest complete agent usage scenario:
    > agent registers in cynara,
    > a check using plugin and agent is done,
    > test acts as agent receiving and verifying request,
    > an ALLOW response is sent to cynara,
    > client receives proper ALLOW answer.

Change-Id: I781e9bb88b8686334acca4f9cf2c13a13bd643d5

9 years agoUse functor object as main argument of callAndWait 47/36747/4
Lukasz Wojciechowski [Wed, 11 Mar 2015 09:44:44 +0000 (10:44 +0100)]
Use functor object as main argument of callAndWait

Previous solution was based on std::function, that causes problems
because std::function template arguments needed to be explicitely
defined.

Functor simplifies usage of callAndWait.

Change-Id: If4f8a640848e41042e6841e49354510c08db5357

9 years agoAdd synchronization after file operations 71/36971/2
Lukasz Wojciechowski [Tue, 17 Mar 2015 14:27:16 +0000 (15:27 +0100)]
Add synchronization after file operations

After creating, copying and removing files program should
wait on disc synchronization, otherwise test can fail, e.g.
when we swap database files and start cynara, which loads
old not-yet-synchronized version of db.

Change-Id: Ie5c26da859e4e2a88311bb68ed7a0138b98e87d7

9 years agoLoad default database at every cynara-test startup 70/36970/2
Lukasz Wojciechowski [Tue, 17 Mar 2015 12:31:40 +0000 (13:31 +0100)]
Load default database at every cynara-test startup

All tests assume that their are run on clear cynara database.
On real image database can contain some data. To save those data
save/restore mechanism existed. It was expanded with 3rd function
loading default database after original image database was saved.

Change-Id: If580a11b6558b8084c959366dcfa50a1ef92782c

9 years agoEnhance compareDbs() with additional information 04/33904/4
Pawel Wieczorek [Mon, 12 Jan 2015 10:05:35 +0000 (11:05 +0100)]
Enhance compareDbs() with additional information

This patch adds printing more debugging information if an error occurs.
In case of database contents mismatch all the files in pattern and
result database are listed. In case of file contents mismatch filename
of corrupted file is printed.

Change-Id: I8e2bc2a6fdc976fac65e521accd6140ddfebef7e

9 years agoAdd checksum files for tests 02/33902/5
Pawel Wieczorek [Mon, 15 Dec 2014 14:18:56 +0000 (15:18 +0100)]
Add checksum files for tests

Cynara will support database contents checksum validation shortly. This
patch adds proper checksum files to database patterns.

Change-Id: Ie1a61689765fe3f3e9fe010e7ba333ccbdae265f

9 years agoCKM: certificates refreshed (some were already expired). 85/35885/7
Maciej J. Karpiuk [Wed, 25 Feb 2015 12:58:44 +0000 (13:58 +0100)]
CKM: certificates refreshed (some were already expired).

Change-Id: Iad2449aed5ce3a2e07cdf60e0b57dce56e1e8f10

9 years agoAdd --no-verbose option to XML collector 54/29054/14
Marcin Niesluchowski [Thu, 16 Oct 2014 12:24:55 +0000 (14:24 +0200)]
Add --no-verbose option to XML collector

With --no-verbose param fail/ignore reason is not displayed

Change-Id: I62c78186c4b560f409f66ad74be3a3f4005fda42

9 years agoAdd --no-verbose option to HTML collector 52/29052/15
Marcin Niesluchowski [Thu, 16 Oct 2014 12:17:36 +0000 (14:17 +0200)]
Add --no-verbose option to HTML collector

With --no-verbose param fail/ignore reason is not displayed

Change-Id: I790d24f2db8b707df20f88e0df08ec20cf5eab03

9 years agoAdd SynchronizationPipe 92/32492/5
Aleksander Zdyb [Thu, 18 Dec 2014 10:31:02 +0000 (11:31 +0100)]
Add SynchronizationPipe

A crippled abstraction of widely praised, but often
misused communication mechanism.

Change-Id: I2bd4b63dac76711ce22331c0bc666d4cd6021240

9 years agoAdd UDSHelpers (Helpers for Unix Domain Sockets) 34/30434/7
Aleksander Zdyb [Wed, 3 Sep 2014 06:26:39 +0000 (08:26 +0200)]
Add UDSHelpers (Helpers for Unix Domain Sockets)

Change-Id: Id4c0429c325bc828d7c928e1c12d2ba9ec2b6a9f

9 years agoAdd PasswdAccess 45/32445/5
Aleksander Zdyb [Tue, 18 Nov 2014 10:07:05 +0000 (11:07 +0100)]
Add PasswdAccess

A wrapper on getpwnam() and getgrnam().

Change-Id: Ib833b6c1922ad45de3f713f29a904283d094600f

9 years agoAdd --no-verbose option to Console collector 53/29053/13
Marcin Niesluchowski [Thu, 16 Oct 2014 12:21:58 +0000 (14:21 +0200)]
Add --no-verbose option to Console collector

With --no-verbose param fail/ignore reason is not displayed

Change-Id: Id2d0b93424f0ece32cad90d23b815146f4c6d111

9 years agoModify some test codes according to key-manager's 2.4 API changes 77/36277/2
yuseok.jeon [Wed, 25 Feb 2015 09:21:41 +0000 (18:21 +0900)]
Modify some test codes according to key-manager's 2.4 API changes

Change-Id: Ibfd46fd0f3c3a4c4b11488788eabbc2bae105d2d

9 years agoFix usertype in gum-utils invocation 57/36657/1
Aleksander Zdyb [Fri, 6 Mar 2015 12:16:55 +0000 (13:16 +0100)]
Fix usertype in gum-utils invocation

Change-Id: I501a30549b0d7c5b94653250109db4aae9c1b5c7

9 years agoCKM: CC mode uses user label to read & write keys. 48/35848/3
Maciej J. Karpiuk [Wed, 25 Feb 2015 10:02:51 +0000 (11:02 +0100)]
CKM: CC mode uses user label to read & write keys.

Buxton does not allow root to modify user owned keys.

Change-Id: I106422a866fb6048ff359721dc30af68153661c8

9 years agoCKM: access control tests use more descriptive error reporting 47/35847/2
Maciej J. Karpiuk [Wed, 25 Feb 2015 09:58:31 +0000 (10:58 +0100)]
CKM: access control tests use more descriptive error reporting

Change-Id: I02ce9162f4833b9a9175e88619a418c0045d0285

9 years agoCKM: Split signture tests into two groups. 93/35893/1
Bartlomiej Grzelewski [Wed, 18 Feb 2015 15:14:57 +0000 (16:14 +0100)]
CKM: Split signture tests into two groups.

Change-Id: I3277c009ad05889ef587923731f8aba3177174bc

9 years agoMove collectors' file help to collectors' commons 02/30402/8
Marcin Niesluchowski [Mon, 17 Nov 2014 15:45:12 +0000 (16:45 +0100)]
Move collectors' file help to collectors' commons

Change-Id: I89d03b06c97de61f06bad3c483c9cf7d4442c3dd

9 years agoCKM: tests adjusted to tizenorg.
Maciej J. Karpiuk [Wed, 18 Feb 2015 11:49:18 +0000 (12:49 +0100)]
CKM: tests adjusted to tizenorg.

9 years agoInstall vconf key for testing key-manager in packaging install time.
kyungwook tak [Wed, 11 Feb 2015 06:08:03 +0000 (15:08 +0900)]
Install vconf key for testing key-manager in packaging install time.

vconf key cannot Install(set at first time)/unset in runtime.
It should be installed in package(rpm) install time.

Change-Id: I196df5cb8a7e6b6a9a0653d66dfc6e9e55e73e52
Signed-off-by: kyungwook tak <k.tak@samsung.com>
9 years agoCKM: Add new test to check if getCertificateChain return proper code.
Bartlomiej Grzelewski [Mon, 9 Feb 2015 18:15:50 +0000 (19:15 +0100)]
CKM: Add new test to check if getCertificateChain return proper code.

Change-Id: I293e6132dbe179254575940e6c51acd261e0145e

9 years agoCKM: Adopt tests to new PKCS12 api.
Bartlomiej Grzelewski [Wed, 4 Feb 2015 18:35:48 +0000 (19:35 +0100)]
CKM: Adopt tests to new PKCS12 api.

New api may take 2 passwords to decrypt data from pkcs12.

Change-Id: I6ea8e33005ce0b7b1db5cb69a265a68f2cc72398

9 years agoCKM: Fix Control::restUserPassword test.
Bartlomiej Grzelewski [Tue, 10 Feb 2015 15:33:40 +0000 (16:33 +0100)]
CKM: Fix Control::restUserPassword test.

resetUserPassword will work if no key exists for the user.

Change-Id: Idc5080dc48e3e965c4af791f86572d2897ee7a43

9 years agoCKM: Adopt tests to new api behaviour.
Bartlomiej Grzelewski [Wed, 4 Feb 2015 18:35:48 +0000 (19:35 +0100)]
CKM: Adopt tests to new api behaviour.

If Password is wrong api will return CKM_API_ERROR_AUTHENTICATION_ERROR
instead CKM_API_ERROR_SERVER_ERROR.

Change-Id: I9457414e44a1e95824371716a055bcd48855d370

9 years agoCKM: Add test for getData with broken password.
Bartlomiej Grzelewski [Wed, 4 Feb 2015 16:57:33 +0000 (17:57 +0100)]
CKM: Add test for getData with broken password.

Change-Id: Iad82b7c0523c5600a60cc5ed8d0c50a0e9a8f9a5

9 years agoCKM: Add negative test for CKM::Control::unlock function.
Bartlomiej Grzelewski [Wed, 4 Feb 2015 12:24:48 +0000 (13:24 +0100)]
CKM: Add negative test for CKM::Control::unlock function.

Change-Id: I2ddc8572d033eb7b138fe6ad255669082fc31245

9 years agoCKM: Add test for PKCS12 api.
Bartlomiej Grzelewski [Tue, 3 Feb 2015 16:31:56 +0000 (17:31 +0100)]
CKM: Add test for PKCS12 api.

Change-Id: I931405c6315053424425bec6ebfbe6e3de01d683

9 years agoCKM: Add support for CKMC_ERROR_FILE_SYSTEM error.
Bartlomiej Grzelewski [Thu, 29 Jan 2015 14:39:02 +0000 (15:39 +0100)]
CKM: Add support for CKMC_ERROR_FILE_SYSTEM error.

Change-Id: I5288d565269767b3043ba0c9ae9a4584c85c665c

9 years agoAdd tests for deprecated access control API.
Maciej J. Karpiuk [Mon, 2 Feb 2015 09:44:31 +0000 (10:44 +0100)]
Add tests for deprecated access control API.

[Issue#] N/A
[Feature/Bug] bug discovered in the key-manager. This commit verifies bug resolution.
[Problem] deprecated access control API incorrectly mapped values into permissions.
[Solution] fix to key-manager plus appropriate tests in the security-tests.
[Verification] all T300_CKMC_ACCESS_CONTROL_C_API should pass.

Change-Id: I9bc52b0e493bb7dbde14b5793d18d5b924806648

9 years agoCKM:Add compilation flag for MDPP
Krzysztof Jackiewicz [Tue, 27 Jan 2015 09:45:28 +0000 (10:45 +0100)]
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

9 years agoRUNNER_ASSERT wrappers moved to ckm-common.h
Krzysztof Jackiewicz [Mon, 26 Jan 2015 13:04:46 +0000 (14:04 +0100)]
RUNNER_ASSERT wrappers moved to ckm-common.h

[Issue#] N/A
[Feature/Bug] N/A
[Problem] N/A
[Cause] Wrappers for RUNNER_ASSERT could be used by other tests.
[Solution] Wrappers moved to ckm-common.h

[Verification] Successfull compilation

Change-Id: Id9766c09d07c142814c3f3acd65a7b581ab5a061

9 years agoReplace deprecated cert chain API with new one
Krzysztof Jackiewicz [Wed, 21 Jan 2015 13:22:18 +0000 (14:22 +0100)]
Replace deprecated cert chain API with new one

[Issue#] N/A
[Feature/Bug] N/A
[Problem] Old cert chain API is deprecated
[Cause] N/A
[Solution] Use new API

[Verification] Run tests

Change-Id: Ie1f6197af0afbebfc39e9661c010f176e718f7d3

9 years agoTest for certificate chain API
Krzysztof Jackiewicz [Wed, 10 Dec 2014 08:19:18 +0000 (09:19 +0100)]
Test for certificate chain API

[Issue#] N/A
[Feature/Bug] N/A
[Problem] N/A
[Cause] N/A
[Solution] Test for new certificate chain API added

[Verification] Run tests

Change-Id: I2b27db15d3424b8ed511509aadd77af829f9a055

9 years agoHelper functions for certificate chains
Krzysztof Jackiewicz [Thu, 18 Dec 2014 21:02:15 +0000 (22:02 +0100)]
Helper functions for certificate chains

[Issue#] N/A
[Feature/Bug] N/A
[Problem] Excessive code
[Cause] N/A
[Solution] Helper functions used

[Verification] Compile and run tests

Change-Id: I361b6f117b360a15f514cc1fce4e7c3f9bb39d89

9 years agoCertificate chain tests moved to separate file
Krzysztof Jackiewicz [Thu, 18 Dec 2014 17:26:03 +0000 (18:26 +0100)]
Certificate chain tests moved to separate file

[Issue#] N/A
[Feature/Bug] N/A
[Problem] Cpp file too long
[Cause] All CAPI tests in single file
[Solution] Certificate chains part moved to separate file

[Verification] Compile & run tests

Change-Id: Iada8d00c0356aab97defdf3ef60c0f6ebb9088cf

9 years agoCKM: Add error description in error message.
Bartlomiej Grzelewski [Fri, 16 Jan 2015 19:47:43 +0000 (20:47 +0100)]
CKM: Add error description in error message.

Change-Id: I9769865577579500bc774332dcc1fee12d828a00

9 years agoUpdate cc-mode tests with "Ready" setting
Krzysztof Jackiewicz [Tue, 20 Jan 2015 11:23:53 +0000 (12:23 +0100)]
Update cc-mode tests with "Ready" setting

[Issue#] N/A
[Feature/Bug] N/A
[Problem] "Ready" mode is not tested
[Cause] N/A
[Solution] Tests updated

[Verification] Run cc-mode tests

Change-Id: I16a86d9d10b5cef3ebbbd0880f981ef43b0ae6bc

9 years agoFixed dbus systemd interface
Krzysztof Jackiewicz [Thu, 15 Jan 2015 17:51:22 +0000 (18:51 +0100)]
Fixed dbus systemd interface

[Issue#] N/A
[Feature/Bug] N/A
[Problem] Services were not properly restarted. DBusAccess was waiting forever
for systemd job completion.
[Cause] Signal filter was set up too late
[Solution] Signal filter is set up before sending requests to systemd.

[Verification] Run CCMode tests.

Change-Id: I2e71a54ba44ddf0878a065e3b3bb8a7d117a6e3b

9 years agoAdd ocsp test for CAPI.
Bartlomiej Grzelewski [Fri, 16 Jan 2015 16:53:21 +0000 (17:53 +0100)]
Add ocsp test for CAPI.

Change-Id: I3e2b8f862f3129b21795e352366422364ce893fa

9 years agoRemove pointless code from capi tests.
Bartlomiej Grzelewski [Wed, 14 Jan 2015 16:21:08 +0000 (17:21 +0100)]
Remove pointless code from capi tests.

Change-Id: I7d5f5a03517da471c6aad5c03746f5c8a66ffb31

9 years agoAdd tests for storing PKCS12 files.
Maciej J. Karpiuk [Fri, 14 Nov 2014 15:08:52 +0000 (16:08 +0100)]
Add tests for storing PKCS12 files.

Change-Id: I444b07febf2dc78a3ac2a952f1cd29141716ecb9

9 years agoCAPI changes (set permission, remove alias): tests adjusted.
Maciej J. Karpiuk [Wed, 17 Dec 2014 14:31:39 +0000 (15:31 +0100)]
CAPI changes (set permission, remove alias): tests adjusted.

Change-Id: I1601606f9e4303d83b9840082c7093d9ac751b0a

9 years agoCAPI tests adjusted to new password logic
Krzysztof Jackiewicz [Mon, 15 Dec 2014 20:24:49 +0000 (21:24 +0100)]
CAPI tests adjusted to new password logic

[Issue#] N/A
[Feature/Bug] N/A
[Problem] N/A
[Cause] Password logic have changed
[Solution] Tests adjusted

[Verification] Run all CAPI tests

Change-Id: Ifb9a730b749eafa56d5107d13148935ef7353f60

9 years agoSecurity-server and CKM integration tests.
Bartlomiej Grzelewski [Fri, 9 Jan 2015 18:11:03 +0000 (19:11 +0100)]
Security-server and CKM integration tests.

Change-Id: I6ed1a68c2b7644c390d5ad05fe1512fc67e4dc80

9 years agoAdd test for using proper DKEK key to decrypt data.
Maciej J. Karpiuk [Mon, 8 Dec 2014 15:43:29 +0000 (16:43 +0100)]
Add test for using proper DKEK key to decrypt data.

Issue: another label is accessing data, while cached DKEK on data save
was already removed from the cache. This scenario was failing before
key-manager commit 4fe08778f9c31a698c6faace9b13fd6c5a4d9a7c.

Change-Id: I04c26c5ce5a86e83ab84ed78758984f7a0c2b5e4

9 years agoCKM table separation: tests adjusted to new C++ API.
Maciej J. Karpiuk [Thu, 13 Nov 2014 15:53:12 +0000 (16:53 +0100)]
CKM table separation: tests adjusted to new C++ API.

Change-Id: I74f742a75190fd66618cf0960836c3d7907059d4

9 years agoAdd tests for scenario trying to save/modify other label's data.
Maciej J. Karpiuk [Fri, 28 Nov 2014 16:15:29 +0000 (17:15 +0100)]
Add tests for scenario trying to save/modify other label's data.

Change-Id: I3940c7c88cb1e8bbd4f11cc04eaef1755b72a246

9 years agoAccess Control layer: tests adjusted to C++ API changes.
Maciej J. Karpiuk [Wed, 26 Nov 2014 14:39:52 +0000 (15:39 +0100)]
Access Control layer: tests adjusted to C++ API changes.

Change-Id: Ia3b045ab7a935d37186dee37de730ddea4d0ec1b

9 years agoTests use new CC variable scheme (Disabled means device disabled, not CC-mode disabled).
Maciej J. Karpiuk [Wed, 19 Nov 2014 09:57:59 +0000 (10:57 +0100)]
Tests use new CC variable scheme (Disabled means device disabled, not CC-mode disabled).

Minor logging change in CAPI tests (error code was not logged).

Change-Id: I2bedc75da254ee87977453aac736861162890baa

9 years agoCommonCriteria tests refactored and updated
Krzysztof Jackiewicz [Tue, 28 Oct 2014 17:02:04 +0000 (18:02 +0100)]
CommonCriteria tests refactored and updated

[Verification] Run ckm-tests --group=CKM_CC_MODE

Change-Id: Idb3e7a8d1e0df2913b3537d7cc4f109f12fffb0f

9 years agoStart&stop support added to DBusAccess
Krzysztof Jackiewicz [Thu, 30 Oct 2014 15:59:25 +0000 (16:59 +0100)]
Start&stop support added to DBusAccess

[Verification] Run security-server-tests-password --output=text
to make sure existing tests are not broken

Change-Id: Ib5b1353c5892fb3685ace4f8f6226ab842c07ec8

9 years agoAlias is not unique user-wide: modified test set.
Maciej J. Karpiuk [Wed, 22 Oct 2014 10:28:56 +0000 (12:28 +0200)]
Alias is not unique user-wide: modified test set.

Change-Id: I90577f4eaf02c24f5c7d390820c9de6817fc2142

9 years agoAdd service-side data verification test.
Maciej J. Karpiuk [Thu, 16 Oct 2014 13:25:04 +0000 (15:25 +0200)]
Add service-side data verification test.

Normally, data is validated on the client side.
New tests verify if data is verified on the service side.

Change-Id: Ia6f8ab71b8d03c0dea3140f4e2fb4bc175a26f9d

9 years agoMerge branch 'tizen' into cynara 91/35491/1
Marcin Niesluchowski [Mon, 16 Feb 2015 13:24:04 +0000 (14:24 +0100)]
Merge branch 'tizen' into cynara

Change-Id: I52bb94b85304e141e2462067d8c8dae80fe53081

9 years agoAdd inner security-tests tests 30/35130/5
Lukasz Wojciechowski [Mon, 9 Feb 2015 13:26:04 +0000 (14:26 +0100)]
Add inner security-tests tests

Inner tests might be useful in case of:
 * verification of advanced security-tests mechanisms;
 * testing if platform/image support features used in tests.

Change-Id: Ibd9b5d97af33742434d00fd3d682456c1a8d51ff

9 years agoMove tests source code from "tests" to "src" directory 29/35129/2
Lukasz Wojciechowski [Mon, 9 Feb 2015 10:16:23 +0000 (11:16 +0100)]
Move tests source code from "tests" to "src" directory

Change-Id: Icb325be4a37b9937290d7f3a4d35a1b3625b223a

9 years agoMerge branch 'cynara' into tizen 77/34277/2
Marcin Niesluchowski [Thu, 22 Jan 2015 14:31:17 +0000 (15:31 +0100)]
Merge branch 'cynara' into tizen

Conflicts:
tests/common/dbus_access.cpp
tests/common/dbus_access.h
tests/cynara-tests/common/cynara_test_env.cpp
tests/framework/include/dpl/test/test_runner.h

Change-Id: I91f595f8a92ceafd071c4db0d70f7431447bab48

9 years agoRename file operation functions of cynara-tests 67/34267/2
Adam Malinowski [Thu, 22 Jan 2015 12:43:07 +0000 (13:43 +0100)]
Rename file operation functions of cynara-tests

Change-Id: Ie24d7360dacf9f236ed36eaaaafbba1913d6e8dd

9 years agoRefactor gdbbacktrace() function 51/33851/12
Marcin Niesluchowski [Thu, 15 Jan 2015 12:48:09 +0000 (13:48 +0100)]
Refactor gdbbacktrace() function

Add safer, less redundant code and make it part of DPL namespace

Change-Id: I19e4704f4600d9720e939b0d76aa143c5d82ec2f

9 years agoAdd timeout mechanism for time-limited function calls 01/33501/5
Lukasz Wojciechowski [Mon, 12 Jan 2015 10:16:34 +0000 (11:16 +0100)]
Add timeout mechanism for time-limited function calls

Timeout mechanism:
1) launches given function in new thread;
2) waits given time period;
3) cancels called function using custom user CancelFunction;
4) checks if function has finished in expected way;
5) returns function answer (value or exception).

Change-Id: Ia65d271095712e6afaaac96932f8d14d61b1702a

9 years agoAdd Agent class wrapping usage of libcynara-agent 87/33387/5
Lukasz Wojciechowski [Thu, 8 Jan 2015 10:24:27 +0000 (11:24 +0100)]
Add Agent class wrapping usage of libcynara-agent

With Agent object tests can play role of cynara agent and
communicate with cynara service. That can be useful for:
* testing libcynara-agent library;
* using agent in plugins testing;
* using agent in asynchronous client testing.

Change-Id: Idc783fa963074d5ff6f1dedb6a89b6aae6f65dbe

9 years agoAdd test-agent plugin 86/33386/5
Lukasz Wojciechowski [Fri, 9 Jan 2015 01:44:45 +0000 (02:44 +0100)]
Add test-agent plugin

This is a test plugin, that sends all requests to agent.
Security tests can play role of this agent, so they can decide
about time and value of a response.

Change-Id: I278229810a84cdb4a3ff01ad8ef714019507f0c1

9 years agoAdd agent data wrapping functions 85/33385/5
Lukasz Wojciechowski [Fri, 9 Jan 2015 01:41:17 +0000 (02:41 +0100)]
Add agent data wrapping functions

Add functions for easy joining and spliting data strings
used in communication between agent and plugins:
* wrapAgentData;
* unwrapAgentData.

This functions are defined in new file plugins.cpp - a common file
for both agent and plugins.

Change-Id: I29494928d752832aef7c8e14204a7e4ce63a911e

9 years agoAdd tests for cynara_admin_list_policies_descriptions 85/33085/8
Lukasz Wojciechowski [Mon, 5 Jan 2015 10:26:21 +0000 (11:26 +0100)]
Add tests for cynara_admin_list_policies_descriptions

Each of added tests uses the fact that every cynara test is wrapped in
CynaraTestEnv that saves cynara service plugins.
Every test clears cynara service plugins folder and restarts cynara.
Then proper combination of plugins (sometimes none) are loaded.
There are 4 tests added:
* tc30_admin_list_descriptions_no_plugins - no plugins are loaded,
 there are only default cynara policies;
* tc31_admin_list_descriptions_1_plugin_single_policy;
* tc32_admin_list_descriptions_1_plugin_multiple_policy;
* tc33_admin_list_descriptions_multiple_plugins.

Change-Id: Id778477c35a6d65a7d4f71df03dcccefcbb6e756

9 years agoAdd wrap for cynara_admin_list_policies_description 84/33084/8
Lukasz Wojciechowski [Mon, 5 Jan 2015 10:23:32 +0000 (11:23 +0100)]
Add wrap for cynara_admin_list_policies_description

Add method Admin::listDescriptions executing
cynara_admin_list_policies_description and checking if received result
match expected.

Change-Id: I1d729f83e2719360be5e4cdf405409561377c410

9 years agoAdd loadServicePlugins() for setting plugins env 27/33527/4
Lukasz Wojciechowski [Mon, 12 Jan 2015 16:55:23 +0000 (17:55 +0100)]
Add loadServicePlugins() for setting plugins env

Added function removes all cynara service plugins
and then import and load plugins from given directory.

Change-Id: I1fa559111c70c04e7522089a2bfed4ec9837f590

9 years agoEnhance CynaraTestEnv with operations on service plugins 83/33083/6
Lukasz Wojciechowski [Fri, 2 Jan 2015 19:18:13 +0000 (20:18 +0100)]
Enhance CynaraTestEnv with operations on service plugins

save() and restore() methods were enhanced with saving and restoring
cynara service plugins libraries.

Change-Id: If21707314d4a628db7c9d4034f1d4d7a9e82c55b

9 years agoIntroduce CynaraMask - a scoped cynara.service masker 26/33526/3
Lukasz Wojciechowski [Mon, 12 Jan 2015 16:13:17 +0000 (17:13 +0100)]
Introduce CynaraMask - a scoped cynara.service masker

Creation of CynaraMask object causes cynara.service to be masked and stopped.
Its removal causes cynara to be unmasked and run again.

Change-Id: Id7c20093fbd4ec19cdba783b20225ece04be5dfb

9 years agoSeparate file operations into separate file 25/33525/3
Lukasz Wojciechowski [Mon, 12 Jan 2015 15:34:56 +0000 (16:34 +0100)]
Separate file operations into separate file

All files operations done in cynara_test_env are moved to new namespace FileOperations
and implemented in cynara_test_file_operations.cpp file.
cynaraDbExists() function was generalized to dirExists(string) function.

Change-Id: Ic610078330074a648dbb24ddec7297a337a41de0

9 years agoAdd test cynara service plugins 57/33057/4
Lukasz Wojciechowski [Fri, 2 Jan 2015 17:09:17 +0000 (18:09 +0100)]
Add test cynara service plugins

There are two added plugins:
* single-policy plugin - declaring single policy type handling
* multiple-policy plugin - declaring multiple policy types handling

Plugins always return DENY policy type as result of check or update.
They are just test stubs for testing cynara_admin_list_policies_description.
Implementation of both plugins is embedded in BaseCynaraTestPlugin class.

Supported policies descriptions are put into plugins.h for later use in tests.

Change-Id: I38f4bcfe9624992eea3ef5a015885a397f5a0380

9 years agoRemove description param from test result collecting function 72/28772/8
Marcin Niesluchowski [Wed, 15 Oct 2014 15:44:38 +0000 (17:44 +0200)]
Remove description param from test result collecting function

Change-Id: I75f757abd6350456cbf572833b68a7a4aa8647e5

9 years agoFix uninitialized variable in Admin::listPolicies() 82/33082/1
Lukasz Wojciechowski [Fri, 2 Jan 2015 19:32:12 +0000 (20:32 +0100)]
Fix uninitialized variable in Admin::listPolicies()

struct cynara_admin_policy **policies was uninitialized.
Normally it should be filled with cynara_admin_list_policies() call.
However, when that function failes, it leaves policies unaffected.
If this pointer is not NULL then it is being freed after it is used
to construct vector of policies.

Change-Id: Iff469205035a5240eee64ec87ea724b83577d105

9 years agoAdd tests for cynara_admin_erase 49/33049/2
Lukasz Wojciechowski [Fri, 2 Jan 2015 14:28:42 +0000 (15:28 +0100)]
Add tests for cynara_admin_erase

All tests try erasing policies in different scenarios and then verify
if proper policies were removed from proper buckets, but listing what
is left and comparing to expected result.

There are 7 tests added:
* tc23_admin_erase_empty_bucket - erase policies from empty bucket;
* tc24_admin_erase_no_bucket - try to erase from not existing bucket;
* tc25_admin_erase_single_bucket - check all posibilities of matching
 policies during erase;
* tc26_admin_erase_recursive_not_linked_buckets - erase with recursive
 flag set to TRUE, but in case where no policy lead to subbucket;
* tc27_admin_erase_recursive_linked_buckets - erase with recursive flag
 set to TRUE with existance of policy leading to subbucket;
* tc28_admin_erase_non_recursive_linked_buckets - erase with recursive
 flag set to FALSE with existance of policy leading to subbucket;
* tc29_admin_erase_recursive_from_sub_bucket - start erase test in
 subbucket and check if parent bucket stays unaffected by erase.

Change-Id: Ib712a028d97773e70b98de85c51aff0238bb8586

9 years agoAdd wrap for cynara_admin_list_erase in Admin class 48/33048/2
Lukasz Wojciechowski [Fri, 2 Jan 2015 13:02:16 +0000 (14:02 +0100)]
Add wrap for cynara_admin_list_erase in Admin class

Add method erasePolicies executing cynara_admin_erase
and checking if received result match expected.

Change-Id: I21f9dfa542fe931e56b4e09ec00712ab539d48ef

9 years agoAdd tests for cynara_admin_list_policies 32/33032/3
Lukasz Wojciechowski [Wed, 31 Dec 2014 15:03:57 +0000 (16:03 +0100)]
Add tests for cynara_admin_list_policies

There are 3 tests:
* tc20_admin_list_empty_bucket - test listing policies from empty bucket
* tc21_admin_list_no_bucket - test listing policies from non-existing bucket
* tc22_admin_list_bucket - test listing policies from fully filled bucket

Change-Id: I814ceacf367d63b73b746689ab28e115bf38adfa