platform/core/test/security-tests.git
10 years agoAdd extra bucket cynara tests 62/24662/9
Marcin Niesluchowski [Thu, 17 Jul 2014 17:06:37 +0000 (19:06 +0200)]
Add extra bucket cynara tests

Change-Id: I195ac63e423b79b422978003892d78b863cfc2e0

10 years agoAdd single wildcard policies cynara test 44/24644/11
Marcin Niesluchowski [Thu, 17 Jul 2014 13:48:23 +0000 (15:48 +0200)]
Add single wildcard policies cynara test

Change-Id: If3dc244bcc93b6d02c981fcb3f9cd5cbc7004705

10 years agoAdd allow remove set policies cynara tests 35/24635/9
Marcin Niesluchowski [Thu, 17 Jul 2014 11:43:59 +0000 (13:43 +0200)]
Add allow remove set policies cynara tests

Change-Id: I4be35a4242e381fbac176ad5591d2a90e50dc423

10 years agoAdd empty bucket cynara tests 28/24628/14
Marcin Niesluchowski [Thu, 17 Jul 2014 09:29:43 +0000 (11:29 +0200)]
Add empty bucket cynara tests

Change-Id: Ie3eb6ece201e31490e72180d0c4f53397c8976e8

10 years agoAdd cynara invalid params tests 18/24518/21
Marcin Niesluchowski [Tue, 15 Jul 2014 17:34:43 +0000 (19:34 +0200)]
Add cynara invalid params tests

Change-Id: I45a63f43911c57b2d1ceb8b69410e41b527066bc

10 years agoAdd cynara test client class 79/24279/20
Marcin Niesluchowski [Wed, 9 Jul 2014 13:52:12 +0000 (15:52 +0200)]
Add cynara test client class

Change-Id: I8ef613c06d5fbe2a3764aaac7fa1b0b1009a860b

10 years agoAdd cynara test admin class 78/24278/20
Marcin Niesluchowski [Wed, 9 Jul 2014 12:17:15 +0000 (14:17 +0200)]
Add cynara test admin class

Change-Id: I6871e7e51d6f78df03948d7dc83a88e5fe0ffeb3

10 years agoMake DBusAccess class more generic 47/24347/15
Marcin Niesluchowski [Thu, 10 Jul 2014 11:22:03 +0000 (13:22 +0200)]
Make DBusAccess class more generic

DBusAccess class should be able to restart any service.

Change-Id: I035321e9cd6fb219f2affc01b06299ace9c8af18

10 years agoAdd tests for setting current process label 08/24408/4
Jacek Bukarewicz [Fri, 11 Jul 2014 13:56:53 +0000 (15:56 +0200)]
Add tests for setting current process label

Change-Id: I020b8c812526c7e13d86df8ffe72c4d80a1e0fe0
Signed-off-by: Jacek Bukarewicz <j.bukarewicz@samsung.com>
10 years agoRefactor test for smack_*getlabel and smack_*setlabel. 98/23298/9
Marcin Niesluchowski [Mon, 16 Jun 2014 09:48:12 +0000 (11:48 +0200)]
Refactor test for smack_*getlabel and smack_*setlabel.

Change-Id: I65b60e6d13137b3d6a3ece46becde5050f4aa0b0

10 years agoUse tzplatform_mkpath to get path to .rules-db.db3 database 82/24482/1
Jacek Bukarewicz [Tue, 15 Jul 2014 08:07:59 +0000 (10:07 +0200)]
Use tzplatform_mkpath to get path to .rules-db.db3 database

Change-Id: I6b834fe93551349954480dbc809e483f6a146dfd
Signed-off-by: Jacek Bukarewicz <j.bukarewicz@samsung.com>
10 years agoAdd security-manager database records testing. 39/23839/2
Marcin Lis [Thu, 3 Jul 2014 13:47:09 +0000 (15:47 +0200)]
Add security-manager database records testing.

Use the TestSecurityManagerDatabase class to test installation and privilege
assignment process in security-manager's database.

Change-Id: I08155d56904c31fe2a124d86d089014e9da95008
Signed-off-by: Marcin Lis <m.lis@samsung.com>
10 years agoAdd parameters to security-manager tests functions. 38/23838/2
Marcin Lis [Thu, 3 Jul 2014 13:45:38 +0000 (15:45 +0200)]
Add parameters to security-manager tests functions.

This commit pre-reorganizes tests. It prepares security-manager tests
to implement database records checks in next step.

Change-Id: I4687a71f12117c8b5c02e90cb71851ec95aacf16
Signed-off-by: Marcin Lis <m.lis@samsung.com>
10 years agoAdd new class to test security-manager database records. 37/23837/1
Marcin Lis [Wed, 2 Jul 2014 13:38:41 +0000 (15:38 +0200)]
Add new class to test security-manager database records.

Reuse the concept implemented in libprivilege-control tests.

The interface of the introduced class may be used in security-manager tests.
Currently it allows to check if app and pkg have been successfully installed
along with all requested privileges. Checking application uninstallation is
possible as well.

Change-Id: I1eb95312c7ace890402533ef17645b91485ad443
Signed-off-by: Marcin Lis <m.lis@samsung.com>
10 years agoMove generic Sqlite3DBase test files to common part. 36/23836/1
Marcin Lis [Tue, 1 Jul 2014 15:06:21 +0000 (17:06 +0200)]
Move generic Sqlite3DBase test files to common part.

Prepare DB-test framework for later use in security-manager tests.

Change-Id: I9454431db2654adc0019446e08615ae72051a0fd
Signed-off-by: Marcin Lis <m.lis@samsung.com>
10 years agoAdd test for libprivilege permissions update. 83/23383/4
Marcin Lis [Wed, 18 Jun 2014 13:17:42 +0000 (15:17 +0200)]
Add test for libprivilege permissions update.

This commit introduces tests for the following change:
https://review.tizen.org/gerrit/#/c/23382/

Change-Id: I42c228dac84c9aee8f7f55de4a9d4773f97f11f1
Signed-off-by: Marcin Lis <m.lis@samsung.com>
10 years agoRemove security_manager_app_inst_req_add_allowed_user from tests. 07/23307/1
Marcin Niesluchowski [Mon, 23 Jun 2014 10:26:21 +0000 (12:26 +0200)]
Remove security_manager_app_inst_req_add_allowed_user from tests.

Function security_manager_app_inst_req_add_allowed_user will be
removed from security-manager.

Change-Id: I89aafc3d1ae49044bdcb860545181e6e355d6f28

10 years agoAdd test for security-manager installer service. 73/22773/3
Marcin Niesluchowski [Tue, 3 Jun 2014 12:36:59 +0000 (14:36 +0200)]
Add test for security-manager installer service.

Verification:
-> secuirty-tests.sh security-manager --output=text --runignored
   (all should pass)

Change-Id: I43b10b0032300cbf4b21faceae85d1f1dc1a982f

10 years agoTest labeling links to execs by security-manager 34/22534/4
Jan Cybulski [Thu, 5 Jun 2014 13:02:04 +0000 (15:02 +0200)]
Test labeling links to execs by security-manager

