Fix smoke test 81/108481/1 accepted/tizen/3.0/common/20170109.083954 accepted/tizen/3.0/ivi/20170106.095024 accepted/tizen/3.0/mobile/20170106.094850 accepted/tizen/3.0/tv/20170106.094924 accepted/tizen/3.0/wearable/20170106.094952 accepted/tizen/common/20170110.085249 accepted/tizen/ivi/20170106.103702 accepted/tizen/mobile/20170106.103508 accepted/tizen/tv/20170106.103547 accepted/tizen/wearable/20170106.103625 submit/tizen/20170105.051706 submit/tizen_3.0/20170105.051635
authorSangyoon Jang <s89.jang@samsung.com>
Wed, 4 Jan 2017 12:01:11 +0000 (21:01 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Wed, 4 Jan 2017 12:01:11 +0000 (21:01 +0900)
Check gid of cache dir is system_share.

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

index 2d14a1f..0ca4f80 100644 (file)
@@ -212,7 +212,7 @@ void ValidateDataFiles(const std::string& pkgid, uid_t uid) {
   }
 }
 
-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";
@@ -224,7 +224,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;
@@ -238,7 +238,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,
@@ -313,9 +313,9 @@ void ValidatePackage(const std::string& pkgid,
   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);
   }
 }