]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test_filestore_idempotent_sequence: unmount prior to deleting store
authorSamuel Just <sam.just@inktank.com>
Thu, 16 May 2013 20:00:32 +0000 (13:00 -0700)
committerSamuel Just <sam.just@inktank.com>
Thu, 16 May 2013 22:46:11 +0000 (15:46 -0700)
FileStoreDiff umounts the stores in its destructor.

Also, DeterministicOpSequence handles deletes its passed
object store.

Fixes: #5076
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
src/test/filestore/test_idempotent_sequence.cc

index d8f8c33ab51664099541a6b5b3c51d2044f0bd2a..3ef2c79987d8134fc981b1cc0b2c79aecfa7527f 100644 (file)
@@ -82,13 +82,15 @@ int run_diff(std::string& a_path, std::string& a_journal,
   FileStore *a = new FileStore(a_path, a_journal, "a");
   FileStore *b = new FileStore(b_path, b_journal, "b");
 
-  FileStoreDiff fsd(a, b);
   int ret = 0;
-  if (fsd.diff()) {
-    dout(0) << "diff found an difference" << dendl;
-    ret = -1;
-  } else {
-    dout(0) << "no diff" << dendl;
+  {
+    FileStoreDiff fsd(a, b);
+    if (fsd.diff()) {
+      dout(0) << "diff found an difference" << dendl;
+      ret = -1;
+    } else {
+      dout(0) << "no diff" << dendl;
+    }
   }
 
   delete a;
@@ -102,6 +104,7 @@ int run_get_last_op(std::string& filestore_path, std::string& journal_path)
 
   int err = store->mount();
   if (err) {
+    store->umount();
     delete store;
     return err;
   }
@@ -139,6 +142,7 @@ int run_sequence_to(int val, std::string& filestore_path,
   err = ::mkdir(filestore_path.c_str(), 0755);
   if (err) {
     cerr << filestore_path << " already exists" << std::endl;
+    store->umount();
     delete store;
     return err;
   }
@@ -153,8 +157,6 @@ int run_sequence_to(int val, std::string& filestore_path,
   op_sequence.init(num_colls, num_objs);
   op_sequence.generate(seed, num_txs);
   store->umount();
-
-  delete store;
   return 0;
 }