Security manager's installer service labels links to execs
with a special xattr: security.TIZEN_EXEC_LABEL.
This commit checks that functionality.

Change-Id: Iac86bc6a55aba4b3648ec2f4e475c28121b025f0
Signed-off-by: Jan Cybulski <j.cybulski@samsung.com>
10 years agoUse /tmp/ as location for smack test files 68/22568/3
Jacek Bukarewicz [Fri, 6 Jun 2014 13:09:53 +0000 (15:09 +0200)]
Use /tmp/ as location for smack test files

Smack laccess tests used /opt/home/app previously, but it does not
necessarily exist so replace it with /tmp/.

Change-Id: Id711c60ef49e0078519f8acc77d5b034a23c1596

10 years agoAdd tests for security manager's installer service 12/21612/11
Jan Cybulski [Thu, 5 Jun 2014 13:00:42 +0000 (15:00 +0200)]
Add tests for security manager's installer service

Add more specific tests for security manager's
security_manager_app_inst_req_add_path:
Tests for SM_PUBLIC_PATH and SM_PUBLIC_RO_PATH added.

Change-Id: I505fca28ef992676f967fa6cf29bc2d6343388c1
Signed-off-by: Jan Cybulski <j.cybulski@samsung.com>
10 years agoFix return value of smack_have_access 65/22465/2
Jan Cybulski [Wed, 4 Jun 2014 12:47:19 +0000 (14:47 +0200)]
Fix return value of smack_have_access

Libsmack's smack_have_access returns 0 on no access and -1 on errors.
Checking rule that does not exist should not return -1

Change-Id: I604eed75634c9bc1dfbeb41a70d0a11211be96f0
Signed-off-by: Jan Cybulski <j.cybulski@samsung.com>
10 years agoFix segmentation fault on libsmack tests 64/22464/2
Jan Cybulski [Wed, 4 Jun 2014 12:44:44 +0000 (14:44 +0200)]
Fix segmentation fault on libsmack tests

Change-Id: I6fbae1e6513a6121aae53863193d862b03da257a
Signed-off-by: Jan Cybulski <j.cybulski@samsung.com>
10 years agoAdd tests for Cynara RE (Rush-Edition) 25/20525/12
Aleksander Zdyb [Thu, 29 May 2014 12:39:17 +0000 (14:39 +0200)]
Add tests for Cynara RE (Rush-Edition)

Change-Id: I628a242f40001a2e81ac1728e19402ed30b11934
Signed-off-by: Aleksander Zdyb <a.zdyb@partner.samsung.com>
10 years agoFix tc_unit_09_02_app_user_cookie_API_access_deny test. 00/21600/2
Marcin Niesluchowski [Fri, 23 May 2014 09:00:06 +0000 (11:00 +0200)]
Fix tc_unit_09_02_app_user_cookie_API_access_deny test.

Verfication:
-> security-server-tests-server --output=text --runignored \
   --regexp=tc_unit_09_02_app_user_cookie_API_access_deny
   (with smack; test should not fail)

Change-Id: I03e696482ce797a67c3de9b77418d448970c5f23

10 years agoDon't use OSP and WRT installers in security tests 30/21530/3
Jacek Bukarewicz [Wed, 21 May 2014 15:02:09 +0000 (17:02 +0200)]
Don't use OSP and WRT installers in security tests

Security tests used to install WRT and OSP test applications in
post installation script. This is not necessary and can be replaced by
shipping binaries and symlinks required by test in RPM package.

To verify check if libprivilege-control tests' results are unaffected by
this change.

Change-Id: Id1d73bfb0249bc63bd33613c40d04a673783642d
Signed-off-by: Jacek Bukarewicz <j.bukarewicz@samsung.com>
10 years agoRevert "Fix security-server server tests" 37/21537/2
Marcin Niesluchowski [Thu, 22 May 2014 12:18:21 +0000 (14:18 +0200)]
Revert "Fix security-server server tests"

This reverts commit df5967df7e0c2d61ca4829c3add727a1696cd058.

Conflicts:

tests/security-server-tests/server.cpp

Change-Id: I10296aab70f267f90e7a94432672fd0b94b9b129

10 years agoAdjust AccessProvider api to current security-server. 55/21455/2
Marcin Niesluchowski [Wed, 21 May 2014 06:51:52 +0000 (08:51 +0200)]
Adjust AccessProvider api to current security-server.

Sockets in security-server has been moved to /run labeled with
System::Run label and AccessProvider provided old smack accesses.
Previous references to sockets' old smack labels has been removed.

Verification:
-> security-tests-all.sh
   (server, cookie-api, clientsmack and dbus tests should pass,
    no changes in other tests)

Change-Id: I9796fb0b52890553767783de5cffdc7b5ecb8746

10 years agoAdd tests for security_server_app_has_privilege function. 13/21013/4
Marcin Niesluchowski [Wed, 14 May 2014 09:36:18 +0000 (11:36 +0200)]
Add tests for security_server_app_has_privilege function.

security_server_app_has_privilege function has been restored
and changed in security-server repository.
See:
-> 'Bring back part of app-permissions service'
-> 'Adjust security_server_app_has_privilege to Tizen 3.0 model.'

Verification:
-> security-tests.sh ss-privilege --output=text --runignored
   (test should pass)

Change-Id: I505c0d49f2bcbc739f63f5828edd81feb168cca3

10 years agoAdd security-manager tests. 53/20753/11
Marcin Niesluchowski [Thu, 8 May 2014 18:28:43 +0000 (20:28 +0200)]
Add security-manager tests.

security-manager service has been added to security-server repository.
See:
-> 'Implement installer service'
-> 'Added security-manager API'

Verification:
-> security-tests.sh security-manager --output=text
   (test should pass)

Change-Id: Idb69adada46864373208eb932f46402a4561e31e

10 years agoRefactor perm_app_setup_path libprivilege-control tests. 00/20500/9
Marcin Niesluchowski [Wed, 7 May 2014 13:27:44 +0000 (15:27 +0200)]
Refactor perm_app_setup_path libprivilege-control tests.

New design provides only three ways of labelling path in libprivilege-control.
See:
-> 'Added APP_PATH_PUBLIC and APP_PATH_FLOOR types to perm_app_setup_path function.'

Verification:
-> libprivilege-control-test --output=text --runignored
   (following tests should pass:
    -> privilege_control02_perm_app_setup_path_01_PRIVATE
    -> privilege_control02_perm_app_setup_path_02_FLOOR
    -> privilege_control02_perm_app_setup_path_03_PUBLIC_RO
    -> privilege_control02_perm_app_setup_path_03_PUBLIC_RO_nosmack)

Change-Id: I90ffeaf1eac585bf0c999705940544263ac3214c

10 years agoAdd tests to libprivilege-control perm_app_has_permission function. 24/20524/6
Marcin Niesluchowski [Thu, 8 May 2014 10:03:25 +0000 (12:03 +0200)]
Add tests to libprivilege-control perm_app_has_permission function.

