platform/core/test/security-tests.git
8 years agoYACA: Helper functions for CMAC tests
Lukasz Pawelczyk [Tue, 28 Jun 2016 16:20:03 +0000 (18:20 +0200)]
YACA: Helper functions for CMAC tests

Change-Id: I2f149eb032fe118c6acc5e3be8463aec593843cc

8 years agoYACA: Drop the digest context reuse testing
Lukasz Pawelczyk [Tue, 28 Jun 2016 14:33:06 +0000 (16:33 +0200)]
YACA: Drop the digest context reuse testing

Change-Id: I541fbc84a033270d0b30d22870f886846467b4be

8 years agoChanged socket label comparison in tests 57/76057/2
Tomasz Swierczek [Wed, 22 Jun 2016 12:37:18 +0000 (14:37 +0200)]
Changed socket label comparison in tests

Setting up application security context no longer changes opened socket labels.

Change-Id: I060351dca6781dd12cf8c76a760eb4e71ff2fe33

8 years agoAdd tests for cynara-creds-dbus 38/30438/17
Aleksander Zdyb [Wed, 11 Mar 2015 11:02:01 +0000 (12:02 +0100)]
Add tests for cynara-creds-dbus

Change-Id: Iea7f5e9290899302cd4b2c992110895591ae8903
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
Signed-off-by: Lukasz Kostyra <l.kostyra@samsung.com>
8 years agoYACA: yaca sign/verify vector tests 91/76091/2
Lukasz Pawelczyk [Wed, 22 Jun 2016 11:51:15 +0000 (13:51 +0200)]
YACA: yaca sign/verify vector tests

Change-Id: Ib062a4f77e493604da5d894d4b856cba7cb47027

8 years agoYACA: yaca sign vector tests 90/76090/2
Lukasz Pawelczyk [Wed, 22 Jun 2016 14:25:26 +0000 (16:25 +0200)]
YACA: yaca sign vector tests

Change-Id: Ib4485dc497108a0f00c6c8dcf91fcbb09b843af0

8 years agoYACA: keytype2str helper function 89/76089/2
Lukasz Pawelczyk [Wed, 22 Jun 2016 14:17:43 +0000 (16:17 +0200)]
YACA: keytype2str helper function

Make it more generic with ENUM_DESCRIBE

Change-Id: I27ecd5832c1fc2d43dd82bf4399262d9745947f9

8 years agoYACA: add key_type handling in the test vector API 87/76087/2
Lukasz Pawelczyk [Wed, 22 Jun 2016 11:50:27 +0000 (13:50 +0200)]
YACA: add key_type handling in the test vector API

Change-Id: I2aa8b6de1ac9cd3d9d3a4e29620abd01ac434a90

8 years agoYACA: Use Buffer instead of vector<char> 70/76270/7
Krzysztof Jackiewicz [Thu, 23 Jun 2016 08:14:41 +0000 (10:14 +0200)]
YACA: Use Buffer instead of vector<char>

Change-Id: Ibc3b3b63ba250176b5168fa665ea8bc8482a9864

8 years agoYACA: Use get_output_length() where possible 66/76266/7
Krzysztof Jackiewicz [Thu, 23 Jun 2016 08:08:01 +0000 (10:08 +0200)]
YACA: Use get_output_length() where possible

Change-Id: I484b8cad6ed57968c167e85a2ab03448e8b8cc30

8 years agoYACA: Tests for digest simple API 23/75823/8
Krzysztof Jackiewicz [Tue, 21 Jun 2016 13:55:34 +0000 (15:55 +0200)]
YACA: Tests for digest simple API

Change-Id: I83936cc9458dedc9c9c8626e441f5b0e18e94291

8 years agoYACA: Test digest context reuse 18/75618/9
Krzysztof Jackiewicz [Mon, 20 Jun 2016 15:59:48 +0000 (17:59 +0200)]
YACA: Test digest context reuse

Change-Id: I563d7ca6d16169876fac8a2a636dfa58f2747238

8 years agoYACA: Binary input message digest tests 17/75617/9
Krzysztof Jackiewicz [Mon, 20 Jun 2016 15:44:27 +0000 (17:44 +0200)]
YACA: Binary input message digest tests

Change-Id: I588fe4fbe707e3b7477272eb9f629e55694660bd

8 years agoYACA: Digest ASCII test vectors 16/75616/9
Krzysztof Jackiewicz [Mon, 20 Jun 2016 14:28:54 +0000 (16:28 +0200)]
YACA: Digest ASCII test vectors

Change-Id: Id07a3b696f2295f39a42bf497f6aba050b0470ce

8 years agoYACA: Fix: replace BufPtr with ChrPtr 16/76316/1
Krzysztof Jackiewicz [Thu, 23 Jun 2016 10:32:57 +0000 (12:32 +0200)]
YACA: Fix: replace BufPtr with ChrPtr

Change-Id: I009691d114910b6758a3f24132cdbc3245f7fa2d

