Generic solution for onlycap issues
[platform/core/test/security-tests.git] / src / security-manager-tests / test_cases.cpp
index 2095709..5bde91d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2016 - 2019 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -35,7 +35,6 @@
 #include <message_pipe.h>
 #include <policy_configuration.h>
 #include <scoped_installer.h>
-#include <scoped_label.h>
 #include <service_manager.h>
 #include <sm_api.h>
 #include <sm_commons.h>
@@ -45,6 +44,7 @@
 #include <tests_common.h>
 #include <tzplatform.h>
 #include <uds.h>
+#include <scoped_process_label.h>
 
 using namespace SecurityManagerTest;
 
@@ -782,7 +782,7 @@ RUNNER_CHILD_TEST(security_manager_25e_unprivileged_install_type_global)
 
     AppInstallHelper app("sm_test_25e");
 
-    change_label("_");
+    ScopedProcessLabel spl("_", false);
     RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(testUser.getUid(), testUser.getGid()) == 0,
                             "drop_root_privileges failed");
 
@@ -803,7 +803,7 @@ RUNNER_CHILD_TEST(security_manager_25f_unprivileged_install_type_preloaded)
 
     AppInstallHelper app("sm_test_25f");
 
-    change_label("_");
+    ScopedProcessLabel spl("_", false);
     RUNNER_ASSERT_ERRNO_MSG(drop_root_privileges(testUser.getUid(), testUser.getGid()) == 0,
                             "drop_root_privileges failed");
     InstallRequest invalidReq;