Fix smoke test 49/101449/2 accepted/tizen/3.0/common/20161206.125833 accepted/tizen/3.0/ivi/20161206.000422 accepted/tizen/3.0/mobile/20161206.000303 accepted/tizen/3.0/tv/20161206.000342 accepted/tizen/3.0/wearable/20161206.000401 submit/tizen_3.0/20161205.120256
authorSangyoon Jang <s89.jang@samsung.com>
Thu, 1 Dec 2016 06:44:15 +0000 (15:44 +0900)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Mon, 5 Dec 2016 08:23:23 +0000 (00:23 -0800)
Now gid of data, shared/data dir is system_share.

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

index c696ad875d633bb358d7ea024796e96b5512c940..7b185d308cc43c76502f77051ac10a79fd6ec7a4 100644 (file)
@@ -15,6 +15,7 @@
 #include <common/tzip_interface.h>
 #include <common/utils/file_util.h>
 #include <common/utils/subprocess.h>
+#include <common/utils/user_util.h>
 
 #include <gtest/gtest.h>
 #include <gtest/gtest-death-test.h>
@@ -43,6 +44,7 @@ namespace {
 
 const uid_t kTestUserId = tzplatform_getuid(TZ_SYS_DEFAULT_USER);
 const gid_t kTestGroupId = tzplatform_getgid(TZ_SYS_DEFAULT_USER);
+const char kTestGroupName[] = "system_share";
 const std::string kTestUserIdStr =
     std::to_string(kTestUserId);
 
@@ -229,7 +231,12 @@ void ValidatePackageFS(const std::string& pkgid,
     struct stat stats;
     stat(iter->path().c_str(), &stats);
     ASSERT_EQ(kTestUserId, stats.st_uid) << "Invalid uid: " << iter->path();
-    ASSERT_EQ(kTestGroupId, stats.st_gid) << "Invalid gid: " << iter->path();
+    if (iter->path().filename() == "data") {
+      boost::optional<gid_t> gid = ci::GetGidByGroupName(kTestGroupName);
+      ASSERT_EQ(*gid, stats.st_gid) << "Invalid gid: " << iter->path();
+    } else {
+      ASSERT_EQ(kTestGroupId, stats.st_gid) << "Invalid gid: " << iter->path();
+    }
   }
 }