8 years agoYACA: Crypto tests 86/75786/3
Krzysztof Jackiewicz [Tue, 21 Jun 2016 10:30:18 +0000 (12:30 +0200)]
YACA: Crypto tests

Change-Id: I8974001c316fca85cb3ab4cc485c70d82e5bc859

8 years agoYACA: Test vector helpers 08/75608/6
Krzysztof Jackiewicz [Mon, 20 Jun 2016 10:50:44 +0000 (12:50 +0200)]
YACA: Test vector helpers

Change-Id: I09bb1c03a8ae960f1f788b9a8dca8c1331f5f07f

8 years agoYACA: Key import/export invalid param tests 90/75590/5
Lukasz Pawelczyk [Mon, 20 Jun 2016 13:26:11 +0000 (15:26 +0200)]
YACA: Key import/export invalid param tests

Change-Id: Ib633c376518d9a79376a0f7017d3f0cb929a9be1

8 years agoYACA: Simple key import/export wrappers for auto types 89/75589/4
Lukasz Pawelczyk [Mon, 20 Jun 2016 13:25:28 +0000 (15:25 +0200)]
YACA: Simple key import/export wrappers for auto types

Change-Id: I4364d24c5b10bc195803918aeec198e117cb2788

8 years agoSM: remove app paths before uninstall 83/65183/3
Zofia Abramowska [Thu, 7 Apr 2016 15:58:51 +0000 (17:58 +0200)]
SM: remove app paths before uninstall

Change-Id: Iaa994be25d48cdf51d745f5803ff7779d7fad057

8 years agoSM: Make app names unique in sharing tests 82/65182/3
Zofia Abramowska [Thu, 7 Apr 2016 15:08:05 +0000 (17:08 +0200)]
SM: Make app names unique in sharing tests

Change-Id: I5e2cc18d63993ef1bd6449faa238fe00ca8c0460

8 years agoSM: Refactor and add few new private sharing tests 64/61664/4
Zofia Abramowska [Wed, 9 Mar 2016 11:39:11 +0000 (12:39 +0100)]
SM: Refactor and add few new private sharing tests

Change-Id: Ia89252bbf39739427ee2e96437c2109802728765

8 years agoSM: Add const to proper AppInstallHelper methods 43/66743/2
Zofia Abramowska [Wed, 20 Apr 2016 14:47:47 +0000 (16:47 +0200)]
SM: Add const to proper AppInstallHelper methods

Change-Id: Ia10c03b99381c9babd0d0eaa82b5aefa5644d9c0

8 years agoSM: AppInstallHelper add pkg name setting 63/61663/4
Zofia Abramowska [Wed, 9 Mar 2016 11:38:58 +0000 (12:38 +0100)]
SM: AppInstallHelper add pkg name setting

Change-Id: I7feba7a77b75e227a0d42c9d7a8d5766979be00e

8 years agoSM: Add simple private sharing uninstall tests 62/61662/4
Zofia Abramowska [Mon, 29 Feb 2016 15:16:11 +0000 (16:16 +0100)]
SM: Add simple private sharing uninstall tests

Change-Id: If2c3be38090ceca9ffbd91b19f0d91bbf3765a22

8 years agoYACA: Check openssl errors even if test passes 97/75797/4
Krzysztof Jackiewicz [Tue, 21 Jun 2016 11:33:17 +0000 (13:33 +0200)]
YACA: Check openssl errors even if test passes

Change-Id: Ib1efae6d2edc3a37ed2813ae8774cd66b0522a2f

8 years agoYACA: Base signature tests, without the actual sign/verify operations 93/75093/6
Lukasz Pawelczyk [Thu, 16 Jun 2016 12:30:08 +0000 (14:30 +0200)]
YACA: Base signature tests, without the actual sign/verify operations

Change-Id: Idfc60b0eb2496f829c2582bb5c8e3a4329498f0f

8 years agoYACA: Test common functions for signature tests 92/75092/4
Lukasz Pawelczyk [Thu, 16 Jun 2016 12:29:53 +0000 (14:29 +0200)]
YACA: Test common functions for signature tests

Change-Id: I9bbae297e19eeb5852c8a7502a95082b244f2505

8 years agoYACA: Message digest negative tests 25/74825/9
Krzysztof Jackiewicz [Wed, 15 Jun 2016 15:38:32 +0000 (17:38 +0200)]
YACA: Message digest negative tests

Change-Id: I15229a5b190f0729a44012b1a7eb3bbcd4af928c

8 years agoYACA: Add helpers for digest, hmac, random buffers 24/74824/8
Krzysztof Jackiewicz [Wed, 15 Jun 2016 15:34:03 +0000 (17:34 +0200)]
YACA: Add helpers for digest, hmac, random buffers

Change-Id: I61c4d545adbcf39c2ecdca588cc1feb29f6c0e99

8 years agoMerge remote-tracking branch 'tizen.org/tizen' into yaca 26/74826/1
Krzysztof Jackiewicz [Wed, 15 Jun 2016 15:43:40 +0000 (17:43 +0200)]
Merge remote-tracking branch 'tizen.org/tizen' into yaca

