Merge branch 'tizen' into security-manager
[platform/core/test/security-tests.git] / src / common / tests_common.h
index dab6d75..ac398f0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2013-2015 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.
 #include <errno.h>
 #include <string.h>
 
-// separate DB-space for async tests
-// gives independence: other test sets can modify the password per will
-// without risk of making async tests fail
-const uid_t APP_UID = 5003;
-const gid_t APP_GID = 5003;
+const uid_t APP_UID = 5000;
+const gid_t APP_GID = 5000;
 const uid_t DB_ALARM_UID = 6001;
 const gid_t DB_ALARM_GID = 6001;
 const std::string TMP_DIR("/tmp");
 
-int smack_runtime_check(void);
-int smack_check(void);
+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);
 int files_compare(int fd1, int fd2);
+void mkdirSafe(const std::string &path, mode_t mode);
+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);
 
 #define RUNNER_TEST_SMACK(Proc)                                                     \
     void Proc();                                                                    \