const bf::path kSmokePackagesDirectory =
"/usr/share/wgt-backend-ut/test_samples/smoke/";
+enum RWDirectory {
+ DATA,
+ CACHE,
+ SHARED_CACHE,
+ SHARED_DATA,
+ SHARED_TRUSTED
+};
+
+const char* rwDirectories[] = {
+ "data",
+ "cache",
+ "shared/cache",
+ "shared/data",
+ "shared/trusted",
+};
+
// common entries
const std::vector<std::string> kDBEntries = {
{".pkgmgr_parser.db"},
void ValidatePackageRWFS(const std::string& pkgid, uid_t uid) {
bf::path root_path = ci::GetRootAppPath(false, uid);
bf::path package_path = root_path / pkgid;
- bf::path data_path = package_path / "data";
- bf::path cache_path = package_path / "cache";
- bf::path shared_data_path = package_path / "shared" / "data";
+ bf::path data_path = package_path / rwDirectories[DATA];
+ bf::path cache_path = package_path / rwDirectories[CACHE];
+ bf::path shared_data_path = package_path / rwDirectories[SHARED_DATA];
ASSERT_TRUE(bf::exists(data_path));
ASSERT_TRUE(bf::exists(cache_path));
iter != bf::recursive_directory_iterator(); ++iter) {
if (bf::is_symlink(symlink_status(iter->path())))
continue;
- if (iter->path().filename() == "data" ||
- iter->path().filename() == ".mmc")
+ bool is_rw_dir = false;
+ for(const auto rw_dir : rwDirectories) {
+ bf::path rw_dir_path = rw_dir;
+ is_rw_dir |= ci::MakeRelativePath(iter->path(), package_path) == rw_dir_path;
+ }
+ if (is_rw_dir || iter->path().filename() == ".mmc")
continue;
struct stat stats;
stat(iter->path().c_str(), &stats);