Change-Id: Id96c2fe8192977dc7b02bcfe3b830172bfa7fa41

8 years agoYACA: Stress tests for multiple threads 75/73575/12
Krzysztof Jackiewicz [Wed, 8 Jun 2016 12:25:45 +0000 (14:25 +0200)]
YACA: Stress tests for multiple threads

Tests concurrency issues and library/thread initialization/cleanup.

Run: yaca-test --group=T8000_YACA_STRESS

Change-Id: I30696dcb99ba5bf164e4d84c2bfbc7f80514ef13

8 years agoYACA: yaca_initialize/cleanup tests 49/71449/17
Krzysztof Jackiewicz [Wed, 25 May 2016 10:50:30 +0000 (12:50 +0200)]
YACA: yaca_initialize/cleanup tests

Change-Id: I535c25150d236318515e699e5f3e2321692a3e4c

8 years agoYACA: Key generation and getter tests 43/71243/20
Krzysztof Jackiewicz [Tue, 24 May 2016 15:16:30 +0000 (17:16 +0200)]
YACA: Key generation and getter tests

Change-Id: I78d7aa7bbaef81fa49a9900d7b18026673079909

8 years agoExclude main and std:: entries from gdb backtrace for clarity 12/74512/1
Krzysztof Jackiewicz [Mon, 13 Jun 2016 12:36:51 +0000 (14:36 +0200)]
Exclude main and std:: entries from gdb backtrace for clarity

Change-Id: I235d129f5aa7bc840fca262ffc1df42026f5968d

8 years agoYACA: Add wrappers for yaca API 74/73574/11
Krzysztof Jackiewicz [Mon, 13 Jun 2016 12:50:33 +0000 (14:50 +0200)]
YACA: Add wrappers for yaca API

- Key generation
- Public key extraction
- Context creation
- Buffer allocation

Change-Id: Ifdde9ff0820ceda7bee4fce85c576322c312fb12

8 years agoYACA: Add helper types/functions for pointer management 73/73573/11
Krzysztof Jackiewicz [Mon, 13 Jun 2016 12:49:38 +0000 (14:49 +0200)]
YACA: Add helper types/functions for pointer management

Change-Id: Iecdd6e8bfc36477a7c20c081a7788073fff66c60

8 years agoFixed expected return value & improper usage of getUserStruct 09/73009/4
Tomasz Swierczek [Fri, 3 Jun 2016 12:12:51 +0000 (14:12 +0200)]
Fixed expected return value & improper usage of getUserStruct

Accessing another user's policy without privilege should be treated as error.
getUserStruct needs to be run in privileged environment (otherwise getpwnam
returns EACCESS).

Change-Id: Id1185deddcded420a409386605d20954d58b6bb0

8 years agoAdjusted privilege-related tests to privacy privileges 04/72604/3
Tomasz Swierczek [Wed, 1 Jun 2016 17:37:54 +0000 (19:37 +0200)]
Adjusted privilege-related tests to privacy privileges

Change-Id: I008235e8a58be9a8d58aadaf21b66ffe898f8203

8 years agoYACA: Add common helper functions and structs 42/71242/8
Krzysztof Jackiewicz [Tue, 24 May 2016 15:03:12 +0000 (17:03 +0200)]
YACA: Add common helper functions and structs

Change-Id: I9133eca6ad3529db9e8c7e74fffd3f767b2da690

8 years agoYACA: Add .gitignore with few common files (cmake, global, emacs) 93/72593/7
Lukasz Pawelczyk [Wed, 1 Jun 2016 16:12:46 +0000 (18:12 +0200)]
YACA: Add .gitignore with few common files (cmake, global, emacs)

Change-Id: Iefb12aee5be7afc1d6cd43d00ad1b3d9dfb218bf

8 years agoYACA: Update header names after ACR changes 25/72325/1
Krzysztof Jackiewicz [Tue, 31 May 2016 10:44:06 +0000 (12:44 +0200)]
YACA: Update header names after ACR changes

Change-Id: I07ec269352a8505461a1465bcb25a8006d3ed2c4

8 years agoSM: Fix group names 70/70970/3
Zofia Abramowska [Mon, 23 May 2016 11:45:41 +0000 (13:45 +0200)]
SM: Fix group names

Change-Id: I0806acce5be77390c6ff57e95d35df8c66344ea5

8 years agoFix security_manager_67_path_req_shared_ro_3_0 test case. 46/70546/1
Tomasz Swierczek [Thu, 19 May 2016 10:05:31 +0000 (12:05 +0200)]
Fix security_manager_67_path_req_shared_ro_3_0 test case.

The test case should allow for Tizen 3.0 app to have data/shared directory;
there should be no Smack rules to other application's data/shared directory.

Change-Id: I3f00ec55d649d116f75ce2ae4c69573ed62d08d1

