Skip EXT4StoreTest._detect_fs test if DISK or MOUNTPOINT environment variables not set
I disabled the ColSplitTest1/ColSplitTest2 tests (see bug #5310).
Currently, this test case just crashes with unclear error message:
[ RUN ] EXT4StoreTest._detect_fs
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
Found in gdb:
#6 0x00007f9afdd1a787 in std::__throw_logic_error(char const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x00007f9afdd58509 in char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#8 0x00007f9afdd585e3 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9 0x000000000091ffe5 in EXT4StoreTest__detect_fs_Test::TestBody (this=0x1796990) at test/filestore/store_test.cc:835
835 const string disk(::getenv("DISK"));
Something is causing the string constructor to throw an error on attempt to create an empty string. Even if this were corrected this test would failed on the next line anyway because of the string size.
836 EXPECT_LT((unsigned)0, disk.size());
skip TEST if DISK or MOUNTPOINT are undefined
The TEST 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.
Signed-off-by: Loic Dachary <email@example.com>
#3 Updated by Loic Dachary over 6 years ago
TEST (EXT4StoreTest, _detect_fs) was introduced by https://github.com/ceph/ceph/commit/574051f8da0a30073a7d5da880878ee3c941721b and meant to be run from filestore.sh