]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
skip TEST(EXT4StoreTest, _detect_fs) if DISK or MOUNTPOINT are undefined 379/head
authorLoic Dachary <loic@dachary.org>
Tue, 25 Jun 2013 13:04:34 +0000 (15:04 +0200)
committerLoic Dachary <loic@dachary.org>
Tue, 25 Jun 2013 13:09:57 +0000 (15:09 +0200)
The TEST(EXT4StoreTest, _detect_fs) test is meant to be run from
qa/workunits/filestore/filestore.sh, after the ext4 file system was
created. If the DISK and MOUNTPOINT environment variables are not
defined, display a message explaining the expected environment and
silentely skip the test. The tests in store_test.cc are not unit tests
because they depend on their environment.

http://tracker.ceph.com/issues/5312 fixes #5312

Signed-off-by: Loic Dachary <loic@dachary.org>
src/test/filestore/store_test.cc

index 08f0b125e3d9d0b9a15333ffd26101d24fca011e..abc5c5f1170ef1ee820e419be00ca206b92f9efe 100644 (file)
@@ -829,6 +829,10 @@ TEST_F(StoreTest, ColSplitTest3) {
 // support tests for qa/workunits/filestore/filestore.sh
 //
 TEST(EXT4StoreTest, _detect_fs) {
+  if (::getenv("DISK") == NULL || ::getenv("MOUNTPOINT") == NULL) {
+    cerr << "SKIP because DISK and MOUNTPOINT environment variables are not set. It is meant to run from qa/workunits/filestore/filestore.sh " << std::endl;
+    return;
+  }
   const string disk(::getenv("DISK"));
   EXPECT_LT((unsigned)0, disk.size());
   const string mnt(::getenv("MOUNTPOINT"));