8 years agosecurity-manager-tests: Add test for TrustedRW package registration 34/69334/1
Krzysztof Jackiewicz [Thu, 12 May 2016 15:25:57 +0000 (17:25 +0200)]
security-manager-tests: Add test for TrustedRW package registration

Add tests verifying proper request handling and labeling of
SECURITY_MANAGER_PATH_TRUSTED_RW path.

Verification: run security-manager-tests --regexp=trusted_rw

Change-Id: Ie2a7c52dc0e6937bbac188d3aeffea276ad4acc4

8 years agosecurity-manager-tests: Add tests for SharedRO path registration 32/69332/3
Krzysztof Jackiewicz [Thu, 12 May 2016 15:00:27 +0000 (17:00 +0200)]
security-manager-tests: Add tests for SharedRO path registration

Add tests verifying proper request handling and labeling of
SECURITY_MANAGER_PATH_OWNER_RW_OTHER_RO path.

Verification: run security-manager-tests --regexp=path_req_shared_ro

Change-Id: I3a5e0594ad37a87271d51d72ecca6e4de7c2fd84

8 years agosecurity-manager-tests: add path request tests 24/68924/2
Krzysztof Jackiewicz [Tue, 10 May 2016 10:58:55 +0000 (12:58 +0200)]
security-manager-tests: add path request tests

Add several tests for path registration API. Run with:
security-manager-tests --regexp=path_req

Change-Id: I65952c309ff37d4e41a1248e78c6f92bc06cab40

8 years agoMerge branch 'tizen' into cynara 50/69050/1
Zbigniew Jasinski [Wed, 11 May 2016 08:44:56 +0000 (10:44 +0200)]
Merge branch 'tizen' into cynara

Change-Id: I3e39ad9da3ad9b718862d6ed10baed35b29f7601
Signed-off-by: Zbigniew Jasinski <z.jasinski@samsung.com>
8 years agosecurity-manager-tests: helper API for path request testing 23/68923/1
Krzysztof Jackiewicz [Tue, 10 May 2016 10:56:29 +0000 (12:56 +0200)]
security-manager-tests: helper API for path request testing

Add wrappers for path request wrapper and path registration.

Change-Id: Ia5d285b4873ca204fdde1edc0434aa7bf8cf48cf

8 years agosecurity-manager-tests: fix expected error of security_manager_49b_* 77/68677/1
Krzysztof Jackiewicz [Mon, 9 May 2016 08:57:50 +0000 (10:57 +0200)]
security-manager-tests: fix expected error of security_manager_49b_*

The app installation fails because for local installations security-manager
expects that a user's directory in /home exists (/home/tizenglobalapp). In case
of global user there's no such directory. It's not a matter of authentication
but directory existence. Test has been updated to expect
SECURITY_MANAGER_ERROR_SERVER_ERROR rather than
SECURITY_MANAGER_ERROR_AUTHENTICATION_FAILED.

Change-Id: Iee34f5010731a3c0c45c92aa574b5266113e65c8

8 years agoInitial commmit for yaca tests. 47/67847/2
Dariusz Michaluk [Tue, 26 Apr 2016 15:05:15 +0000 (17:05 +0200)]
Initial commmit for yaca tests.

Change-Id: If6d2de0b8a59589ed8c607b21a01bd6fd698a692

8 years agosecurity-manager-tests: fix cleanup in security_manager_45_test_* 32/67332/2
Rafal Krypa [Mon, 25 Apr 2016 14:15:11 +0000 (16:15 +0200)]
security-manager-tests: fix cleanup in security_manager_45_test_*

The test case security_manager_45_test_authorId_identificator_creation failed
to properly clean after itself by removing temporary applications from
security-manager.

Change-Id: Ie79e812a7c67fff9d2c491f1353fab9566a8e315

8 years agoBuild all tests by default, add possibility to separate build. 08/67608/1
Dariusz Michaluk [Wed, 27 Apr 2016 10:58:51 +0000 (12:58 +0200)]
Build all tests by default, add possibility to separate build.

Change-Id: Ifde7293123c087172900f7c8699be5a8e6df06d6

8 years agoMake dlog backend optional. 07/67607/1
Dariusz Michaluk [Tue, 26 Apr 2016 14:57:11 +0000 (16:57 +0200)]
Make dlog backend optional.

Change-Id: I59f52d7de4583bc945d33a0e109a3f4477d0a8b9

8 years agoRemove unused API_VERSION from CMake. 06/67606/1
Dariusz Michaluk [Tue, 26 Apr 2016 15:34:42 +0000 (17:34 +0200)]
Remove unused API_VERSION from CMake.

Change-Id: I8c05d948cd83d05ee2e83740b91e0a440b97dfdd

8 years agoDrop libiri dependency, library is not used anymore. 05/67605/1
Dariusz Michaluk [Tue, 26 Apr 2016 13:34:37 +0000 (15:34 +0200)]
Drop libiri dependency, library is not used anymore.

