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>
// 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"));