libprivilege-control function perm_app_has_permission has been restored
and changed.
See:
-> 'Restore perm_app_has_permission API function.'
-> 'Adjust perm_app_has_permission API function to Tizen 3.0 model.'

Verification:
-> security-tests.sh libprivilege-control --output=text --runignored
   (following tests should pass:
    -> privilege_control20_perm_app_has_permission
    -> privilege_control21m_incorrect_params_perm_app_has_permission)

Change-Id: I62d38b4665e5cc51f50b284378a3197dc8daefd2

10 years agoAdapt tests to new exec labelling design. 17/20017/2
Marcin Niesluchowski [Thu, 24 Apr 2014 13:54:54 +0000 (15:54 +0200)]
Adapt tests to new exec labelling design.

Remove smack exec label checks for links.
See:
-> 'Adapt to tizenorg: Change implementation of exec labels for links to binaries'

Verification:
-> libprivilege-control-test --output=text \
   --regexp=privilege_control02_app_label_dir
   (test should pass)

Change-Id: Ided8c081c8fbd3b672f34a325373ccbbba653ef8

10 years agoFix memory managment 53/19953/5
Zofia Abramowska [Fri, 18 Apr 2014 12:50:22 +0000 (14:50 +0200)]
Fix memory managment

Organize used smart pointers.
Fix memory leaks inside libsmack test cases.

Change-Id: I7c63af01b463d0f5a2f3ac8c1c4dad1734f30ce5

10 years agoAdapt tests to change in libprivilege-control. 85/20385/1
Marcin Niesluchowski [Wed, 30 Apr 2014 14:37:53 +0000 (16:37 +0200)]
Adapt tests to change in libprivilege-control.

See libprivilege-control change:
-> 'Adapt to tizenorg: Generate app label from pkg_id'

Verification:
-> security-tests.sh libprivilege-control --runignored --output=text
   (tests from libprvilegecontrol and libprivilegecontrol_nosmack
    groups should pass)

Change-Id: I3b9a29dc10b33ee1ae488142bf16c4e4b4d69987

10 years agoRewriting cleanup functions for libsmack test cases 52/19952/2
Zofia Abramowska [Thu, 17 Apr 2014 12:51:00 +0000 (14:51 +0200)]
Rewriting cleanup functions for libsmack test cases

Simplifying cleanup functions.
This is a preparation commit for total refactoring
of cleanup mechanism in libsmack test cases

Change-Id: I1963b71188446b912f85ade0e9838eeb9f1af34f

10 years agoRemove unnecessary verify_chk_pwd_basic function. 74/18974/2
Marcin Niesluchowski [Thu, 3 Apr 2014 09:18:54 +0000 (11:18 +0200)]
Remove unnecessary verify_chk_pwd_basic function.

Verification:
-> security-tests.sh ss-password --output=text --runignored
   (no changes)

Change-Id: I804a3fc1d63da369eb155f7f776b9ac104542fbd

10 years agoAdapt tizen.org tests to newest security-server changes 80/19880/2
Janusz Kozerski [Mon, 14 Apr 2014 14:02:25 +0000 (16:02 +0200)]
Adapt tizen.org tests to newest security-server changes

Mark all tests that check security-server functions:
 - security_server_check_privilege_by_sockfd,
 - security_server_check_privilege_by_pid,
 - security_server_check_privilege_by_cookie,
as ignored.

Verification: Build with the newest security-server. All security-server test should pass.

Change-Id: I3eea20e03f4e0e7b31a9c18f6b75e9b650a4a517
Signed-off-by: Janusz Kozerski <j.kozerski@samsung.com>
10 years agoFix groups issue in tests using perm_app_set_privilege api. 59/18159/9
Marcin Niesluchowski [Thu, 13 Mar 2014 15:33:53 +0000 (16:33 +0100)]
Fix groups issue in tests using perm_app_set_privilege api.

Due to current policy process calling perm_app_set_privilege is added
to current groups of app user and additional groups associated with
smack label in database. Previous tests did not take into account
current groups of app user.

Verification:
-> security-tests.sh libprivilege-control --runignored --output=text

Change-Id: I03a7e96c46da20af6a01c86b290fc7180425afb5

10 years agoRewrite files_compare function 81/19781/3
Zofia Abramowska [Thu, 17 Apr 2014 12:03:14 +0000 (14:03 +0200)]
Rewrite files_compare function

Refactoring files_compare function now, when backtrack functionality
is available.

Change-Id: I5bde968289a3dea7b4c6aff2d9b075b5c22953de

10 years agoFixing failing 'smack13_4_*' libsmack tests 61/19761/3
Zbigniew Jasinski [Wed, 16 Apr 2014 15:14:12 +0000 (17:14 +0200)]
Fixing failing 'smack13_4_*' libsmack tests

[Bug/Feature] Failing 'smack13_4_*' libsmack tests.
[Cause] Not enough privileges for testing suite to access /opt/home/app
[Solution] Set the right access 'x' to 'User' label.
[Verification] Build, install and run tests on smack kernel:
libsmack-test --output=text --regexp='smack13_4_*'

Change-Id: Ia811b3fe8af8b5b3f35ecd5fb991d6a6738f5d1b

10 years agoFix Security Server tc_unit_03_04_security_server_check_privilege_neg. 05/19605/1
Radoslaw Bartosiak [Wed, 16 Apr 2014 10:01:51 +0000 (12:01 +0200)]
Fix Security Server tc_unit_03_04_security_server_check_privilege_neg.

[Bug/Feature]  Test failed with "Reading pipe error" message.
[Cause]        SEGFAULT in a test thread.
[Solution]     Fixed usage of std::vector::erase.
[Verification] Build, install and run tests on smack and non-smack env.
               tc_unit_03_04_security_server_check_privilege_neg is OK.

Change-Id: I79d8c7f39dcabb988b27ac902f211dab68b6cde8
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
10 years agoAdd SECURITY_SERVER_API_ERROR_NO_SUCH_SERVICE error check. 69/19569/2
Marcin Niesluchowski [Tue, 15 Apr 2014 11:54:01 +0000 (13:54 +0200)]
Add SECURITY_SERVER_API_ERROR_NO_SUCH_SERVICE error check.

Due to change in following commit in security-server repository
another connection error has been added.
-> 'Signalling attempt to access a non-existent service'

Verification:
-> security-tests.sh ss-api-speed --runignored --output=text

Change-Id: I088117a163d34ab37aba4de4a193c39c5c1a0b25

10 years agoFix Security Server no-smack stress tests. 02/19202/2
Marcin Lis [Fri, 4 Apr 2014 12:49:13 +0000 (14:49 +0200)]
Fix Security Server no-smack stress tests.

[Bug/Feature]  Security-server stress tests failure with smack disabled.
[Cause]        Security-server is able to handle only 5 clients in
               waiting queue.
[Solution]     Reduce the number of threads to 5.
[Verification] Build, install and run tests on smack and non-smack
               environment, stress tests should pass.

