]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
TestLFNIndex.cc: For root, dont do permission operations. 3298/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Tue, 6 Jan 2015 08:23:40 +0000 (16:23 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Tue, 6 Jan 2015 08:23:40 +0000 (16:23 +0800)
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/test/os/TestLFNIndex.cc

index 3bc5ba01666f67b203dc4a6214f29557967d2f2e..fcbb7fe333d4256b912fd50e635c1409455f4510 100644 (file)
@@ -207,7 +207,8 @@ TEST_F(TestLFNIndex, remove_object) {
     ghobject_t hoid(hobject_t(sobject_t("ABC", CEPH_NOSNAP)));
 
     EXPECT_EQ(0, ::chmod("PATH", 0000));
-    EXPECT_EQ(-EACCES, remove_object(path, hoid));
+    if (getuid() != 0)
+      EXPECT_EQ(-EACCES, remove_object(path, hoid));
     EXPECT_EQ(0, ::chmod("PATH", 0700));
     EXPECT_EQ(-ENOENT, remove_object(path, hoid));
     EXPECT_EQ(0, get_mangled_name(path, hoid, &mangled_name, &exists));
@@ -398,7 +399,8 @@ TEST_F(TestLFNIndex, get_mangled_name) {
     exists = 666;
     EXPECT_EQ(0, ::close(::creat(pathname.c_str(), 0600)));
     EXPECT_EQ(0, ::chmod("PATH", 0500));
-    EXPECT_EQ(-EACCES, get_mangled_name(path, hoid, &mangled_name, &exists));
+    if (getuid() != 0)
+      EXPECT_EQ(-EACCES, get_mangled_name(path, hoid, &mangled_name, &exists));
     EXPECT_EQ("", mangled_name);
     EXPECT_EQ(666, exists);
     EXPECT_EQ(0, ::chmod("PATH", 0700));