Adjust AccessProvider api to current security-server.
[platform/core/test/security-tests.git] / tests / security-server-tests / cookie_api.cpp
index 7afd813..6530292 100644 (file)
 /*
 Tested API functions in this file:
 
-Protected by "security-server::api-cookie-get" label:
     int security_server_get_cookie_size(void);
     int security_server_request_cookie(char *cookie, size_t bufferSize);
 
-
-Protected by "security-server::api-cookie-check" label:
     int security_server_check_privilege(const char *cookie, gid_t privilege);
     int security_server_check_privilege_by_cookie(const char *cookie,
                                                   const char *object,
@@ -243,6 +240,7 @@ RUNNER_CHILD_TEST_SMACK(tc_unit_02_02_app_user_security_server_request_cookie)
                       "Error in security_server_get_cookie_size(): " << cookieSize);
 
     SecurityServer::AccessProvider provider("selflabel_02_01");
+    provider.allowSS();
     provider.applyAndSwithToUser(APP_UID, APP_GID);
 
     Cookie cookie(cookieSize);
@@ -301,7 +299,7 @@ RUNNER_CHILD_TEST_SMACK(tc_unit_03_03_app_user_security_server_check_privilege)
     Cookie cookie = getCookieFromSS();
 
     SecurityServer::AccessProvider provider("selflabel_03_03");
-    provider.allowFunction("security_server_check_privilege");
+    provider.allowSS();
     provider.applyAndSwithToUser(APP_UID, APP_GID);
 
     int ret = security_server_check_privilege(cookie.data(), 0);
@@ -385,7 +383,7 @@ RUNNER_CHILD_TEST_SMACK(tc_unit_05_03_app_user_security_server_get_cookie_pid)
     Cookie cookie = getCookieFromSS();
 
     SecurityServer::AccessProvider provider("selflabel_05_03");
-    provider.allowFunction("security_server_get_cookie_pid");
+    provider.allowSS();
     provider.applyAndSwithToUser(APP_UID, APP_GID);
 
     int ret = security_server_get_cookie_pid(cookie.data());
@@ -444,7 +442,7 @@ RUNNER_CHILD_TEST_SMACK(tc_unit_06_02_app_user_security_server_get_smacklabel_co
 RUNNER_CHILD_TEST_SMACK(tc_unit_06_03_app_user_security_server_get_smacklabel_cookie)
 {
     SecurityServer::AccessProvider provider("selflabel_06_03");
-    provider.allowFunction("security_server_get_smacklabel_cookie");
+    provider.allowSS();
     provider.applyAndSwithToUser(APP_UID, APP_GID);
 
     Cookie cookie = getCookieFromSS();
@@ -462,12 +460,7 @@ RUNNER_CHILD_TEST_SMACK(tc_unit_09_01_app_user_cookie_API_access_allow)
     add_process_group(PROC_AUDIO_GROUP_NAME);
 
     SecurityServer::AccessProvider provider("subject_1d6eda7d");
-    provider.allowFunction("security_server_get_gid");
-    provider.allowFunction("security_server_request_cookie");
-    provider.allowFunction("security_server_check_privilege");
-    provider.allowFunction("security_server_get_cookie_pid");
-    provider.allowFunction("security_server_get_smacklabel_cookie");
-    provider.allowFunction("security_server_check_privilege_by_pid");
+    provider.allowSS();
     provider.applyAndSwithToUser(APP_UID, APP_GID);
 
     Cookie cookie = getCookieFromSS();