From 6e320a1bd338cd6287a697799dd562548c920f4d Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Tue, 25 Jun 2013 15:04:34 +0200 Subject: [PATCH] skip TEST(EXT4StoreTest, _detect_fs) if DISK or MOUNTPOINT are undefined 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 --- src/test/filestore/store_test.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/filestore/store_test.cc b/src/test/filestore/store_test.cc index 08f0b125e3d9d..abc5c5f1170ef 100644 --- a/src/test/filestore/store_test.cc +++ b/src/test/filestore/store_test.cc @@ -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")); -- 2.39.5