Adjust AccessProvider api to current security-server.
[platform/core/test/security-tests.git] / tests / security-server-tests / security_server_tests_client_smack.cpp
index 04b4f7a..2e3b940 100644 (file)
@@ -50,7 +50,7 @@ RUNNER_TEST_GROUP_INIT(SECURITY_SERVER_TESTS_CLIENT_SMACK)
 RUNNER_CHILD_TEST_SMACK(tc04_security_server_get_gid)
 {
     SecurityServer::AccessProvider provider("tc04mylabel");
-    provider.allowFunction("security_server_get_gid");
+    provider.allowSS();
     provider.applyAndSwithToUser(APP_UID, APP_GID);
 
     int ret = security_server_get_gid("abc123xyz_pysiaczek");
@@ -78,18 +78,14 @@ RUNNER_CHILD_TEST_SMACK(tc05_check_privilege_by_cookie)
     const char *access_rights_ext = "rw";
     const char *subject_label = "tc05subjectlabel";
 
-    SmackAccess access;
-    access.add(subject_label, object_label, access_rights);
-    access.add(subject_label, "security-server::api-cookie-check", "w");
-    access.apply();
-
-    RUNNER_ASSERT_BT(0 == smack_set_label_for_self(subject_label));
+    SecurityServer::AccessProvider provider(subject_label);
+    provider.allowSS();
+    provider.addObjectRule(object_label, access_rights);
+    provider.applyAndSwithToUser(APP_UID, APP_GID);
 
     RUNNER_ASSERT_BT(SECURITY_SERVER_API_SUCCESS ==
         security_server_request_cookie(cookie,20));
 
-    RUNNER_ASSERT_MSG_BT(drop_root_privileges() == 0, "uid = " << getuid());
-
     RUNNER_ASSERT_BT(SECURITY_SERVER_API_SUCCESS ==
         security_server_check_privilege_by_cookie(
             cookie,