Use TemporaryTestUser::getUidString where applicable 00/231900/12
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 24 Apr 2020 19:51:37 +0000 (21:51 +0200)
committerZofia Abramowska <z.abramowska@samsung.com>
Tue, 5 May 2020 14:31:54 +0000 (14:31 +0000)
Change-Id: I0663b3a29ca74eea2f5019319d857d03a0562885

src/security-manager-tests/test_cases_prepare_app.cpp

index 8d5b941..4ad16d4 100644 (file)
@@ -234,7 +234,7 @@ RUNNER_CHILD_TEST(security_manager_101_create_namespace_test)
         synchPipe.claimChildEp();
         synchPipe.wait();
 
-        std::string appBindPath = std::string("/var/run/user/") + std::to_string(tmpUser.getUid())
+        std::string appBindPath = std::string("/var/run/user/") + tmpUser.getUidString()
                                   + "/apps/" + app.generateAppLabel() + "/" + std::to_string(pid);
         std::string appProcPath = std::string("/proc/") + std::to_string(pid) + "/ns/mnt";
         std::string launcherProcPath = std::string("/proc/") + std::to_string(getpid()) + "/ns/mnt";
@@ -333,11 +333,11 @@ RUNNER_CHILD_TEST(security_manager_103_policy_change_test)
         RUNNER_ASSERT_ERRNO_MSG(result == false, "path is bound");
 
         PolicyRequest policyRequest;
-        PolicyEntry policyEntry(app.getAppId(), std::to_string(tmpUser.getUid()), PRIV_EXTERNALSTORAGE);
+        PolicyEntry policyEntry(app.getAppId(), tmpUser.getUidString(), PRIV_EXTERNALSTORAGE);
         policyEntry.setLevel(PolicyEntry::LEVEL_DENY);
         policyRequest.addEntry(policyEntry);
 
-        policyEntry = PolicyEntry(app.getAppId(), std::to_string(tmpUser.getUid()), PRIV_MEDIASTORAGE);
+        policyEntry = PolicyEntry(app.getAppId(), tmpUser.getUidString(), PRIV_MEDIASTORAGE);
         policyEntry.setLevel(PolicyEntry::LEVEL_DENY);
         policyRequest.addEntry(policyEntry);
         Api::sendPolicy(policyRequest);
@@ -349,11 +349,11 @@ RUNNER_CHILD_TEST(security_manager_103_policy_change_test)
         result = isPathBound(ACCESS_DENIED_DIR_PATH, MEDIA_STORAGE_RO_DIR_PATH, pid);
         RUNNER_ASSERT_ERRNO_MSG(result == true, "path is not bound");
 
-        policyEntry = PolicyEntry(app.getAppId(),  std::to_string(tmpUser.getUid()), PRIV_EXTERNALSTORAGE);
+        policyEntry = PolicyEntry(app.getAppId(), tmpUser.getUidString(), PRIV_EXTERNALSTORAGE);
         policyEntry.setLevel(PolicyEntry::LEVEL_ALLOW);
         policyRequest.addEntry(policyEntry);
 
-        policyEntry = PolicyEntry(app.getAppId(),  std::to_string(tmpUser.getUid()), PRIV_MEDIASTORAGE);
+        policyEntry = PolicyEntry(app.getAppId(), tmpUser.getUidString(), PRIV_MEDIASTORAGE);
         policyEntry.setLevel(PolicyEntry::LEVEL_ALLOW);
         policyRequest.addEntry(policyEntry);
         Api::sendPolicy(policyRequest);