]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/unittest_bluefs: check whether rmdir success 15363/head
authorshiqi <1454927420@qq.com>
Tue, 30 May 2017 14:36:35 +0000 (22:36 +0800)
committershiqi <1454927420@qq.com>
Fri, 9 Jun 2017 07:50:57 +0000 (15:50 +0800)
Signed-off-by: shiqi <1454927420@qq.com>
src/test/objectstore/test_bluefs.cc

index 4d437f6a8648f343e0348aca840d29dbc355575a..33fb7885c31b05e97d4e5f8dbee94523fbe27905 100644 (file)
@@ -377,18 +377,17 @@ TEST(BlueFS, test_simple_compaction_sync) {
        }
     }
   }
-  // Don't remove all
   {
     for (int i=0; i<10; i+=2) {
        string dir = "dir.";
        dir.append(to_string(i));
-       for (int j=0; j<10; j+=2) {
+       for (int j=0; j<10; j++) {
           string file = "file.";
          file.append(to_string(j));
           fs.unlink(dir, file);
          fs.flush_log();
        }
-       fs.rmdir(dir);
+       ASSERT_EQ(0, fs.rmdir(dir));
        fs.flush_log();
     }
   }
@@ -430,18 +429,17 @@ TEST(BlueFS, test_simple_compaction_async) {
        }
     }
   }
-  // Don't remove all
   {
     for (int i=0; i<10; i+=2) {
        string dir = "dir.";
        dir.append(to_string(i));
-       for (int j=0; j<10; j+=2) {
+       for (int j=0; j<10; j++) {
           string file = "file.";
          file.append(to_string(j));
           fs.unlink(dir, file);
          fs.flush_log();
        }
-       fs.rmdir(dir);
+       ASSERT_EQ(0, fs.rmdir(dir));
        fs.flush_log();
     }
   }