DEFINE_SMARTPTR(security_manager_app_inst_req_free, app_inst_req, AppInstReqUniquePtr);
-static const char *const LABELLED_BINARY_PATH = "/usr/bin/test-app-efl";
-
static const char *const SM_APP_ID1 = "sm_test_app_id_double";
static const char *const SM_PKG_ID1 = "sm_test_pkg_id_double";
SM_ALLOWED_PRIVILEGES, TestSecurityManagerDatabase::REMOVED);
}
-RUNNER_CHILD_TEST_SMACK(security_manager_03_set_label_from_binary)
-{
- const char *const testBinaryPath = LABELLED_BINARY_PATH;
- const char *const expectedLabel = USER_APP_ID;
- int result;
- char *label = nullptr;
- CStringPtr labelPtr;
-
- result = security_manager_set_process_label_from_binary(testBinaryPath);
- RUNNER_ASSERT_MSG(result == SECURITY_MANAGER_SUCCESS,
- "security_manager_set_process_label_from_binary(" <<
- testBinaryPath << ") failed. Result: " << result);
-
- result = smack_new_label_from_self(&label);
- RUNNER_ASSERT_MSG(result >= 0,
- " Error getting current process label");
- RUNNER_ASSERT_MSG(label != nullptr,
- " Process label is not set");
- labelPtr.reset(label);
-
- result = strcmp(expectedLabel, label);
- RUNNER_ASSERT_MSG(result == 0,
- " Process label is incorrect. Expected: \"" << expectedLabel << "\" Actual: \""
- << label << "\"");
-}
-
-RUNNER_CHILD_TEST_NOSMACK(security_manager_03_set_label_from_binary_nosmack)
-{
- const char *const testBinaryPath = LABELLED_BINARY_PATH;
- int result;
-
- result = security_manager_set_process_label_from_binary(testBinaryPath);
- RUNNER_ASSERT_MSG(result == SECURITY_MANAGER_SUCCESS,
- "security_manager_set_process_label_from_binary(" <<
- testBinaryPath << ") failed. Result: " << result);
-}
-
-RUNNER_CHILD_TEST_SMACK(security_manager_04_set_label_from_appid)
+RUNNER_CHILD_TEST_SMACK(security_manager_03_set_label_from_appid)
{
const char *const app_id = "sm_test_app_id_set_label_from_appid";
const char *const pkg_id = "sm_test_pkg_id_set_label_from_appid";
uninstall_app(app_id, pkg_id, true, true);
}
-RUNNER_CHILD_TEST_NOSMACK(security_manager_04_set_label_from_appid_nosmack)
+RUNNER_CHILD_TEST_NOSMACK(security_manager_03_set_label_from_appid_nosmack)
{
const char *const app_id = "sm_test_app_id_set_label_from_appid";
const char *const pkg_id = "sm_test_pkg_id_set_label_from_appid";
return pw;
}
-RUNNER_CHILD_TEST(security_manager_05_app_install_uninstall_by_app_user)
+RUNNER_CHILD_TEST(security_manager_04_app_install_uninstall_by_app_user)
{
int result;
AppInstReqUniquePtr request;