Change-Id: I8b50e8461fb5dd9a50e00ddd3fb4c2e540a8b8b2

8 years agoApp install type tests 85/65985/4
Zbigniew Jasinski [Wed, 13 Apr 2016 14:58:08 +0000 (16:58 +0200)]
App install type tests

Run security-manager-tests --regexp='set_install_type'

Change-Id: I10f0b25b9e3613ce68ddd8b7cb06e83357abbabe
Signed-off-by: Zbigniew Jasinski <z.jasinski@samsung.com>
8 years agoMerge branch 'tizen' into security-manager 52/66752/2
Zbigniew Jasinski [Wed, 20 Apr 2016 15:47:31 +0000 (17:47 +0200)]
Merge branch 'tizen' into security-manager

Change-Id: I7ac3279e0d1cc56ee8c327af381dca9a303a3026
Signed-off-by: Zbigniew Jasinski <z.jasinski@samsung.com>
8 years agoIncrease time limit for RUNNER_CHILD_TEST to 90 seconds 91/66591/2
Rafal Krypa [Tue, 19 Apr 2016 14:59:05 +0000 (16:59 +0200)]
Increase time limit for RUNNER_CHILD_TEST to 90 seconds

Current time limit of 10s for each RUNNER_CHILD_TEST is insufficient.
Several existing tests may take significantly longer time, but they
eventually succeed.

Change-Id: I3867ed3aee0449d95c0fa89b79aa3104f31f81a7
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
8 years agosecurity-manager-tests: Fix security_manager_12_(...) 42/66742/1
Rafal Krypa [Wed, 20 Apr 2016 15:00:46 +0000 (17:00 +0200)]
security-manager-tests: Fix security_manager_12_(...)

Fix the test fetching entire policy with privacy-manager API.
This test incorrectly assumes that the only policy fetched from
security-manager is policy for test users and applications created
in this test case. But security-manager, when queried for entire
policy by admin user fetches policy for all apps, including preloaded.

This fix first queries security-manager for existing policy, then
adds test users and apps, fetches the policy again and finally
analyzes the difference.

Change-Id: I5cde709b326b43939dc3a403e49b37d1083bec60
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
8 years agoTemporaryTestUser: encapsulate communication with gumd in separate process 75/66575/2
Rafal Krypa [Tue, 19 Apr 2016 12:26:44 +0000 (14:26 +0200)]
TemporaryTestUser: encapsulate communication with gumd in separate process

Gumd interface libgum has nasty side effects on the calling process.
On the first call to gumd service it allocates persistent resources
in the calling thread that are not freed and are used for subsequent
calls to gumd. These resources include a new thread, socket connection
and two eventfds.

This doesn't play well with process that changes it's Smack label and
DAC credentials back and forth. It also breaks encapsulation between
test cases, leading to nasty "gumd timeout" issues.

This patch attempts to fix this issue by dedicated a separate process
for calling libgum functions. The TemporaryTestUser class will no longer
call libgum directly, but delegate the calls to the dedicated process.

Change-Id: Id111d5ef79d65135e3b378582a220f168f8a2284
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
8 years agoDrop usage of RUNNER_MULTIPROCESS_TEST* 74/66574/2
Rafal Krypa [Tue, 19 Apr 2016 12:03:02 +0000 (14:03 +0200)]
Drop usage of RUNNER_MULTIPROCESS_TEST*

Replace all uses of RUNNER_MULTIPROCESS_TEST* with RUNNER_CHILD_TEST* because of
several issues of multiprocess test functionality:
- it runs the test function in the main process, suffering from all the issues
  that plagued RUNNER_TEST
- it doesn't handle waiting and error checking for child processes of higher
  order
- it hangs when the main process has a pre-existing child process prior to
  invocation of RUNNER_MULTIPROCESS_TEST*

Simpler RUNNER_CHILD_TEST* macros are sufficient replacement for the broken
ones. We never used additional features provided by RUNNER_MULTIPROCESS_TEST*.

Change-Id: I8583a5b8829343f14c03e8336015f5322122369d
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
8 years agosecurity-manager-tests: fix and re-enable ignored tests 18/65318/3
Rafal Krypa [Fri, 4 Mar 2016 09:26:27 +0000 (10:26 +0100)]
security-manager-tests: fix and re-enable ignored tests

Turn on the following previously disabled tests:
- security_manager_15_privacy_manager_send_policy_update_for_admin
- security_manager_15_privacy_manager_send_policy_update_for_admin_wildcard
- security_manager_15_privacy_manager_send_policy_update_for_self
- security_manager_18_user_cynara_policy
- security_manager_19_security_manager_cmd_install
- security_manager_20_security_manager_cmd_users

Change-Id: I68f09f70d2cbdcd22351bb444757918d56f078f8
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
8 years agoFix security_manager_14_privacy_manager_fetch_and_update_policy_for_admin 17/65317/2
Rafal Krypa [Thu, 7 Apr 2016 12:55:02 +0000 (14:55 +0200)]
Fix security_manager_14_privacy_manager_fetch_and_update_policy_for_admin

