From: Marcin Niesluchowski Date: Tue, 1 Apr 2014 16:44:41 +0000 (+0200) Subject: Fix tc_unit_06_01_security_server_get_smacklabel_cookie test. X-Git-Tag: security-manager_5.5_testing~266 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f310144f73c3bf803c6a0de88cbd5e5d30143e3a;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git 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 --- diff --git a/tests/security-server-tests/cookie_api.cpp b/tests/security-server-tests/cookie_api.cpp index 35a135f..bfae680 100644 --- a/tests/security-server-tests/cookie_api.cpp +++ b/tests/security-server-tests/cookie_api.cpp @@ -394,7 +394,7 @@ RUNNER_CHILD_TEST_SMACK(tc_unit_05_03_app_user_security_server_get_cookie_pid) //--------------------------------------------------------------------------- //root has access to API -RUNNER_CHILD_TEST(tc_unit_06_01_security_server_get_smacklabel_cookie) +RUNNER_CHILD_TEST_SMACK(tc_unit_06_01_security_server_get_smacklabel_cookie_smack) { setLabelForSelf(__LINE__, "selflabel_06_01"); @@ -406,6 +406,22 @@ RUNNER_CHILD_TEST(tc_unit_06_01_security_server_get_smacklabel_cookie) << label.get()); } +//--------------------------------------------------------------------------- +//root has access to API +RUNNER_CHILD_TEST_NOSMACK(tc_unit_06_01_security_server_get_smacklabel_cookie_nosmack) +{ + Cookie cookie = getCookieFromSS(); + + char *receivedLabel = security_server_get_smacklabel_cookie(cookie.data()); + RUNNER_ASSERT_MSG_BT(receivedLabel != NULL, + "security_server_get_smacklabel_cookie returned NULL"); + std::string label(receivedLabel); + free(receivedLabel); + RUNNER_ASSERT_MSG_BT(label.empty(), + "security_server_get_smacklabel_cookie returned: " + << label); +} + //privileges drop and no smack rule RUNNER_CHILD_TEST_SMACK(tc_unit_06_02_app_user_security_server_get_smacklabel_cookie) {