Fix smoke test 80/108480/1 accepted/tizen/3.0/common/20170109.083923 accepted/tizen/3.0/ivi/20170106.094959 accepted/tizen/3.0/mobile/20170106.094801 accepted/tizen/3.0/tv/20170106.094902 accepted/tizen/3.0/wearable/20170106.094930 accepted/tizen/common/20170110.085236 accepted/tizen/ivi/20170106.103655 accepted/tizen/mobile/20170106.103457 accepted/tizen/tv/20170106.103542 accepted/tizen/wearable/20170106.103619 submit/tizen/20170105.051706 submit/tizen_3.0/20170105.051635
authorSangyoon Jang <s89.jang@samsung.com>
Wed, 4 Jan 2017 11:56:58 +0000 (20:56 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Wed, 4 Jan 2017 11:57:57 +0000 (20:57 +0900)
Check gid of cache dir is system_share.

Change-Id: Ia09306b6bd71ea83a2f8744f7ab44bbe00424d4a
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/unit_tests/smoke_test.cc

index 4077fa469c8948076b6c267f68583d65bdcf58cd..ca7e56c2014dee0425ac4047fee1690dab4b430f 100644 (file)
@@ -164,7 +164,7 @@ bool ValidateFileContentInPackage(const std::string& pkgid,
   return content == expected;
 }
 
-void ValidatePackageRWFS(const std::string& pkgid, uid_t uid, gid_t gid) {
+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";
@@ -176,7 +176,7 @@ void ValidatePackageRWFS(const std::string& pkgid, uid_t uid, gid_t gid) {
 
   struct stat stats;
   stat(data_path.c_str(), &stats);
-  // gid of data, and shared/data should be system_share
+  // gid of RW dirs should be system_share
   boost::optional<gid_t> system_share =
       ci::GetGidByGroupName(kSystemShareGroupName);
   ASSERT_EQ(uid, stats.st_uid) << "Invalid gid: " << data_path;
@@ -190,7 +190,7 @@ void ValidatePackageRWFS(const std::string& pkgid, uid_t uid, gid_t gid) {
 
   stat(cache_path.c_str(), &stats);
   ASSERT_EQ(uid, stats.st_uid) << "Invalid gid: " << cache_path;
-  ASSERT_EQ(gid, stats.st_gid) << "Invalid gid: " << cache_path;
+  ASSERT_EQ(*system_share, stats.st_gid) << "Invalid gid: " << cache_path;
 }
 
 void ValidatePackageFS(const std::string& pkgid, const std::string& appid,
@@ -251,9 +251,9 @@ void ValidatePackage(const std::string& pkgid, const std::string& appid) {
   if (kTestUserId == kGlobalUserUid) {
     ci::UserList list = ci::GetUserList();
     for (auto& l : list)
-      ValidatePackageRWFS(pkgid, std::get<0>(l), std::get<1>(l));
+      ValidatePackageRWFS(pkgid, std::get<0>(l));
   } else {
-    ValidatePackageRWFS(pkgid, kTestUserId, kTestGroupId);
+    ValidatePackageRWFS(pkgid, kTestUserId);
   }
 }