Call administrative privacy manager API from admin-type user.

Change-Id: I560e14639cd36346ed056ef395199a07a13dd570
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
8 years agosecurity-manager-tests: properly check exit status of child processes 66/65166/3
Rafal Krypa [Thu, 7 Apr 2016 14:11:04 +0000 (16:11 +0200)]
security-manager-tests: properly check exit status of child processes

Test cases 10-14, 15*, 16, 17 and 21 create one or more child processes
to run tests across. But they fail to properly verify whether the
child returned properly or not.
Although forked processes do use RUNNER_* macros, they may fail without
parent process noticing and the tests passes when it should not.

Change-Id: Ie4ba9de8f47782c800d877131412f8afdbfe2100
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
8 years agoAdd test for pkgId 39/59339/6
Bartlomiej Grzelewski [Wed, 10 Feb 2016 14:13:52 +0000 (15:13 +0100)]
Add test for pkgId

During deinstallation rules with pkg are removed.
If more that one application is connected with pkg id
the rule must be untouch.

Change-Id: I59cc7976fc539d462dc5210ae25ae78c9a8d546e

8 years agosecurity-manager-tests: prepare for security-manager integration with cynara 11/61011/7
Rafal Krypa [Thu, 7 Apr 2016 09:33:59 +0000 (11:33 +0200)]
security-manager-tests: prepare for security-manager integration with cynara

Security-manager will soon requires the caller to hold appropriate privilege.
Tests must always call security-manager APIs with Smack label which has
privilege.

This change makes sure that privileged operations from security-tests
are always called with proper Smack label.

It also adapts for the only part of security-manager that already checks
permission of the caller - privacy-manager APIs. The permissions
required for calling privacy-manager APIs have changed, so security-tests
must change them too.

Change-Id: Ib5e046dbf7fef8e8187b2f7f5700f236ef73bbda

8 years agosecurity-manager-tests: install global apps to /opt/usr/apps, not /usr/apps 24/65124/1
Rafal Krypa [Tue, 5 Apr 2016 11:04:21 +0000 (13:04 +0200)]
security-manager-tests: install global apps to /opt/usr/apps, not /usr/apps

Directory /usr/apps is now only for preloaded applications (TZ_SYS_RO_APP).
Security-manager tests install some global applications, hence it should use
/opt/usr/apps (TZ_SYS_RW_APP).

It should be fixed to rely on tizen-platform-config instead of hardcoding those
paths.

Change-Id: Ia82809ea21badff95b7b6c2e6be2e5d9789db1ab

8 years agosecurity-manager-tests: fix security_manager_48_groups_get 67/63567/3
Rafal Krypa [Fri, 4 Mar 2016 10:59:35 +0000 (11:59 +0100)]
security-manager-tests: fix security_manager_48_groups_get

This test case is verifying whether security_manager_groups_get() returns
proper array of groups currently mapped to any of known privileges.

The test case expected the function only to return groups explicitly added
by security-tests. But now this feature is actively used on the image. There
are groups mapped to privileges, that are not setup by security-tests, but
are part of the system security policy.

Fix the test case by reading mapping from
/usr/share/security-manager/policy/privilege-group.list.
The groups configured in that file are now also expected.

Change-Id: I01ccc45a773b774144ab7f04f7c48bb2192c5ce1

8 years agoMerge remote-tracking branch 'tizen/tizen' into HEAD 21/65121/1
Rafal Krypa [Thu, 7 Apr 2016 09:25:55 +0000 (11:25 +0200)]
Merge remote-tracking branch 'tizen/tizen' into HEAD

Change-Id: Ie1d708ebbfe9444bcbc17b017bdc8e9b7e2dfcfe

8 years agoRemove invocation of api_feature_loader in %post 98/64998/1
Rafal Krypa [Wed, 6 Apr 2016 14:14:28 +0000 (16:14 +0200)]
Remove invocation of api_feature_loader in %post

This binary was part of libprivilege-control, support for which was dropped
in the previous commit.

Change-Id: I492a597ee7e2aca46f143fb211cb9560ae8a21f5

8 years agoRemove libprivilege-control tests 79/64679/1
Rafal Krypa [Mon, 4 Apr 2016 15:04:58 +0000 (17:04 +0200)]
Remove libprivilege-control tests

Libprivilege-control should be long gone on Tizen 3.0.
There is no point in keeping those tests here.

Change-Id: I9dc6f27952e41a632d607faed14cfe45849d1d40
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
8 years agoMerge branch 'tizen' into cynara 80/63580/1
Zbigniew Jasinski [Thu, 24 Mar 2016 14:38:15 +0000 (15:38 +0100)]
Merge branch 'tizen' into cynara

Change-Id: I423b5ba80bd203c9c70a633885c12f2a7efc468b

