X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcommon%2Ftests_common.h;h=2eb4a009e4ad8090d3ec831c7d867be9293e705d;hb=73f509909a3e4942cc60efbe5963e3bcac9cd7d4;hp=b2d12fb85f74bcbaa8d57ede11eb685170fd5e51;hpb=aa310f173ea26eda1741109e67eea3ad7378c0de;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git diff --git a/src/common/tests_common.h b/src/common/tests_common.h index b2d12fb..2eb4a00 100644 --- a/src/common/tests_common.h +++ b/src/common/tests_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2013 - 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. @@ -29,14 +29,16 @@ #include #include #include -#include + +#include +#include #include #include #include #include -const uid_t APP_UID = 5000; -const gid_t APP_GID = 5000; +const uid_t APP_UID = 5001; +const gid_t APP_GID = 5001; const uid_t APP_UID_2 = 5200; const gid_t APP_GID_2 = 5200; const uid_t DB_ALARM_UID = 6001; @@ -45,7 +47,6 @@ const std::string TMP_DIR("/tmp"); bool smack_check(void); int drop_root_privileges(uid_t appUid = APP_UID, gid_t appGid = APP_GID); -void setLabelForSelf(const int line, const char *label); void add_process_group(const char* group_name); void remove_process_group(const char* group_name); std::string formatCstr(const char *cstr); @@ -55,7 +56,10 @@ void mktreeSafe(const std::string &path, mode_t mode); void creatSafe(const std::string &path, mode_t mode); void symlinkSafe(const std::string &targetPath, const std::string &linkPath); void removeDir(const std::string &path); +void waitPid(pid_t pid); +pid_t runInChild(const std::function &process); +void runInChildParentWait(const std::function &process); #define RUNNER_TEST_SMACK(Proc, ...) \ void Proc(std::tuple<__VA_ARGS__> &optionalArgsTuple); \ @@ -145,4 +149,4 @@ void removeDir(const std::string &path); } \ void Proc##Multi(std::tuple<__VA_ARGS__> &optionalArgsTuple DPL_UNUSED) -#endif \ No newline at end of file +#endif