#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>
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);
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();
+ }
}
}