8 years agosecurity-manager-tests: fix security_manager_19_security_manager_cmd_install 66/63566/1
Rafal Krypa [Fri, 4 Mar 2016 10:13:27 +0000 (11:13 +0100)]
security-manager-tests: fix security_manager_19_security_manager_cmd_install

Adapt to security-manager-cmd changed path types.

Change-Id: Iaa4c5d83f2e733e0ceac15a87de903af97fc24b1

8 years agoAdd test for security_manager_groups_get() API 36/46036/3
Oskar Świtalski [Wed, 12 Aug 2015 12:26:33 +0000 (14:26 +0200)]
Add test for security_manager_groups_get() API

Change-Id: If68c8b79a5cbc3a523909ee761a466a7b5c11cd6

8 years agoMerge branch 'tizen' into security-manager 49/63549/1
Zbigniew Jasinski [Wed, 23 Mar 2016 12:37:25 +0000 (13:37 +0100)]
Merge branch 'tizen' into security-manager

Change-Id: I18dd77f5b98c59cfff3e3d4f943b4c67c29f46e2

8 years agoMerge branch 'ckm' into tizen 05/63005/1
Zbigniew Jasinski [Mon, 21 Mar 2016 12:14:51 +0000 (13:14 +0100)]
Merge branch 'ckm' into tizen

Change-Id: I34396fcbad8b282e7d72ca6d596f4eb246d33840

8 years agoCKM::ErrorToString removed from key-manager 91/62391/1
Kyungwook Tak [Wed, 16 Mar 2016 01:40:34 +0000 (10:40 +0900)]
CKM::ErrorToString removed from key-manager

Change-Id: I74d50dfc88b3c2a7196872ca7c4393665e5ef323
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
8 years agoAdopt test to cynara 0.10.0 81/61681/1
Bartlomiej Grzelewski [Fri, 4 Mar 2016 15:39:52 +0000 (16:39 +0100)]
Adopt test to cynara 0.10.0

Change-Id: If92f1b02a0591fb9ebf4c086c777399362d60ca7

8 years agosecurity-manager-tests: fix cleanup in security_manager_30f_bad_paths 23/61023/2
Rafal Krypa [Thu, 3 Mar 2016 09:37:05 +0000 (10:37 +0100)]
security-manager-tests: fix cleanup in security_manager_30f_bad_paths

Add missing uninstall of secondInstalledApp.

Change-Id: Ic9f25d59e89be1cd3aea9136b56430231f9453d5

8 years agosecurity-manager-tests: don't use semaphores in privacy_manager tests 02/60702/1
Rafal Krypa [Tue, 1 Mar 2016 17:01:36 +0000 (18:01 +0100)]
security-manager-tests: don't use semaphores in privacy_manager tests

Drop usage of POSIX semaphores in
security_manager_*_privacy_manager_* test cases. It doesn't handle
failing scenario properly - tests are hanging, waiting inifinitely
on a semaphore.

Use internal SynchronizationPipe class instead, with a proper RAII
semantics.

Change-Id: I8dd250f5403cf453bb25df9a87b88f58a577d475
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
8 years agoMerge branch 'tizen' into cynara 31/60631/1
Zbigniew Jasinski [Mon, 29 Feb 2016 11:16:50 +0000 (12:16 +0100)]
Merge branch 'tizen' into cynara

Conflicts:
src/security-server-tests/security_server_tests_password.cpp

Change-Id: I753ad499c1bf64330fc0af352e7468c13539c752

8 years agoCKM: Process identification test. 60/59460/1
Bartlomiej Grzelewski [Mon, 15 Feb 2016 11:26:24 +0000 (12:26 +0100)]
CKM: Process identification test.

Change-Id: I829c31ff3601ffbbab7d3ae4a72e8128333fabe0

8 years agoMerge remote-tracking branch 'tizen/tizen' into ckm 25/59425/1
Bartlomiej Grzelewski [Mon, 15 Feb 2016 10:59:52 +0000 (11:59 +0100)]
Merge remote-tracking branch 'tizen/tizen' into ckm

Change-Id: Ieb9b5bd0f3c25ef9d37472cab42187d1b60b4f6d

8 years agoMerge branch 'security-manager' into tizen 24/59424/1
Bartlomiej Grzelewski [Mon, 15 Feb 2016 10:58:08 +0000 (11:58 +0100)]
Merge branch 'security-manager' into tizen

Change-Id: Ia22cf2876e6e034c74e135814523f43740b79501

8 years agosecurity-manager: add tests for security_manager_app_has_privilege 89/58889/2
Rafal Krypa [Wed, 10 Feb 2016 12:31:13 +0000 (13:31 +0100)]
security-manager: add tests for security_manager_app_has_privilege

Change-Id: I77ba0e25c95d6dd6dcce3ade7d938884a8896f77

8 years agoAdd SM tests for getting pkg & app Id from sock or pid 87/48887/8
Rafal Krypa [Wed, 10 Feb 2016 12:30:20 +0000 (13:30 +0100)]
Add SM tests for getting pkg & app Id from sock or pid

