platform/core/test/security-tests.git
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

10 years agoSimple interface for set up rules.
Bartlomiej Grzelewski [Mon, 2 Dec 2013 11:08:04 +0000 (12:08 +0100)]
Simple interface for set up rules.

Add classes to smack rules managment.
Refactoring of security_server_tests*.

[Issue#]     N/A
[Problem]    People set wrong privileges in tests.
[Cause]      N/A
[Solution]   Create class to help them set proper smack rules.

[Verification] Build, run tests.

Change-Id: Icab5a8f54be9c46ee69fba59f4503d8b4c99b852

10 years agoFix for failing test (smack05_self_label) in libsmack test suite
Pawel Broda [Wed, 6 Nov 2013 08:28:12 +0000 (09:28 +0100)]
Fix for failing test (smack05_self_label) in libsmack test suite

[Issue#]        SSDWSSP-601
[Bug]           smack05_self_label in libsmack test suite failed.
                Additionally, this fix provides the same smack
                labels "_" no matter what type of connection is
                used to communicate with the target (ssh or sdb).
[Cause]         Smack execute label on /usr/bin/libsmack-test is not
                always the same. It depends on the connection type
                during istallation.
                ssh names it "_" and sdb names it "sdbd".
[Solution]      Create "packaging/security-test.manifest" file.
[Verification]  Build, install, run test.

Change-Id: Id1cab6bb7d069e4eb8aa068d792e8344613c6986

10 years agoSecurity server test cases fix
Michal Witanowski [Thu, 7 Nov 2013 16:44:35 +0000 (17:44 +0100)]
Security server test cases fix

[Issue#]       SSDWSSP-604
[Bug/Feature]  Two test cases in security_server_test_server.cpp
               (tc_ask_for_privilege_with_default_cookie_normal[...]
               - now tc_cookie_check_groups_privilege_positive
               and tc05_check_API_middleware_allow) were failing
               when connecting to a device via SDB.
[Cause]        SDB has different enviroment configuration than SSH.
               Launching an application via SSH makes it belong to
               3 groups ("audio" is one of them), while SDB doesn't.
               These two test cases assume that the process belongs
               to "audio" group, so launching them via SDB causes
               they fail.
[Solution]     Add "audio" group to the test's process before
               running the test cases (see add_process_group and
               remove_process_group).
[Verification] Build, install and run security server tests. The following
               test cases, affected by this commit, should pass:
               tc_cookie_check_groups_privilege_negative
               tc_cookie_check_groups_privilege_positive
               tc_ask_for_privilege_with_default_cookie_case_with_wrong_cookie
               tc05_check_API_middleware_allow
               tc06_check_API_middleware_denied
               tc05_check_API_middleware_allow_nosmack

Change-Id: I47a0f4a3715ade527ea9db048f98a1206aefd51a

10 years agoFix tc03_check_API_passwd_allow
Michal Witanowski [Wed, 13 Nov 2013 14:55:16 +0000 (15:55 +0100)]
Fix tc03_check_API_passwd_allow

[Issue#]       SSDWSSP-559
[Bug/Feature]  tc03_check_API_passwd_allow was failing randomly.
[Cause]        SS needed to be restarted after clearing
               opt/data/security-server/ folder.
[Solution]     Fix bugs and adapt the test case to the new security
               server in both smack and non-smack test versions.
               Additionally, reset_security_server() has beed moved to
               security_server_clean_env.cpp.
[Verification] Build, install and run the test case.

Change-Id: I38dbe9d2ea3c18f491b40817422ed922942fd831

10 years agoAdd a test for libprivilege_strerror.
Damian Chromejko [Tue, 19 Nov 2013 12:15:11 +0000 (13:15 +0100)]
Add a test for libprivilege_strerror.

[Issue#]       SSDWSSP-646
[Bug]          N/A
[Cause]        Changed API of libprivilege-control.
[Solution]     Test if proper error descriptions are returned for error codes.
[Verification] Run libprivilege-control-test.

Change-Id: I0a48348e707311f593aa4b6b7065a3956b1e375d

10 years agoSecurity-client removed
Krzysztof Jackiewicz [Wed, 27 Nov 2013 11:06:41 +0000 (12:06 +0100)]
Security-client removed

[Issue#] N/A
[Feature/Bug] N/A
[Problem] Security-client is outdated and no longer used
[Cause] N/A
[Solution] Removed

[Verification] Successfull compilation

Change-Id: I5a789109be4c4fed1c239938f9a034b7943fd3cb

10 years agoRearrange tests for cookies
Pawel Polawski [Wed, 9 Oct 2013 10:08:18 +0000 (12:08 +0200)]
Rearrange tests for cookies

[Issue#]        SSDWSSP-493
[Bug/Feature]   Put SS cookie api tests together
[Cause]         Tests are scattered in to many files
[Solution]      All cookie api tests are now together
[Verification]  Compile, run tests. 3 of them should fail due to
                disabled full SMACK protection of SS API.
                New tests are included in security-server-server.
                To run them use "security-tests.sh ss-server
                --output=text"

Change-Id: I845fa0e1669914eb34c91600799b8defc2da0368

10 years agoRemove test of security_server_get_object_name.
Bartlomiej Grzelewski [Tue, 26 Nov 2013 10:03:17 +0000 (11:03 +0100)]
Remove test of security_server_get_object_name.

Function security_server_get_object_name will be removed from
security-server.

[Issue#]      N/A
[Bug/Problem] Tests of deprecated/unused api.
[Cause]       N/A
[Solution]    Test were removed.

[Verfication] Build, run tests.

Change-Id: Iba39345e8fa6a109c6284d99e4c2eee73d2f9720

10 years agoAdd new test cases. Correct old tests with history.
Lukasz Kostyra [Mon, 18 Nov 2013 09:56:46 +0000 (10:56 +0100)]
Add new test cases. Correct old tests with history.

[Issue#]        N/A
[Feature]       Add new test cases that check other unusual situations in security-server
                password service. Correct previous tests due to recently found bug related to
                incorrect history management.
[Cause]         N/A
[Solution]      Add tc41 and tc42 test cases. Fixing aforementioned bug changed logic in previous
                test cases. This commit fixes those tests aswell.
[Verification]  Build, install, run security-server-tests-password --output=text. With new password
                service ( http://slp-info.sec.samsung.net/gerrit/#/c/289969/) all tests should pass

Change-Id: I1721c6037f6e2069dcfed7c41c86d2b0021b1353

10 years agoFix broken tests for security-server.
Bartlomiej Grzelewski [Thu, 21 Nov 2013 13:29:20 +0000 (14:29 +0100)]
Fix broken tests for security-server.

[Issue#]     N/A
[Feaute/Bug] N/A
[Cause]      Test in security-server test suite was too long.
[Problem]    Sometimes tests failes because of timeout.

[Verification] Build, run tests.

Change-Id: I75461afa810a66707624119e123793aa6ef5aad5

10 years agoAdded security server stress tests
Pawel Polawski [Mon, 22 Jul 2013 09:39:26 +0000 (11:39 +0200)]
Added security server stress tests

[Issue#]        SSDWSSP-250
[Bug/Feature]   N/A
[Cause]         Missing stress tests for security server
[Solution]      Stress tests added
[Verification]  New tests should be avaible after compilation.
                They are available through security-server-tests-stress
                binary. It is also caled by security-tests-all.sh,
                or using security-tests.sh with ss-stress parameter.

Change-Id: I8688d7326c201482928688407c42ff1adf8b4c7f

10 years agoTests for new Security Server security_server_open_for function.
Zbigniew Jasinski [Wed, 30 Oct 2013 15:57:41 +0000 (16:57 +0100)]
Tests for new Security Server security_server_open_for function.

This function allows to create, if doesn't exist, or open existing file by
Security Server on behalf of calling process in secured directory.

[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: I86303926a53092fdcc1c14599bfbfc81cb91e8bc

10 years agoAdd new Libprivilege and Security-Server API tests.
Marcin Lis [Thu, 3 Oct 2013 14:20:27 +0000 (16:20 +0200)]
Add new Libprivilege and Security-Server API tests.

[Issue#]       SSDWSSP-527
[Feature]      N/A
[Cause]        New API for checking app permission assignment created.
[Solution]     Use new API functions in libprivilege-tests and
               security-server-tests-server.
               Also tc09 and tc10 in ssts are now corrected.
[Verification] Build, install & run tests.

Change-Id: I4fe8b9f3699f60f7a63d92332ba5fa910ca2400d

10 years agoRemove hardcode uid's & gid's
Marek Smolinski [Tue, 24 Sep 2013 06:24:45 +0000 (08:24 +0200)]
Remove hardcode uid's & gid's

    [Issue#]       SSDWSSP-532
    [Feature/Bug]  N/A
    [Cause]
    [Solution]     Add gid's & uid's in common header

    [Verification] Build, run tests

Change-Id: I80aae956613896de6f19f82b417cd3a54214a08e

10 years agoAdd new test cases for password service v2 for better error checking.
Michal Witanowski [Thu, 17 Oct 2013 12:20:13 +0000 (14:20 +0200)]
Add new test cases for password service v2 for better error checking.

[Issue#]        SSDWSSP-593
[Bug/Feature]   Add new test cases in order to test security server
                behavior in various scenarios.
[Cause]         N/A
[Solution]      The following test cases have been created:
                - tc34_security_server_max_attempts
                - tc35_security_server_decrease_max_attempts
                - tc36_security_server_challenge_history_passwords
                - tc37_security_server_challenge_mixed
                - tc38_security_server_history_depth_change
                - tc39_security_server_attempts_num_check_after_reset
                - tc40_security_server_history_check_after_reset
[Verification]  Build, install and run security server's password
                tests. All of them should pass without any problems
                under new SS (which can be found here:
                http://slp-info.sec.samsung.net/gerrit/#/c/289969/).

Change-Id: Ic72a564d49d6919ac3a376cd821bdcdf71940d81

10 years agoAdapt security-server tests to new SS password service
Lukasz Kostyra [Tue, 24 Sep 2013 07:28:08 +0000 (09:28 +0200)]
Adapt security-server tests to new SS password service

[Issue#]        N/A
[Bug]           N/A
[Cause]         Incorrect return values expected by asserts.
[Solution]      Correct return values expected by asserts.
[Verification]  Build, install, run security-server-tests-password. All tests should pass.

Change-Id: I351655de0e4e3d76b737a38c226d933e878aafa5

10 years agoFix set_app_privilege tests
Piotr Bartosiewicz [Tue, 12 Nov 2013 16:46:49 +0000 (17:46 +0100)]
Fix set_app_privilege tests

[Issue#]        N/A
[Bug/Feature]   privilege_control05_set_app_privilege tests fails
[Cause]         perm_end fails after perm_app_set_privilege call
[Solution]      Remove transaction around perm_app_set_privilege calls
[Verification]  Build, install, run tests

Change-Id: Ida1b94eff78180a217f9410f1d168d75a43179e3

10 years agoFix libprivilege-control nosmack tests
Piotr Bartosiewicz [Fri, 18 Oct 2013 14:04:43 +0000 (16:04 +0200)]
Fix libprivilege-control nosmack tests

[Issue#]        SSDWSSP-581
[Bug]           Many of libprivilege tests fail on nosmack kernel
[Cause]         The test cases are not adjusted to the new version of
                libprivilege.
[Solution]      Don't use deprecated APP_TYPE_OTHER; use DB_BEGIN,
                DB_END, perm_app_install, where it is expected; don't
                check SMACK_RULES_DIR dir while it is not used amymore.
[Verification]  Build, install (with new libprivilege) and check on
                smack and no-smack version of kernel.

Change-Id: I8bbf53857c9f1b69a0f40e606c0e9fe795ab0ba2

10 years agoFixing security-server client nosmack tests.
Marcin Niesluchowski [Mon, 28 Oct 2013 15:27:36 +0000 (16:27 +0100)]
Fixing security-server client nosmack tests.

[Issue#]        SSDWSSP-603
[Bug/Feature]   Security-server client smack tests fail.
[Cause]         Incorrect and redundant use of smack_set_label_for_self function.
[Solution]      Separating tests for smack enabled and disabled removing unwanted
                functions.
[Verification]  Running tests. All security-server client tests *_get_uid_* and
                *_get_gid_* tests should pass.

Change-Id: Iee48bc2e3bddc7f23cd9392febe385a8021a373a

10 years agoUpgrade libsmack npruntime tests.
Marcin Lis [Fri, 25 Oct 2013 08:38:05 +0000 (10:38 +0200)]
Upgrade libsmack npruntime tests.

[Issue#]       SSDWSSP-599
[Feature]      N/A
[Cause]        libprivilege-control and smack-privilege-config changed.
[Solution]     Test case nr 20 changed from general to SMACK version, few
               instructions added. New NOSMACK version of this test case is
               now created.
[Verification] Build, install and run tests including the following commits:
               http://slp-info.sec.samsung.net/gerrit/#/c/315582/
               http://slp-info.sec.samsung.net/gerrit/#/c/315493/

               Run tests on target without smack also.

Change-Id: Id156de668557d590155970e8b91145cf8a5217f9

10 years agoImplement test for adding new WRT rules in libprivilege-control
Marcin Lis [Wed, 23 Oct 2013 10:44:29 +0000 (12:44 +0200)]
Implement test for adding new WRT rules in libprivilege-control

[Issue#]       SSDWSSP-599
[Feature]      New test for perm_app_setup_path with
               new option PERM_APP_PATH_RUNTIME.
[Cause]        New functionality.
[Solution]     New test case nr 20 in libprivilege tests.
               Currently ignored tc 20 switched to tc 21.
[Verification] Build, install, run:
               # libprivilege-control-test --output=text
               Verify that tc20 npruntime is passing and no
               other test cases are affected.

               Synchronize libprivilege with the following commit:
               http://slp-info.sec.samsung.net/gerrit/#/c/314185/

Change-Id: I468a6091997d608ff2b10ebd893b88fca8bf641f

10 years agoChecking whether required application is installed
Piotr Bartosiewicz [Tue, 8 Oct 2013 14:51:06 +0000 (16:51 +0200)]
Checking whether required application is installed

[Issue#]        SSDWSSP-573
[Bug/Feature]   Poor assertion message when wrt or osp application is
                not installed correctly.
[Cause]         Tested process calls exit so there is printed useless
                message 'Reading pipe error'.
[Solution]      Additional checks are added before api call.
[Verification]  Build, install, run tests.

Change-Id: Ia25efb5d8d5ca6450277d11b84b5345efa92a636

10 years agoAdd antivirus privilege test cases
Lukasz Kostyra [Thu, 12 Sep 2013 08:32:22 +0000 (10:32 +0200)]
Add antivirus privilege test cases

[Issue#]        SSDWSSP-491
[Feature]       Add test cases checking if AV has access to every type of folders set by
                perm_app_setup_path - GROUP_RW, SETTINGS_RW, PUBLIC_RO. Both SMACK and NOSMACK
                version of tests was added.
[Cause]         N/A
[Solution]      N/A
[Verification]  Build and run libprivilege-control-test. Test should pass both on SMACK and NOSMACK
                environment.

Change-Id: Ie073095f4ca78e86f9d7a7e1d5ec5e7014229504

10 years agoAdd DB::Transaction class. Change tests to use new libprivilege API.
Marcin Lis [Tue, 24 Sep 2013 10:49:23 +0000 (12:49 +0200)]
Add DB::Transaction class. Change tests to use new libprivilege API.

[Issue#]       SSDWSSP-183
[Bug/Feature]  N/A
[Cause]        N/A
[Solution]     Added class DB::Transaction which opens and closes transaction.
               Added macros DB_BEGIN and DB_END that determine DB::Transaction
               class object lifetime which in turn start and commit
               db transactions.
               Also macros used in tests to reduce test-execution time.
[Verification] Build, install, run tests.

Change-Id: I90b48c27e352fb24e9c57ec7b1bb9005d8f0fd2d

10 years agoAdd README file
Jan Cybulski [Wed, 2 Oct 2013 13:28:39 +0000 (15:28 +0200)]
Add README file

        [Issue#]       SSDWSSP-528
        [Bug/Feature]  Added README file.
        [Cause]        N/A
        [Solution]     N/A
        [Verification] N/A

Change-Id: I450c156bc8a133808babd7321ef9e4ddc11e5553

10 years agoFixing client smack tests.
Marcin Niesluchowski [Mon, 23 Sep 2013 15:25:02 +0000 (17:25 +0200)]
Fixing client smack tests.

[Issue#]        SSDWSSP-543
[Bug/Feature]   Root privileges are dropped in main test process and remaining
                tests in SECURITY_SERVER_TESTS_CLIENT_SMACK group run with them
                and fail when line with RUNNER_IGNORED_MSG deleted.
[Cause]         Changing test macros from RUNNER_CHILD* to RUNNER_MULTIPROCESS*
                on one smack and one nosmack test resulted in passing dropped
                root privileges in main process to tests run after those. Those
                privileges were held by RUNNER_CHILD* macros.
[Solution]      Keeping that macros for collecting result puposes and running
                both processes droping root privilege in child.
[Verification]  Building and running security-tests.sh ss-clientsmack. No tests
                should fail.

Change-Id: I7b1b4974dedd9a9d1d96e952411aa01cd4f3399b

10 years agoCompilation flags 'verbose' mode
Marcin Lis [Fri, 20 Sep 2013 11:55:21 +0000 (13:55 +0200)]
Compilation flags 'verbose' mode

[Issue#]       SSDWSSP-496
[Bug/Feature]  N/A
[Cause]        Potential bug - CMAKE_VERBOSE_MAKEFILE is not turned ON in
               packaging spec file, so the default value is used.
[Solution]     Turn ON the flag explicitly.
               Also, now it is possible to choose "built_type" using gbs.
[Verification] Build, verify that compile flags passed to gcc are visible
               using different build types (in gbs: --define "build_type ...").

Change-Id: I16dc7e13c86de27617f742ebb360f77cf81a4a16

10 years agoRemove useless nosmack tests
Marcin Lis [Thu, 19 Sep 2013 08:58:36 +0000 (10:58 +0200)]
Remove useless nosmack tests

[Issue#]       N/A
[Bug/Feature]  Clean up tests.
[Cause]        Some tests use deprecated or not implemented
               functions from libprivilege API.
[Solution]     Two test cases removed.
[Verification] Build, install, run tests.

Change-Id: I47f51f404a128a9517ef02b7a2af70faaed14d9c

10 years agoBig gid check fixed
Krzysztof Jackiewicz [Wed, 18 Sep 2013 12:35:59 +0000 (14:35 +0200)]
Big gid check fixed

[Issue#] N/A
[Feature/Bug] N/A
[Problem] Failing test tc04_security_server_check_privilege_weird_input_case
[Cause] Test was checking if big (>2^16) gid values are acceptable, but there
was no privilege for given gid.
[Solution] Expected value changed from SECURITY_SERVER_API_SUCCESS to
SECURITY_SERVER_API_ERROR_ACCESS_DENIED.

[Verification] Run tests. tc04_security_server_check_privilege_weird_input_case should pass.

Change-Id: Ibc7e624cfceb6d9018b685fb83340e693bcf93e0

10 years agoFix tests scripts.
Bartlomiej Grzelewski [Wed, 18 Sep 2013 13:28:05 +0000 (15:28 +0200)]
Fix tests scripts.

[Issue#]   N/A
[Bug]      Test scripts failed.
[Cause]    security-server-tests-label has been removed.
[Solution] remove call of security-server-test-label from scripts.

[Verification] Build, run tests.

Change-Id: I72bcbdc0970c2b4080279abe4d98f6539ed8ae81

10 years agoClean up libprivilege-control test cases
Zofia Abramowska [Fri, 13 Sep 2013 18:15:29 +0000 (20:15 +0200)]
Clean up libprivilege-control test cases

[Issue#] N/A
[Bug/Feature] N/A
[Cause] All test cases were in one file of 4200 lines.
[Solution] Divided test cases by functionalities tested :
normaln, nosmack, incorrect parameters, stress tests. Put them
in different source files, removed unused includes and macros,
created commons containing macros/functions used by different tests.
Created RUNNER GROUP for every funcionality.
[Verification] Build. Run libprivilege-control-test --output=text
--runignored - all tests should pass except for 4 ignores.

Change-Id: Iaf905e0cdcda043974958d294cc85e60e8d40752

10 years agoMoving ss-label to ss-client-smack
Zofia Abramowska [Wed, 11 Sep 2013 15:03:27 +0000 (17:03 +0200)]
Moving ss-label to ss-client-smack

[Issue#] N/A
[Feature/Bug] N/A
[Cause] Unnecessary separate binary for one test.
[Solution] Moved ss-label to ss-client-smack test cases.
[Verification] Build. Install. Run ss-client-smack (should be 8
passing tests).

Change-Id: I63e194dfa3eae7f07ead130f85820ecf018a5e19