Adapt tests for security_manager_set_identity 12/319412/6
authorFilip Skrzeczkowski <f.skrzeczkow@samsung.com>
Mon, 10 Feb 2025 16:30:16 +0000 (17:30 +0100)
committerKrzysztof Malysa <k.malysa@samsung.com>
Thu, 13 Feb 2025 11:27:23 +0000 (12:27 +0100)
Change-Id: Iff96cc48675e64382c70b30a9d9324c9c7e68c3e

src/common/sm_api.cpp
src/common/sm_api.h
src/nether-tests/nether_tests.cpp
src/ode/ode-tests-internal-encryption.cpp
src/ode/ode-tests-keys.cpp
src/security-manager-tests/common/sm_commons.cpp
src/security-manager-tests/test_cases.cpp
src/security-manager-tests/test_cases_app_policy.cpp
src/security-manager-tests/test_cases_privacy_manager.cpp

index dd1af2c7a7fd0a21691015f6304bfd9b521f29c3..478e0c6adfaf4bcc162fb93f736a185be0eb59fa 100644 (file)
@@ -74,11 +74,11 @@ std::string getPkgId(const std::string &appId, lib_retcode expectedResult)
     return str;
 }
 
-void setProcessLabel(const std::string &appId, lib_retcode expectedResult)
+void setAppProcessIdentity(const std::string &appId, lib_retcode expectedResult)
 {
-    int result = security_manager_set_process_label_from_appid(appId.c_str());
+    int result = security_manager_set_identity(process_type::SM_PROCESS_TYPE_APP, appId.c_str());
     RUNNER_ASSERT_MSG((lib_retcode)result == expectedResult,
-                      "setting process label from app id returned wrong value."
+                      "setting app process identity from app id returned wrong value."
                           << " App id: " << appId << ";"
                           << " Result: " << result << ";"
                           << " Expected result: " << expectedResult);
index a623ab8dfe70bbe206701d37b0c5c553791cd029..611665d8a06febba609827cdd369a2bcc654533b 100644 (file)
@@ -33,7 +33,7 @@ void install(const InstallRequest &request, lib_retcode expectedResult = SECURIT
 void update(const InstallRequest &request, lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
 void uninstall(const InstallRequest &request, lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
 std::string getPkgId(const std::string &appId, lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
-void setProcessLabel(const std::string &appId, lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
+void setAppProcessIdentity(const std::string &appId, lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
 void setProcessGroups(const std::string &appId, lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
 void dropProcessPrivileges(lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
 void prepareApp(const std::string &appId, lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
index 69bf807a794c93aeaf70288f5e6726db04b7ac8f..95c066c716b74887c869f4fab6f0ce0411214d2a 100644 (file)
@@ -309,7 +309,7 @@ void runProcedureInNetAppContext(
 
     // run client procedure in app context
     runInChildParentWait([=]() {
-        Api::setProcessLabel(smackLabel);
+        Api::setAppProcessIdentity(smackLabel);
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(appUID, appGID) == 0,
                                 "drop_root_privileges() failed");
         procedure();
@@ -624,7 +624,7 @@ public:
 
     virtual int serverProcedure(int pipeFd) override
     {
-        Api::setProcessLabel(m_appContext.appId());
+        Api::setAppProcessIdentity(m_appContext.appId());
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(m_appContext.getUID(), m_appContext.getGID()) == 0,
                                 "drop_root_privileges() failed");
 
@@ -698,7 +698,7 @@ public:
 
     virtual int serverProcedure(int pipeFd) override
     {
-        Api::setProcessLabel(m_appContext.appId());
+        Api::setAppProcessIdentity(m_appContext.appId());
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(m_appContext.getUID(), m_appContext.getGID()) == 0,
                                 "drop_root_privileges() failed");
 
@@ -812,7 +812,7 @@ public:
 
     virtual int serverProcedure(int pipeFd) override
     {
-        Api::setProcessLabel(m_appContext.appId());
+        Api::setAppProcessIdentity(m_appContext.appId());
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(m_appContext.getUID(), m_appContext.getGID()) == 0,
                                 "drop_root_privileges() failed");
 
index 881ecaa4d18435b2ca829d1bfc9a76d81313e085..44cc4c23e22d068e5cd5ce7567612abf37291402 100644 (file)
@@ -274,7 +274,7 @@ RUNNER_CHILD_TEST(T1021_internal_encryption_permission_denied)
     if (pid != 0) {
         waitPid(pid);
     } else { //child process
-        SecurityManagerTest::Api::setProcessLabel(appInstallHelper.getAppId());
+        SecurityManagerTest::Api::setAppProcessIdentity(appInstallHelper.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(adminUserToSwitch.getUid(),
             adminUserToSwitch.getGid()) == 0,
             "drop_root_privileges failed");
index 3596a296972a644d16e320bcb8f218730da531eb..c4cec68b5e884cf7a27ce4b24db1572f88ee9c18 100644 (file)
@@ -328,7 +328,7 @@ RUNNER_CHILD_TEST(T2017_ode_keys_permission_denied)
     if (pid != 0) {
         waitPid(pid);
     } else { //child process
-        SecurityManagerTest::Api::setProcessLabel(appInstallHelper.getAppId());
+        SecurityManagerTest::Api::setAppProcessIdentity(appInstallHelper.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(adminUserToSwitch.getUid(),
             adminUserToSwitch.getGid()) == 0,
             "drop_root_privileges failed");
index af5ffae4be78188105f762a6f14d8da88727078b..d8f60b1a94064f8dba9e0f48d5dbb7938b50bf2a 100644 (file)
@@ -204,7 +204,7 @@ void runAccessTest(const std::string &label, uid_t uid, gid_t gid,
 
 void runAccessTest(const AppInstallHelper &app, const std::string &testPath, int accessType) {
     auto fun = [&](){
-        Api::setProcessLabel(app.getAppId());
+        Api::setAppProcessIdentity(app.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(0 == drop_root_privileges(app.getUID(), app.getGID()),
                                 "drop_root_privileges failed.");
         accessTest(app.getAppId(), testPath, accessType);
index 13d5e589bba588099b77acd7aa028cf35d4cc546..8e83f190395c75ed05b0be8e61983552c4a5d6a7 100644 (file)
@@ -228,7 +228,7 @@ RUNNER_CHILD_TEST_SMACK(security_manager_03_set_label_from_appid)
     pid_t pid = fork();
     RUNNER_ASSERT_ERRNO_MSG(pid >= 0, "Fork failed");
     if (pid == 0) { // child
-        Api::setProcessLabel(app.getAppId());
+        Api::setAppProcessIdentity(app.getAppId());
 
         char *label = nullptr;
         CStringPtr labelPtr;
@@ -711,45 +711,82 @@ RUNNER_CHILD_TEST(security_manager_10_app_has_privilege)
     // FIXME - all other existing privileges should be checked
 }
 
-RUNNER_CHILD_TEST(security_manager_11_set_identity)
+RUNNER_CHILD_TEST(security_manager_11a_set_identity_system)
 {
-    pid_t pid1 = fork();
-    RUNNER_ASSERT_ERRNO_MSG(pid1 >= 0, "Fork 1 failed");
-    if (pid1 != 0) { //parent process
-        waitPid(pid1);
+    pid_t pid = fork();
+    RUNNER_ASSERT_ERRNO_MSG(pid >= 0, "Fork failed");
+    if (pid != 0) { //parent process
+        waitPid(pid);
     } else {
         int result = security_manager_set_identity(process_type::SM_PROCESS_TYPE_SYSTEM, nullptr);
         RUNNER_ASSERT_MSG(result == SECURITY_MANAGER_SUCCESS,
                 "security_manager_set_identity(SM_PROCESS_TYPE_SYSTEM, nullptr) failed");
         exit(0);
     }
+}
 
-    pid_t pid2 = fork();
-    RUNNER_ASSERT_ERRNO_MSG(pid2 >= 0, "Fork 2 failed");
-    if (pid2 != 0) { //parent process
-        waitPid(pid2);
+RUNNER_CHILD_TEST(security_manager_11b_set_identity_privileged)
+{
+    pid_t pid = fork();
+    RUNNER_ASSERT_ERRNO_MSG(pid >= 0, "Fork failed");
+    if (pid != 0) { //parent process
+        waitPid(pid);
     } else {
-        int result = security_manager_set_identity(process_type::SM_PROCESS_TYPE_SYSTEM_PRIVILEGED, nullptr);
+        int result = security_manager_set_identity(process_type::SM_PROCESS_TYPE_SYSTEM_PRIVILEGED,
+                                                   nullptr);
         RUNNER_ASSERT_MSG(result == SECURITY_MANAGER_SUCCESS,
                 "security_manager_set_identity(SM_PROCESS_TYPE_SYSTEM_PRIVILEGED, nullptr) failed");
         exit(0);
     }
+}
 
-    const std::string appLocalName = "sm_test_set_identity_local1";
+RUNNER_CHILD_TEST(security_manager_11c_set_identity_app_no_author)
+{
+    const std::string appLocalName = "sm_test_11c_set_identity_app_no_author";
     AppInstallHelper appLocal(appLocalName);
     ScopedInstaller appInstall(appLocal);
 
-    pid_t pid3 = fork();
-    RUNNER_ASSERT_ERRNO_MSG(pid3 >= 0, "Fork 3 failed");
-    if (pid3 != 0) { //parent process
-        waitPid(pid3);
+    pid_t pid = fork();
+    RUNNER_ASSERT_ERRNO_MSG(pid >= 0, "Fork failed");
+    if (pid != 0) { //parent process
+        waitPid(pid);
     } else {
         int result = security_manager_set_identity(process_type::SM_PROCESS_TYPE_APP, nullptr);
-        RUNNER_ASSERT_MSG(result == SECURITY_MANAGER_ERROR_INPUT_PARAM,
-                "security_manager_set_identity(SM_PROCESS_TYPE_APP, nullptr) wrongly succeeded");
-        result = security_manager_set_identity(process_type::SM_PROCESS_TYPE_APP, appLocal.getAppId().c_str());
-        RUNNER_ASSERT_MSG(result == SECURITY_MANAGER_SUCCESS,
-                "security_manager_set_identity(SM_PROCESS_TYPE_APP, appLocal.getAppId().c_str()) failed");
+        RUNNER_ASSERT_MSG(
+            result == SECURITY_MANAGER_ERROR_INPUT_PARAM,
+            "security_manager_set_identity(SM_PROCESS_TYPE_APP, nullptr) wrongly succeeded");
+        result = security_manager_set_identity(process_type::SM_PROCESS_TYPE_APP,
+                                               appLocal.getAppId().c_str());
+        RUNNER_ASSERT_MSG(
+            result == SECURITY_MANAGER_SUCCESS,
+            "security_manager_set_identity(SM_PROCESS_TYPE_APP, appLocal.getAppId().c_str()) failed"
+        );
+        exit(0);
+    }
+}
+
+RUNNER_CHILD_TEST(security_manager_11d_set_identity_app_author)
+{
+    const std::string appLocalName = "sm_test_11d_set_identity_app_author";
+    AppInstallHelper appLocal(appLocalName);
+    appLocal.setAuthor("sm_test_app_author");
+    ScopedInstaller appInstall(appLocal);
+
+    pid_t pid = fork();
+    RUNNER_ASSERT_ERRNO_MSG(pid >= 0, "Fork failed");
+    if (pid != 0) { //parent process
+        waitPid(pid);
+    } else {
+        int result = security_manager_set_identity(process_type::SM_PROCESS_TYPE_APP, nullptr);
+        RUNNER_ASSERT_MSG(
+            result == SECURITY_MANAGER_ERROR_INPUT_PARAM,
+            "security_manager_set_identity(SM_PROCESS_TYPE_APP, nullptr) wrongly succeeded");
+        result = security_manager_set_identity(process_type::SM_PROCESS_TYPE_APP,
+                                               appLocal.getAppId().c_str());
+        RUNNER_ASSERT_MSG(
+            result == SECURITY_MANAGER_SUCCESS,
+            "security_manager_set_identity(SM_PROCESS_TYPE_APP, appLocal.getAppId().c_str()) failed"
+        );
         exit(0);
     }
 }
@@ -812,7 +849,7 @@ RUNNER_CHILD_TEST(security_manager_21_security_manager_admin_deny_user_priv)
         waitPid(pid);
         normalApp.checkPrivileges(allowedPrivsAfterChange, deniedPrivsAfterChange);
     } else {
-        Api::setProcessLabel(adminApp.getAppId());
+        Api::setAppProcessIdentity(adminApp.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(adminUser.getUid(),adminUser.getGid()) == 0,
                                 "drop_root_privileges failed");
 
@@ -1197,7 +1234,7 @@ RUNNER_CHILD_TEST(security_manager_26_2_security_manager_self_is_app)
             waitPid(pid);
         } else {
             // here we can check if the function will return it IS an app
-            Api::setProcessLabel(app.getAppId());
+            Api::setAppProcessIdentity(app.getAppId());
             bool is_app;
             RUNNER_ASSERT_MSG(security_manager_self_is_app(&is_app) == SECURITY_MANAGER_SUCCESS,
                               "failed security_manager_self_is_app");
@@ -1237,7 +1274,7 @@ RUNNER_CHILD_TEST(security_manager_26_3_security_manager_is_app_from_pid)
         } else {
             pipe.claimChildEp();
             // here we can check if the function will return it IS an app
-            Api::setProcessLabel(app.getAppId());
+            Api::setAppProcessIdentity(app.getAppId());
             pipe.post(); // A1
             bool is_app;
             RUNNER_ASSERT_MSG(security_manager_is_app_from_pid(getpid(), &is_app) == SECURITY_MANAGER_SUCCESS,
index 27267f814b52e9fa314e848ec5bd677382df2f09..3e3e2051214cac9c9c84ec45b3a099db0aa0364e 100644 (file)
@@ -61,7 +61,7 @@ RUNNER_CHILD_TEST(security_manager_ap1_app_policy_fetch_for_self) {
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(app.getAppId());
+        Api::setAppProcessIdentity(app.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(
                 drop_root_privileges(tmpUser.getUid(), tmpUser.getGid()) == 0,
                 "drop_root_privileges failed");
@@ -116,7 +116,7 @@ RUNNER_CHILD_TEST(security_manager_ap2_app_policy_fetch_for_self_different_user)
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(app.getAppId());
+        Api::setAppProcessIdentity(app.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(
                 drop_root_privileges(tmpUser.getUid(), tmpUser.getGid()) == 0,
                 "drop_root_privileges failed");
@@ -151,7 +151,7 @@ RUNNER_CHILD_TEST(security_manager_ap3_app_policy_fetch_for_self_different_user_
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(app.getAppId());
+        Api::setAppProcessIdentity(app.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(
                 drop_root_privileges(tmpUser.getUid(), tmpUser.getGid()) == 0,
                 "drop_root_privileges failed");
@@ -189,7 +189,7 @@ RUNNER_CHILD_TEST(security_manager_ap3_app_policy_fetch_for_self_different_app)
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(app1.getAppId());
+        Api::setAppProcessIdentity(app1.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(
                 drop_root_privileges(tmpUser.getUid(), tmpUser.getGid()) == 0,
                 "drop_root_privileges failed");
index ac72b73600045a92eceee87a9c7d6e2adf4d6d82..f1b940beba5e3dcc67150bcbc6e4ceef972d5f00 100644 (file)
@@ -110,7 +110,7 @@ RUNNER_CHILD_TEST(security_manager_10_privacy_manager_fetch_whole_policy_for_sel
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(privManagerAppId);
+        Api::setAppProcessIdentity(privManagerAppId);
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(tmpUser.getUid(), tmpUser.getGid()) == 0,
                                 "drop_root_privileges failed");
 
@@ -187,7 +187,7 @@ RUNNER_CHILD_TEST(security_manager_11_privacy_manager_fetch_whole_policy_for_adm
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(privManagerAppId);
+        Api::setAppProcessIdentity(privManagerAppId);
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(normalUserToSwitch.getUid(),
                                                      normalUserToSwitch.getGid()) == 0,
                                 "drop_root_privileges failed");
@@ -275,7 +275,7 @@ RUNNER_CHILD_TEST(security_manager_12_privacy_manager_fetch_whole_policy_for_adm
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(privManagerAppId);
+        Api::setAppProcessIdentity(privManagerAppId);
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(adminUserToSwitch.getUid(),
                                                      adminUserToSwitch.getGid()) == 0,
                                 "drop_root_privileges failed");
@@ -360,7 +360,7 @@ RUNNER_CHILD_TEST(security_manager_13_privacy_manager_fetch_policy_after_update_
     pid_t pid = fork();
     RUNNER_ASSERT_ERRNO_MSG(pid >=0, "Fork failed");
     if (pid == 0) { //child #1 process
-        Api::setProcessLabel(privManagerAppId);
+        Api::setAppProcessIdentity(privManagerAppId);
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(normalUser.getUid(), normalUser.getGid()) == 0,
                                 "drop_root_privileges failed");
         auto &app1 = uidToAIHs[normalUser.getUid()][0];
@@ -389,7 +389,7 @@ RUNNER_CHILD_TEST(security_manager_13_privacy_manager_fetch_policy_after_update_
         pid = fork();
         RUNNER_ASSERT_ERRNO_MSG(pid >=0, "Fork failed");
         if (pid == 0) { //child #2 process
-            Api::setProcessLabel(privManagerAppId);
+            Api::setAppProcessIdentity(privManagerAppId);
             // Admin user, but in context of app, which doesn't have usermanagement privilege
             RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(adminUser.getUid(), adminUser.getGid()) == 0,
                               "drop_root_privileges failed");
@@ -438,7 +438,7 @@ RUNNER_CHILD_TEST(security_manager_14_privacy_manager_fetch_and_update_policy_fo
     if (pid != 0) {
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(privManager.getAppId());
+        Api::setAppProcessIdentity(privManager.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(adminUserToSwitch.getUid(),
                                                      adminUserToSwitch.getGid()) == 0,
                                 "drop_root_privileges failed");
@@ -501,7 +501,7 @@ RUNNER_CHILD_TEST(security_manager_15_privacy_manager_send_policy_update_for_adm
                          adminUser.getUidString().c_str(), updatePriv.c_str(), CYNARA_ADMIN_ALLOW,
                          nullptr);
     } else {
-        Api::setProcessLabel(privManager.getAppId());
+        Api::setAppProcessIdentity(privManager.getAppId());
 
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(adminUser.getUid(), adminUser.getGid()) == 0,
                                 "drop_root_privileges failed");
@@ -538,7 +538,7 @@ RUNNER_CHILD_TEST(security_manager_15_privacy_manager_send_policy_update_for_adm
                          adminUser.getUidString().c_str(), updatePriv.c_str(), CYNARA_ADMIN_ALLOW,
                          nullptr);
     } else {
-        Api::setProcessLabel(privManager.getAppId());
+        Api::setAppProcessIdentity(privManager.getAppId());
         RUNNER_ASSERT_MSG(drop_root_privileges(adminUser.getUid(), adminUser.getGid()) == 0,
                           "drop_root_privileges failed");
 
@@ -574,7 +574,7 @@ RUNNER_CHILD_TEST(security_manager_15_privacy_manager_send_policy_update_for_sel
         admin.adminCheck("", false, app.generateAppLabel().c_str(), user.getUidString().c_str(),
                          updatePriv.c_str(), CYNARA_ADMIN_ALLOW, nullptr);
     } else {
-        Api::setProcessLabel(privManager.getAppId());
+        Api::setAppProcessIdentity(privManager.getAppId());
         RUNNER_ASSERT_MSG(drop_root_privileges(user.getUid(), user.getGid()) == 0,
                           "drop_root_privileges failed");
 
@@ -708,7 +708,7 @@ RUNNER_CHILD_TEST(security_manager_17b_privacy_manager_delete_policy_for_self)
 
     } else {
         synchPipe.claimChildEp();
-        Api::setProcessLabel(privManager.getAppId());
+        Api::setAppProcessIdentity(privManager.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(user.getUid(), user.getGid()) == 0,
                                 "drop_root_privileges failed");
 
@@ -768,7 +768,7 @@ RUNNER_CHILD_TEST(security_manager_17_privacy_manager_fetch_whole_policy_for_sel
     {
         waitPid(pid);
     } else {
-        Api::setProcessLabel(privManagerAppId);
+        Api::setAppProcessIdentity(privManagerAppId);
         RUNNER_ASSERT_MSG(drop_root_privileges(user.getUid(), user.getGid()) == 0,
                           "drop_root_privileges failed");
 
@@ -1082,7 +1082,7 @@ RUNNER_CHILD_TEST(security_manager_27_fetch_app_manifest_app_context_local_posit
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(app.getAppId());
+        Api::setAppProcessIdentity(app.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(
                 drop_root_privileges(user.getUid(), user.getGid()) == 0,
                 "drop_root_privileges failed");
@@ -1111,7 +1111,7 @@ RUNNER_CHILD_TEST(security_manager_28_fetch_app_manifest_app_context_global_posi
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(app.getAppId());
+        Api::setAppProcessIdentity(app.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(
                 drop_root_privileges(user.getUid(), user.getGid()) == 0,
                 "drop_root_privileges failed");
@@ -1149,7 +1149,7 @@ RUNNER_CHILD_TEST(security_manager_29_fetch_app_manifest_app_context_local_diffe
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(app1.getAppId());
+        Api::setAppProcessIdentity(app1.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(
                 drop_root_privileges(user1.getUid(), user1.getGid()) == 0,
                 "drop_root_privileges failed");
@@ -1188,7 +1188,7 @@ RUNNER_CHILD_TEST(security_manager_30_fetch_app_manifest_app_context_local_diffe
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(app1.getAppId());
+        Api::setAppProcessIdentity(app1.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(
                 drop_root_privileges(user.getUid(), user.getGid()) == 0,
                 "drop_root_privileges failed");
@@ -1230,7 +1230,7 @@ RUNNER_CHILD_TEST(security_manager_31_fetch_app_manifest_app_context_local_diffe
     if (pid != 0) { //parent process
         waitPid(pid);
     } else { //child process
-        Api::setProcessLabel(app1.getAppId());
+        Api::setAppProcessIdentity(app1.getAppId());
         RUNNER_ASSERT_ERRNO_MSG(
                 drop_root_privileges(user.getUid(), user.getGid()) == 0,
                 "drop_root_privileges failed");