Change-Id: I099df21a279ede482d4a4e214f9e83f9a0db654e
Signed-off-by: Marcin Lis <m.lis@samsung.com>
10 years agoRemove tests that use deprecated libprivilege-control API. 10/19210/2
Marcin Lis [Tue, 8 Apr 2014 15:33:35 +0000 (17:33 +0200)]
Remove tests that use deprecated libprivilege-control API.

[Feature]      Adapt tests to tizen.org
[Cause]        Libprivilege contained a lot of API that was marked deprecated
               for a long time. This API is removed in the following commit:
                   https://review.tizen.org/gerrit/#/c/19194/
[Solution]     Remove tests, macros, variables associated with old API:
               - app_register_av
               - app_add_friend
[Verification] Build, install and run tests on smack and non-smack environment.
               Ensure that libprivilege-control rpm built from the commit linked
               above is installed on the target.
               Removed tests should not be present.

Change-Id: I59ef71c5684a29a4fb6ba6a8f6a4a667e3f99ab0
Signed-off-by: Marcin Lis <m.lis@samsung.com>
10 years agoAdjustment needed for performance tests in wrt-commons 23/18823/5
Janusz Kozerski [Tue, 1 Apr 2014 13:02:02 +0000 (15:02 +0200)]
Adjustment needed for performance tests in wrt-commons

The change "Add summary view to all security tests" colids with DPL
performance test in wrt-commons (commit: Add RUNNER_PERF_TEST_BEGIN()
and RUNNER_PERF_TEST_END() macros for performance tests). Without
this patch a build-break in security-test will occur after applying
performance tests feature to wrt-commons repository.
This patch fix the build break - security-tests can be build with
and without performance test in wrt-commons.

Verify:
    Build wrt-commons with patch "Add RUNNER_PERF_TEST_BEGIN()
and RUNNER_PERF_TEST_END() macros for performance tests". Then build
security-tests. Run all tests - there should be no changes in test
results.

Change-Id: If49834dcdd5396434a782e936d9906035b02fd32
Signed-off-by: Janusz Kozerski <j.kozerski@samsung.com>
10 years agoFix system include dirs dependencies for test commons 91/19191/1
Zofia Abramowska [Tue, 8 Apr 2014 09:15:11 +0000 (11:15 +0200)]
Fix system include dirs dependencies for test commons

[Bug] System include dirs dependencies not marked as such
[Cause] Wrong settting in CMakeLists
[Solution] Add inlude_directories with system setting for test
commons dependencies
[Verification] Successfull build

Change-Id: I00a87a0cf21497612fa84e6e718667be2515a48f

10 years agoFix tc_unit_06_01_security_server_get_smacklabel_cookie test. 26/18826/2
Marcin Niesluchowski [Tue, 1 Apr 2014 16:44:41 +0000 (18:44 +0200)]
Fix tc_unit_06_01_security_server_get_smacklabel_cookie test.

Test tc_unit_06_01_security_server_get_smacklabel_cookie fails with
smack disabled.

Verification:
-> security-tests.sh ss-server --output=text --runignored
   (tc_unit_06_01_security_server_get_smacklabel_cookie_* should pass
    with no changes in other tests)

Change-Id: Ia6a56120c777234faed3718a89b01caf91c7281f

10 years agoSome tests that call smack_revoke_subject should run with smack 23/18523/5
Sebastian Grabowski [Mon, 24 Mar 2014 13:52:29 +0000 (14:52 +0100)]
Some tests that call smack_revoke_subject should run with smack

[Bug/Feature]   Some tests calling smack_revoke_subject fails when run without
                smack
[Cause]         Tests need smack to run properly
[Solution]      Run those test only when smack is enabled. Moreover, if
                it was possible, added similar nosmack versions
                of these tests.
[Verification]  Build, install and run tests, i.e.:
                security-tests.sh ss-server --runignored --output=text

Change-Id: I1319c64581cce3739e1168a9d3dc45a1878892a8
Signed-off-by: Sebastian Grabowski <s.grabowski@partner.samsung.com>
10 years agoFix failing tests from SECURITY_SERVER_API_SPEED_MEASURER group. 58/18758/2
Marcin Niesluchowski [Thu, 27 Mar 2014 18:00:16 +0000 (19:00 +0100)]
Fix failing tests from SECURITY_SERVER_API_SPEED_MEASURER group.

Following tests fail with smack disabled:
-> m060_security_server_check_privilege_by_cookie
-> m070_security_server_check_privilege_by_sockfd

Verification:
-> security-tests.sh ss-server --output=text --runignored
   (no changes)
-> security-tests.sh ss-api-speed --output=text --runignored
   (m060* and m070* should pass)

Change-Id: Ie93a803bc498448c6d374bcc552be0b2afcca3d4

10 years agoRemoved use of pid_cycle file and ENVIRONMENT macros 37/18537/8
Sebastian Grabowski [Tue, 25 Mar 2014 12:44:13 +0000 (13:44 +0100)]
Removed use of pid_cycle file and ENVIRONMENT macros

[Bug/Feature]   Security-server client tests failure with smack disabled
                while test environment preparations
[Cause]         pid_cycle file was created in a nonexistent directory.
                Moreover, this file seems to be unused in any way
                further and not deleted either.
[Solution]      Get rid of pid_cycle file usage. In addition,
                ENVIRONMENT and ENVIRONMENT_NOSMACK macros were deleted
                in favour of drop_root_privileges function for nonsmack
                tests and AccessProvider class for smack tests.
                There were also duplicated tests about security server
                cookies - they were moved to cookie_api.cpp.
                Tests run as app user in cookie_api.cpp are now distinguished
                from others with changed name having "_app_user_" string.
[Verification]  Build, install and run tests, i.e.:
                security-tests.sh ss-server --runignored --output=text
                security-tests.sh ss-clientsmack --runignored --output=text

Change-Id: I68ad3f0bb12f437fa927660327c5e44f91e91446
Signed-off-by: Sebastian Grabowski <s.grabowski@partner.samsung.com>
10 years agoRewrite macro defines as consts 63/18663/2
Zofia Abramowska [Thu, 27 Mar 2014 14:08:51 +0000 (15:08 +0100)]
Rewrite macro defines as consts

Removing unnecessary macros and replace them with const variables.

Change-Id: I867e54eebbd4e01ca7947abf67a5642c6f965c2e

10 years agoFix error messages for access denial tests 90/18490/2
Zofia Abramowska [Fri, 21 Mar 2014 17:00:37 +0000 (18:00 +0100)]
Fix error messages for access denial tests

Error messages stated that function failed instead of saying
that access should not have been granted.

Change-Id: Ifcd1bca4f5b6b12c5d907b0301afdc727e73739a

10 years agoFix security-server server tests 00/18400/3
Zofia Abramowska [Fri, 21 Mar 2014 16:40:49 +0000 (17:40 +0100)]
Fix security-server server tests

Some of test expect to receive access denied when trying to
access security server sockets. Now these sockets are labeled
"_" so access always is granted.
Setting ignore on those test cases, which expect access denial.

Change-Id: Ibd8ec5c8b3b85ac829650f9c080983be7154b8a0