Change-Id: Ic0afac87c087ad819806a8be89d41cbf018e5d16

8 years agoRemove SM privilege mapping tests 88/58888/2
Rafal Krypa [Thu, 4 Feb 2016 11:48:42 +0000 (12:48 +0100)]
Remove SM privilege mapping tests

Functionality removed from security-manager, now provided by privilege-checker
(which is out of our project scope).

Change-Id: Ica93ab99f2617c97f538e60965a5098d5614acdf

8 years agosecurity-manager: fix privilege-to-gid mapping tests 40/57040/3
Rafal Krypa [Thu, 14 Jan 2016 14:56:39 +0000 (15:56 +0100)]
security-manager: fix privilege-to-gid mapping tests

Verification whether privileges are correctly mapped to grouops is based
on an assumption that the privileges used (camera, location) are not mapped
to any groups in the real configuration. But recently the camera privilege has
been mapped to a group "priv_camera" on the image.
To keep the test working, it now uses a different privilege instead ("nfc") that
doesn't have a group associated to it.

Change-Id: I3cb6ae7911abb5c7efab6558ffdb8043714fbce7
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
8 years ago[SM] Turn off tests that does not work because of gumd timeout. 88/58788/2
Bartlomiej Grzelewski [Tue, 2 Feb 2016 15:08:30 +0000 (16:08 +0100)]
[SM] Turn off tests that does not work because of gumd timeout.

Change-Id: Ib5ea1935e370486c13f4f27d5d34adf12b444a30

8 years agoMerge remote-tracking branch 'tizen/tizen' into ckm 90/58790/1
Bartlomiej Grzelewski [Wed, 3 Feb 2016 11:05:07 +0000 (12:05 +0100)]
Merge remote-tracking branch 'tizen/tizen' into ckm

Change-Id: Idd9657344d2e3130e2f92557545f3884732ef3af

8 years ago[SM] Changes in InstallRequest API. 87/58787/1
Bartlomiej Grzelewski [Tue, 2 Feb 2016 11:53:37 +0000 (12:53 +0100)]
[SM] Changes in InstallRequest API.

Replace "const char *" with std::string type.

Change-Id: I955f850ea1f09e310fbd0ae7775c84fe6f15c2e5

8 years ago[SM] Apply/drop sharing tests 38/58538/4
Zofia Abramowska [Fri, 29 Jan 2016 15:49:13 +0000 (16:49 +0100)]
[SM] Apply/drop sharing tests

Change-Id: I21e89b450726efef8041d128c4a2221e8dc7009e

8 years ago[SM] Tests for trusted dir. 62/58262/3
Bartlomiej Grzelewski [Thu, 28 Jan 2016 18:57:12 +0000 (19:57 +0100)]
[SM] Tests for trusted dir.

Change-Id: I4c97747253b8395a41bd85c004104f66bffc852a

8 years agoAdd security_manager_app_inst_req_set_author_id tests 59/57159/5
Krzysztof Jackiewicz [Fri, 15 Jan 2016 12:38:45 +0000 (13:38 +0100)]
Add security_manager_app_inst_req_set_author_id tests

[Verification] Run security-manager-tests --regexp=security_manager_27

Change-Id: Idd9705f8328cb352039821804dd961bf68a25b49

8 years agosecurity-manager: added tests of 2.X shared folders backward compatibility 57/58357/2
Maciej J. Karpiuk [Thu, 28 Jan 2016 09:06:54 +0000 (10:06 +0100)]
security-manager: added tests of 2.X shared folders backward compatibility

Change-Id: Ic83a9570a1bff97a80c4a3bfc4e38d73bee472f0

8 years agoMerge branch 'tizen' into security-manager 26/58126/1
Bartlomiej Grzelewski [Wed, 27 Jan 2016 16:50:49 +0000 (17:50 +0100)]
Merge branch 'tizen' into security-manager

Change-Id: I1740cb2f5e0aa5de10952364e05b03a10c115b11

8 years agoMerge branch 'ckm' into tizen 25/58125/1
Bartlomiej Grzelewski [Wed, 27 Jan 2016 16:45:05 +0000 (17:45 +0100)]
Merge branch 'ckm' into tizen

Change-Id: Ia52221f3c05fa81a4d5b53bd183ca0174f49020e

8 years agoRemove key-manager-listener dependency. 20/58120/3
Bartlomiej Grzelewski [Wed, 27 Jan 2016 15:37:08 +0000 (16:37 +0100)]
Remove key-manager-listener dependency.

key-manager-listener package is empty.
Its functionality is provided by key-manager package now.

Change-Id: Ib7ce4575ae507825b408c80eccfe6e1df8543465

8 years agoDrop tests related to security-server 39/57039/1
Rafal Krypa [Thu, 14 Jan 2016 14:43:54 +0000 (15:43 +0100)]
Drop tests related to security-server

Security-server has been removed from Tizen 3.0 images.

Change-Id: I6cd8349abd94b2136726a357f515308cb482bce9
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>