10 years agoRefactor libprivilege-control stress tests. 65/18465/2
Marcin Lis [Mon, 24 Mar 2014 10:44:07 +0000 (11:44 +0100)]
Refactor libprivilege-control stress tests.

[Issue#]       N/A
[Feature]      Adapt tests to tizen.org
[Cause]        Tests failing under no-smack environment due to improper design.
[Solution]     Make stress tests work well when SMACK is not present by adding
               different conditions. In addition use types defined in common
               headers instead of repeating nested declarations of vectors.

[Verification] Build, install, run tests.

               The following test cases should pass:
                        <<   WITH SMACK   >>
                - privilege_control22_app_installation_1x100_smack
                - privilege_control23_app_installation2_10x10_smack
                        <<  WITHOUT SMACK >>
                - privilege_control22_app_installation_1x100_nosmack
                - privilege_control23_app_installation2_10x10_nosmack

Change-Id: I8a9cfeeb4ce81c7543e3ef33b704441f25dd9c2d
Signed-off-by: Marcin Lis <m.lis@samsung.com>
10 years agoRemove anti-virus tests from libprivilege group. 61/18461/5
Marcin Lis [Mon, 24 Mar 2014 14:30:15 +0000 (15:30 +0100)]
Remove anti-virus tests from libprivilege group.

[Issue#]       N/A
[Feature]      Adapt tests to tizen.org
[Cause]        Tests failing because AV (anti-virus) functionality is deprecated
[Solution]     Remove tests connected to anti-viruses.
               Leave av test marked as ignored and deprecated. It will be
               removed when libprivilege API is cleaned up.

[Verification] Build, install, run tests.

               The following test cases should not be present on the list:
                - privilege_control24a_av_privilege_group_rw
                - privilege_control24b_av_privilege_settings_rw
                - privilege_control24c_av_privilege_public_ro

Change-Id: I2a468990065aae3aa83a81c9336b6d7e6595c9aa
Signed-off-by: Marcin Lis <m.lis@samsung.com>
10 years agoFix libprivilege-control tests connected with perm_app_setup_path 01/18401/2
Marcin Lis [Mon, 24 Mar 2014 09:43:54 +0000 (10:43 +0100)]
Fix libprivilege-control tests connected with perm_app_setup_path

[Issue#]       N/A
[Feature]      Adapt tests to tizen.org and new three domain policy.
[Cause]        Tests failing due to lack of privileges in libprivilege database.
[Solution]     Add required permissions to database.

[Verification] Build, install, run tests.

               The following test cases should pass:
                        <<   WITH SMACK   >>
                - privilege_control17_appsettings_privilege
                - privilege_control22_app_installation_1x100
                - privilege_control23_app_installation2_10x10
                        <<  WITHOUT SMACK >>
                - privilege_control17_appsettings_privilege_nosmack

Change-Id: Iefb388d4dfca1b1681c55ee8db87eb35a9109f73
Signed-off-by: Marcin Lis <m.lis@samsung.com>
10 years agoFix tc18_security_server_get_smacklabel_cookie_nosmack 60/18360/1
Marek Smolinski [Thu, 20 Mar 2014 14:23:22 +0000 (15:23 +0100)]
Fix tc18_security_server_get_smacklabel_cookie_nosmack

Wrong logical expresion checking empty string in ASSERTION

Change-Id: I2b2ddd59fbf028430392a9dcdc90e7c539f06024
Signed-off-by: Marek Smolinski <m.smolinski@samsung.com>
10 years agoFix rules file compared with created by smack_accesses_save. 63/18163/1
Marcin Niesluchowski [Mon, 17 Mar 2014 16:11:52 +0000 (17:11 +0100)]
Fix rules file compared with created by smack_accesses_save.

After merge of smack upstream to tizen saved rules file format
has changed.

Change-Id: I785b60a56dfe3a236fe15adb0e15f1ff7c4d2cdb

10 years agoAdapt to tizenorg sandbox/mniesluchow/samsung_devel
Marcin Niesluchowski [Mon, 10 Mar 2014 17:30:39 +0000 (18:30 +0100)]
Adapt to tizenorg

Seurity-server tests:
* Remove tests for app-permissions service.
* Remove tests for open-for service.
* Remove tests for cookie service apis:
** security_server_get_uid_by_cookie
** security_server_get_gid_by_cookie
Libprivilege-control tests:
* Remove tests for perm_add_additional_rules api.
* Remove tests for perm_app_setup_permissions api or change this to
  perm_app_enable_permissions api in those tests.
* Remove tests for perm_get_permissions api.
* Remove tests for perm_app_get_paths api.
* Remove tests for perm_app_remove_path api.
* Remove tests for get_smack_label_from_process api.
* Remove tests for smack_pid_have_access api.
* Remove tests regarding nonexistent app_type_t values or change those values
  to proper ones.
* Change nonexistent app_path_type_t values to proper ones.
* Remove nonexistant functionalities checks.

Change-Id: I3d4bc05c273801d34b8b3b11ab3474a28148440f

10 years agoPrevent running perm_add_additional_rules_smack_access_*
Lukasz Wojciechowski [Mon, 24 Feb 2014 15:23:29 +0000 (16:23 +0100)]
Prevent running perm_add_additional_rules_smack_access_*
tests in nosmack mode

[Issue#]        N/A
[Feature]       These tests fail in nosmack mode
[Cause]         Tests need smack to run properly
[Solution]      N/A
[Verification]  Run libprivilege-control tests on target.
                Verify with both smack and nosmack variants.
                4 tests should be run only at smack mode:
                perm_add_additional_rules_smack_access_*

Change-Id: I3fc96531d90a71ca5b0feeea181f722e99bd84e7

10 years agoFix removing unnecessary define.
Marcin Niesluchowski [Thu, 6 Mar 2014 15:40:36 +0000 (16:40 +0100)]
Fix removing unnecessary define.

[Issue#]        N/A
[Bug/Feature]   Using unnecessary define dependent on wrt-commons.
[Cause]         N/A
[Solution]      Using true instead of TRUE macro.
[Verification]  Build with wrt-commons devel. Run.
                privilege_control11_app_enable_permissions_nosmack should pass.
                Do the same for wrt-commons master branch.

Change-Id: I3e01a51b01a07c81d606506aa1295c4a052561e7

10 years agoAdd test for security_server_is_pwd_valid.
Bartlomiej Grzelewski [Tue, 18 Feb 2014 12:51:49 +0000 (13:51 +0100)]
Add test for security_server_is_pwd_valid.

[Issue#]    N/A
[Cause]     Korea claims that this function returns 0 after date was
            moved back.
[Bug]       Not found.
[Solution]  N/A

[Verification] Build, run tests.

Change-Id: I317a21692a360fa3dafa6b9d067899aebd68db43

10 years agoAdd additional tests for password service.
Bartlomiej Grzelewski [Mon, 27 Jan 2014 15:26:38 +0000 (16:26 +0100)]
Add additional tests for password service.

[Issue#]      N/A
[Bug/Problem] Security-server set up wrong value as validSec when
              password validity time was set as "never expired".
[Cause]       N/A
[Solution]    N/A

[Verification] Build, run tests.

Change-Id: I2fa830899786ee72f4d24ac3f1a9cd771527552e

10 years agoFix set privilege tests for OSP and EFL
Zofia Abramowska [Thu, 13 Feb 2014 12:57:44 +0000 (13:57 +0100)]
Fix set privilege tests for OSP and EFL

[Issue#] PSDAC-125
[Bug] Imporper tests for perm_app_set_privilege
[Cause] App type for OSP should be "tpk" inseatd of NULL.
No test for EFL type of application.
[Solution] Changed app type for OSP and added perm_app_set_privilege
tests for EFL.
[Verification] Build. Run libprivilege tests. One test more should be
run and no more tests should fail.

Change-Id: I366368e4ba3ef5e9389ed15abd0fd056b937015b

10 years agoFixing privilege_control05_perm_get_permissions.
Marcin Niesluchowski [Mon, 24 Feb 2014 12:44:57 +0000 (13:44 +0100)]
Fixing privilege_control05_perm_get_permissions.

[Issue#]        N/A
[Bug/Feature]   Temporary array passed as an argument.
[Cause]         Build fails.
[Solution]      Changing it to local variable.
[Verification]  Build tests, run, privilege_control05_perm_get_permissions should pass.

Change-Id: I77a112698b7b016a71f68599b27a15f49fec363d

10 years agoTest cases for app privileges state getters
Pawel Broda [Thu, 16 Jan 2014 12:55:02 +0000 (13:55 +0100)]
Test cases for app privileges state getters

[Issue#]        SSDWSSP-627
[Feature]       Tests for added API functions.
[Cause]         N/A
[Solution]      N/A
[Verification]  Build and run tests on the target
                The code to be tested:
                http://slp-info.sec.samsung.net/gerrit/#/c/341259/

Change-Id: I10189b0c528f34f5cb74531109e7461cd6d1a4b1

10 years agoRemove password retry timeouts where not needed.
Lukasz Wojciechowski [Fri, 7 Feb 2014 11:00:12 +0000 (12:00 +0100)]
Remove password retry timeouts where not needed.
Replace related magic numbers with proper define.

[Issue#]        N/A
[Feature]       Some timeouts are no longer needed.
[Cause]         N/A
[Solution]      N/A
[Verification]  Build and run security-server tests on the target.
                Verify with both smack and nosmack variants.

Change-Id: I75ab774048c0f5793bde7c7f36e423d8cd8a1275

10 years agoFix dbus tests.
Marcin Niesluchowski [Mon, 10 Feb 2014 15:52:41 +0000 (16:52 +0100)]
Fix dbus tests.

[Issue#]        PSDAC-50
[Bug/Feature]   Dbus tests fail.
[Cause]         Wrong smack access format.
[Solution]      Chaning smack access.
[Verification]  Build, install, run. All dbus tests should pass.

Change-Id: Id4ccc05a005a6703dea62dee2f12cc0d64975d01

10 years agoAdd a test for perm_app_remove_path().
Damian Chromejko [Wed, 4 Dec 2013 08:11:36 +0000 (09:11 +0100)]
Add a test for perm_app_remove_path().

[Issue#]       SSDWSSP-698
[Feature/Bug]  N/A
[Cause]        Extension of libprivilege-control API needs tests.
[Solution]     Added a test for perm_app_remove_path.
[Verification] Build, install, run tests.
               Please build libprivilege-control including patch:
               http://slp-info.sec.samsung.net/gerrit/#/c/358698/

Change-Id: Iba635e512110e4d7e3ec7dd138e6d1700dae2575

10 years agoFixing libsmack tests.
Marcin Niesluchowski [Wed, 5 Feb 2014 09:54:10 +0000 (10:54 +0100)]
Fixing libsmack tests.

[Issue#]        PSDAC-50
[Bug/Feature]   libsmack tests fail.
[Cause]         Access format does not allow additional characters.
                Default tests label is not "_".
[Solution]      Changing accesses to proper ones.
                Changing way of installing manifest file and adding exec labels
                for binaries.
[Verification]  Build, install and run libsmack tests. All should pass.

Change-Id: Ie31f43137c83a74d6c9a829bfecc828f8fff0e60

Conflicts:

packaging/security-tests.spec

10 years agoCookie API tests cleanup.
Michal Witanowski [Thu, 12 Dec 2013 11:04:00 +0000 (12:04 +0100)]
Cookie API tests cleanup.

[Issue#]       SSDWSSP-796
[Bug/Feature]  N/A
[Cause]        Mess in security server tests code.
[Solution]     Move all the test cases connected with cookies API
               to cookie_api.cpp. Remove redundant tests.
               Fixed failing tc06_check_API_middleware_denied
               (now tc_unit_09_02_cookie_API_access_deny).
[Verification] Build, install and run security server tests.

Change-Id: Iaa2b025e36f9bed5c670e206c49bb59f44c80e52

10 years agoTest case for transaction rollback in libprivilege-control
Pawel Broda [Mon, 20 Jan 2014 14:03:01 +0000 (15:03 +0100)]
Test case for transaction rollback in libprivilege-control

[Issue#]        SSDWSSP-609
[Feature]       Test case for new libprivilege-control API
                function: perm_rollback().
[Cause]         N/A
[Solution]      N/A
[Verification]  Build and run on the target.
                Build together with libprivilege-control package
                containing:
                http://slp-info.sec.samsung.net/gerrit/#/c/337121/

Change-Id: I1bd9f2de29276b2c6a2c5fbd3a457f800088fa79

10 years agoFixing klocwork bugs
Zofia Abramowska [Thu, 21 Nov 2013 11:36:30 +0000 (12:36 +0100)]
Fixing klocwork bugs

[Issue#] N/A
[Bug] Memory leaks, null pointer dereferrences.
[Cause] N/A
[Solution] Fixing memory leaks with C++ standard classes, checking
null values of pointers
[Verification] Build. Tests passes for libsmack, ss-password,
ss-client-smack and ss-dbus should not change for worse.

Change-Id: Ie0ab2ea7745118f1129f9eaef80b433cc4c3624e

10 years agoAdding configuration file regarding dbus policy.
Marcin Niesluchowski [Wed, 29 Jan 2014 08:57:23 +0000 (09:57 +0100)]
Adding configuration file regarding dbus policy.

[Issue#]        SSDWSSP-750
[Bug/Feature]   Security-server tests using dbus fail.
[Cause]         Lack of dbus policy for security-tests.
[Solution]      Adding conf file.
[Verification]  Build, install, run tests.

Change-Id: I932fc6712aee0211a06940133e09db61dde45c12

10 years agoChange sensitive names to more proper ones.
Marcin Niesluchowski [Thu, 16 Jan 2014 06:54:32 +0000 (07:54 +0100)]
Change sensitive names to more proper ones.

[Issue#]        N/A
[Bug/Feature]   Some names could be registered as trademarks.
[Cause]         N/A
[Solution]      Changing names.
[Verification]  Build. Run tests. Test results should not change.

Change-Id: I167be87d597d05c4785edf814bca6fb3f5aeea4c

10 years agoChange name security_server_open_for.cpp to open_for.cpp.
Bartlomiej Grzelewski [Thu, 12 Dec 2013 16:20:08 +0000 (17:20 +0100)]
Change name security_server_open_for.cpp to open_for.cpp.

[Issue#]      N/A
[Bug]         N/A
[Cause]       N/A
[Solution]    N/A

[Verification] Build, run tests.

Change-Id: Ia6de5176d9df280870599145dea5b49a6f8a0681

10 years agoUse ScopedClose instead unique_ptr.
Bartlomiej Grzelewski [Tue, 28 Jan 2014 12:49:09 +0000 (13:49 +0100)]
Use ScopedClose instead unique_ptr.

[Issue#]   N/A
[Bug]      N/A
[Cause]    N/A
[Solution] N/A

[Verification] Build, run tests.

Change-Id: Ied85673562f17e6a448503a89ae5a3d3effc7a0b

10 years agoImproved tests for *open_for* functions.
Zbigniew Jasinski [Tue, 26 Nov 2013 13:07:22 +0000 (14:07 +0100)]
Improved tests for *open_for* functions.

[Issue#]        SSDWSSP-398
[Bug/Feature]   New SS API function.
[Cause]         DataControl issues.
[Solution]      Proposal for DataControl issues.
[Verification]  Build and run new tests.

Change-Id: Ib8c4d1a39cbd3956ae72254d3d9fc38eb4453cb1

10 years agoRemove tracker.
Bartlomiej Grzelewski [Thu, 23 Jan 2014 13:49:20 +0000 (14:49 +0100)]
Remove tracker.

Tracker was replaced with macro RUNNER_ASSERT_MSG_BT which is able
to print full backtrace.

[Issue#]   N/A
[Bug]      N/A
[Cause]    N/A
[Solution] N/A

[Verification] Build, run tests.

Change-Id: Ic5bdd6584ce11edcfa662c54807b042104284062

10 years agoFix missing <iostream> header include
Lukasz Wojciechowski [Thu, 23 Jan 2014 14:41:00 +0000 (15:41 +0100)]
Fix missing <iostream> header include

[Issue#]        N/A
[Bug]           missing needed <iostream> include
[Cause]         N/A
[Solution]      add missing header
[Verification]  Build tests

Change-Id: Id20adae2f80b769c42a1e9381f62c35596f06143

10 years agoAdd test for libprivilege-control / perm_add_additional_rules.
Lukasz Wojciechowski [Thu, 9 Jan 2014 13:34:48 +0000 (14:34 +0100)]
Add test for libprivilege-control / perm_add_additional_rules.

[Issue#]        SSDWSSP-679
[Feature]       Add new tests covering perm_add_additional_rules.
[Cause]         Function need to be tested.
[Solution]      Add tests checking database.
[Verification]  Build security-tests.
                Run tests on target:
                "security-tests.sh libprivilege-control --output=text \
                    --regexp=perm_add_additional_rules"

Change-Id: Idcb2f996d55aa1a7b557e830824e78af46a63f0e

10 years agoProvides macro for easy backup of libprivilege DB
Pawel Broda [Mon, 13 Jan 2014 15:51:32 +0000 (16:51 +0100)]
Provides macro for easy backup of libprivilege DB

[Issue#]        SSDWSSP-732
[Feature]       Implement better DB management in our libprivilege-control tests.
[Cause]         It was not possible to withdraw changes done by some of the tests.
                As a result some of the DB changes were permanent.
[Solution]      Provide a macro which backups DB before each test and copies it back
                after the test.
[Verification]  Build and run on the target.

Change-Id: I2c46c69ee3cc122bc8567e5f97ed9530940bb508

10 years agoAdd NULL at the end of array.
Bartlomiej Grzelewski [Tue, 21 Jan 2014 15:02:09 +0000 (16:02 +0100)]
Add NULL at the end of array.

[Issue#]    N/A
[Bug]       Lack of NULL at the end of array may cause segmentation
            fault.
[Cause]     N/A
[Solution]  N/A

[Verification] Build, run tests.

Change-Id: Ie834aab741807bbe8b9974b82adea5fca0ce767a

10 years agoFix compilation problem with gcc 4.8.
Bartlomiej Grzelewski [Tue, 21 Jan 2014 13:37:41 +0000 (14:37 +0100)]
Fix compilation problem with gcc 4.8.

[Issue#]    N/A
[Bug]       Build break.
[Cause]     Lack of header files.
[Solution]  N/A

[Verification] Build.

Change-Id: Idd057f34c57278ee25841732847b8ade4175696e

10 years agoUse pragma to allow test of deprecated functions.
Bartlomiej Grzelewski [Mon, 20 Jan 2014 14:29:51 +0000 (15:29 +0100)]
Use pragma to allow test of deprecated functions.

[Issue#]   N/A
[Bug]      Build break.
[Cause]    Usage of deprecated function in tests.
[Solution] Use pragma to remove compilation errors.

[Verifcation] Build, run tests.

Change-Id: Iae1a364ea45cbe1c9763660ed49c8638afd84f57

10 years agoUpdating test macros (DPL enhancement - line printing in case of error)
Pawel Broda [Tue, 7 Jan 2014 13:56:20 +0000 (14:56 +0100)]
Updating test macros (DPL enhancement - line printing in case of error)

[Issue#]        SSDWSSP-710
[Feature]       Provides backtrace in case of test failure.
[Cause]         Old macros (RUNNER_ASSERT & RUNNER_ASSERT_MSG) did not
                provide backtrace in case of test failure.
[Solution]      Replacing old macros with the new ones providing bactrace.
[Verification]  Run tests on the target.

Change-Id: I5c553c8b254c1bf268b7a604c1f6dc833b1f1075

10 years agoAdd new test cases for security-server password API.
Damian Chromejko [Fri, 6 Dec 2013 14:44:22 +0000 (15:44 +0100)]
Add new test cases for security-server password API.

[Issue#]       SSDWSSP-707
[Feature/Buf]  New test case.
[Cause]        Checking cases not considered before.
[Solution]     Added a test checking if security-server behaves as required.
               Test tc41_security_server_empty_history_check was reworked in
               SSDWSSP-708 to check reusing password after limiting history
               because, although technically a part of this issue, it was
               necessary for the whole testsuite to pass.
[Verification] Build, install, run tests.

Change-Id: I0218d5fe411c3479140095c05942bb107fcc83df

10 years agoAdd tests for perm_app_get_permissions().
Damian Chromejko [Fri, 22 Nov 2013 12:00:31 +0000 (13:00 +0100)]
Add tests for perm_app_get_permissions().

[Issue#]       SSDWSSP-669
[Feature/Bug]  N/A
[Cause]        Extension of libprivilege-control API.
[Solution]     Added tests for new methods.
[Verification] Build, install and run libprivilege-control-test.

Change-Id: Ia8cc9aa9fe2eb7d8d6421b1cd54a1847333dd061

10 years agoAdd tests for perm_app_get_paths().
Damian Chromejko [Thu, 28 Nov 2013 14:20:51 +0000 (15:20 +0100)]
Add tests for perm_app_get_paths().

[Issue#]       SSDWSSP-670
[Feature/Bug]  New test cases for perm_app_get_paths().
[Cause]        Extension of libprivilege-control API
[Solution]     Added tests for new methods.
[Verification] Build, install and run libprivilege-control-test.

Change-Id: Ifc280e76022f8c5341fd4dd26a33024e7ad336c8

10 years agoChanges in tests regarding libprivilege API change
Sebastian Grabowski [Tue, 5 Nov 2013 10:51:04 +0000 (11:51 +0100)]
Changes in tests regarding libprivilege API change

[Issue#]        SSDWSSP-620
[Bug/Feature]   Add new API in libprivilege-control and use it in
                installators (perm_app_setup_permissions)
[Cause]         There is a need that only installators could add
                persistent rules
[Solution]      Update tests to use new libprivilege api mainly for
                perm_app_setup_permissions.
[Verification]  Build, install, run tests.

Change-Id: I18ddd5d286988584cd822a4b929419c8bc1c6102

10 years agoDPL enhancement - line printing in case of error
Pawel Broda [Tue, 10 Dec 2013 15:24:09 +0000 (16:24 +0100)]
DPL enhancement - line printing in case of error

[Issue#]        SSDWSSP-710
[Feature]       Provides backtrace (i.e. source code file name + line number)
                in case of error.
[Cause]         Info amount in case of test failure was not sufficient
                to determine execution path. There was a need of passing
                __LINE__ or similar preprocessor macros as arguments.
[Solution]      Backtrace printing based on the gdb output (gdb is triggered
                after particular test fails).
[Verification]  Compile & install on the target. Run without gdb installed too.
                Run example tests which fails and examine the output.

Change-Id: I749b8efa9ce457df41baebbaefd6aec869f772a7

10 years agoFix issue with SS restarting during password tests problem.
Zbigniew Jasinski [Wed, 27 Nov 2013 13:44:06 +0000 (14:44 +0100)]
Fix issue with SS restarting during password tests problem.

[Issue#]        SSDWSSP-671
[Bug/Feature]   Problem with SS restarting.
[Cause]         There is rate limit on service restarts in SystemD (5 in 10 s).
[Solution]      Send to SystemD SS service ResetFailed to restart rate counter.
[Verification]  Compile, run SS password tests.

Change-Id: I0d67e810f2fc63a740be2f987faf6d66476e0858

10 years agoFix broken security server password tests
Piotr Bartosiewicz [Tue, 17 Dec 2013 13:34:40 +0000 (14:34 +0100)]
Fix broken security server password tests

[Issue#]        SSDWSSP-730
[Bug/Feature]   N/A
[Cause]         N/A
[Solution]      Fix passwd_allow test. Enable previously ignored
                password tests.
[Verification]  Build tests and security-server from devel, install, run
                tests. Tests that should pass:
                 - tc03_check_API_passwd_allow
                 - tc04_check_API_passwd_denied
                 - tc06_check_API_middleware_denied

Change-Id: Ia2cf3d5b542ddf8cbc332542500a5d99ced46687

10 years agoAdd summary view to all security tests.
Michal Witanowski [Wed, 20 Nov 2013 10:52:55 +0000 (11:52 +0100)]
Add summary view to all security tests.

[Issue#]       SSDWSSP-522
[Bug/Feature]  Running security tests via security-tests-all.sh prints
               summary view (all tests results summed together).
[Cause]        N/A
[Solution]     A new results collector for WRT tests runner was created
               (SummaryCollector in summary_collector.h). The collector
               counts all the test cases results and appends a line to
               a temporary file containing: number of all test cases,
               succeeded, failed and ignored.
               Then, after the tests are executed, tests-summary.sh
               sums the columns and prints summary in the console.
[Verification] Build, install, run all security tests via
               security-tests-all.sh and wait for summary at the very
               end of script output.

Change-Id: Id44cfb90acbc426e17e1971807e6eef0496c7805

10 years agoAdd security server password test that assures absence of retry timeout check
Lukasz Wojciechowski [Mon, 9 Dec 2013 15:01:45 +0000 (16:01 +0100)]
Add security server password test that assures absence of retry timeout check

[Issue#]       SSDWSSP-709
[Feature/Bug]  Need for a new test after removal of retry timeout check.
[Problem]      Rapid password check sequences should be possible.
[Cause]        Protect from regression.
[Solution]     Added new test tc43_security_server_no_retry_timeout.
[Verification] Succesfull build and run of tests:
               security-tests.sh ss-password --output=text

Change-Id: Iba375858fd6d158212058b0ced7b26ac9c5c8e84

10 years agoFix tests in security-server-test-client smack.
Bartlomiej Grzelewski [Fri, 13 Dec 2013 17:38:40 +0000 (18:38 +0100)]
Fix tests in security-server-test-client smack.

[Issue#]      724
[Bug/Problem] Enabling socket labels in security-server crashes some
              tests.
[Cause]       Test cases did not set up smack labels.
[Solution]    Fix set up of smack labels.

[Verification] Build, run tests.

Change-Id: I6c56e8df90d47c7d183fa2ac279c157682d0103f

10 years agoSqlite3 support for tests. Libprivilege tests: check database
Lukasz Wojciechowski [Mon, 18 Nov 2013 09:53:46 +0000 (10:53 +0100)]
Sqlite3 support for tests. Libprivilege tests: check database
records instead of existance of files.

[Issue#]        SSDWSSP-644
[Feature]       Tests need database records access
[Cause]         Tests should verify libprivilege actions by
                checking database records
[Solution]      Sqlite3 access API, tests use database instead
                of files
[Verification]  Build security-tests, run two following
                libprivilege-control tests on target:
                privilege_control04_add_permissions_nosmack,
                privilege_control11_app_enable_permissions_nosmack.

Change-Id: I0c229f67a6791e9f8f850494eedebc925cf63ad3

10 years agoFix tests after bugfix in security-server code.
Bartlomiej Grzelewski [Thu, 12 Dec 2013 19:13:23 +0000 (20:13 +0100)]
Fix tests after bugfix in security-server code.

[Issue#]       SSDWSSP-708
[Feature/Bug]  Some tests in security_server_tests_password suite were
failing.
[Cause]        Behavior of security-server in version 115 changed.
[Solution]     Adjusted tests to the new behavior of security-server.
[Verification] Build, install and run security-server-tests-password -
all tests should pass.

Change-Id: I55da674b596446e24e61ec81a6dd99c1fc4136c2

10 years agoAdded test cases for SMACK L-access mode
Pawel Polawski [Mon, 4 Nov 2013 14:39:50 +0000 (15:39 +0100)]
Added test cases for SMACK L-access mode

[Issue#]        SSDWSSP-502
[Bug/Feature]   Verify if L-access mode is working on private images
[Cause]         Missing tests for L-access mode
[Solution]      Tests for L-access mode added
[Verification]  Compile, run tests. They are included to smack tests

Change-Id: I54bbc7b2f3bf235091d98c7b4ea87febd546ba97