From 527e0e5ac62a8eb280944a30bdec6c1a977213ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Thu, 2 Nov 2017 00:33:58 +0100 Subject: [PATCH] tests: use preload tests to test pmemfile-fuse --- tests/preload/CMakeLists.txt | 72 +++++++++++++------ tests/preload/basic/basic.cmake | 24 +++---- .../basic_commands/basic_commands.cmake | 41 ++++++----- tests/preload/basic_commands/ls.log.match | 4 +- .../basic_commands/ls_with_dir.log.match | 4 +- .../basic_commands/ls_without_dir.log.match | 4 +- tests/preload/config/config.cmake | 8 +-- tests/preload/dup/dup.cmake | 15 ++-- tests/preload/nested_dirs/nested_dirs.cmake | 10 +-- tests/preload/pool_locking/pool_locking.cmake | 15 ++-- tests/preload/preload-helpers.cmake | 28 +++++++- tests/preload/sqlite/sqlite.cmake | 20 ++---- tests/preload/unix/unix.cmake | 13 +--- tests/preload/xattr/xattr.cmake | 13 +--- utils/docker/images/Dockerfile.fedora-23 | 2 +- utils/docker/images/Dockerfile.fedora-24 | 2 +- utils/docker/images/Dockerfile.fedora-25 | 2 +- utils/docker/images/Dockerfile.ubuntu-16.04 | 1 + utils/docker/images/Dockerfile.ubuntu-16.10 | 1 + utils/docker/images/Dockerfile.ubuntu-17.04 | 1 + utils/docker/run-coverage.sh | 11 ++- 21 files changed, 150 insertions(+), 141 deletions(-) diff --git a/tests/preload/CMakeLists.txt b/tests/preload/CMakeLists.txt index 79abf3873..a6aee1b7d 100644 --- a/tests/preload/CMakeLists.txt +++ b/tests/preload/CMakeLists.txt @@ -54,6 +54,13 @@ int main() { } " XATTR_AVAILABLE_IN_TEST_DIR) +if(BUILD_PMEMFILE_FUSE) + find_program(FUSERMOUNT fusermount) + if (NOT FUSERMOUNT) + message(FATAL_ERROR "fusermount not available") + endif() +endif() + add_executable(preload_basic basic/basic.c) add_executable(preload_dup dup/dup.c) set_target_properties(preload_dup PROPERTIES INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/src) @@ -93,8 +100,8 @@ if(USE_ASAN) endif() # Configures test ${name}${sub_name} using test dir ${name} and executable ${main_executable} -function(add_test_generic name sub_name main_executable) - add_test(NAME preload_${name}${sub_name} +function(add_test_generic prefix name sub_name main_executable) + add_test(NAME ${prefix}${name}${sub_name} COMMAND ${CMAKE_COMMAND} ${GLOBAL_TEST_ARGS} -DTEST_NAME=${name}${sub_name} @@ -105,61 +112,84 @@ function(add_test_generic name sub_name main_executable) ${ARGN} -P ${CMAKE_CURRENT_SOURCE_DIR}/${name}/${name}.cmake) - set_tests_properties(preload_${name}${sub_name} PROPERTIES + set_tests_properties(${prefix}${name}${sub_name} PROPERTIES ENVIRONMENT "LC_ALL=C") endfunction() -function(add_test_generic_ps name sub_name main_executable) - add_test_generic(${name} "${sub_name}" ${main_executable} ${ARGN}) - add_test_generic(${name} "${sub_name}_with_process_switching" ${main_executable} -DTEST_PROCESS_SWITCHING=1 ${ARGN}) +function(add_preload_test name sub_name main_executable) + add_test_generic("preload_" "${name}" "${sub_name}" "${main_executable}" ${ARGN}) +endfunction() + +function(add_preload_test_ps name sub_name main_executable) + add_preload_test(${name} "${sub_name}" ${main_executable} ${ARGN}) + add_preload_test(${name} "${sub_name}_with_process_switching" ${main_executable} -DTEST_PROCESS_SWITCHING=1 ${ARGN}) endfunction() find_program(SQLITE3 sqlite3) if (SQLITE3) - add_test_generic(sqlite "" none) + add_preload_test(sqlite "" none) else() add_test(NAME sqlite_SKIPPED_BECAUSE_OF_MISSING_SQLITE3 COMMAND true) endif() -add_test_generic_ps(basic "" $) -add_test_generic_ps(dup "" $) -add_test_generic_ps(basic_commands "" none) -add_test_generic(nested_dirs "" none) -add_test_generic(pool_locking "" $) +add_preload_test_ps(basic "" $) +add_preload_test_ps(dup "" $) +add_preload_test_ps(basic_commands "" none) +add_preload_test(nested_dirs "" none) +add_preload_test(pool_locking "" $) -add_test_generic(config "_valid_via_symlink" $ -DTEST_PATH=some_dir/some_link/a) +add_preload_test(config "_valid_via_symlink" $ -DTEST_PATH=some_dir/some_link/a) set_tests_properties("preload_config_valid_via_symlink" PROPERTIES PASS_REGULAR_EXPRESSION "no error") -add_test_generic(config "_invalid" $ -DTEST_PATH=mount_point_wrong/a) +add_preload_test(config "_invalid" $ -DTEST_PATH=mount_point_wrong/a) set_tests_properties("preload_config_invalid" PROPERTIES PASS_REGULAR_EXPRESSION "EIO") -add_test_generic(config "_invalid_plus_nested" $ -DTEST_PATH=mount_point_wrong/a/b/c) +add_preload_test(config "_invalid_plus_nested" $ -DTEST_PATH=mount_point_wrong/a/b/c) set_tests_properties("preload_config_invalid_plus_nested" PROPERTIES PASS_REGULAR_EXPRESSION "EIO") -add_test_generic(config "_valid_plus_nested" $ -DTEST_PATH=mount_point/a/b) +add_preload_test(config "_valid_plus_nested" $ -DTEST_PATH=mount_point/a/b) set_tests_properties("preload_config_valid_plus_nested" PROPERTIES PASS_REGULAR_EXPRESSION "ENOENT") -add_test_generic(config "_invalid_via_valid" $ -DTEST_PATH=mount_point/./../mount_point_wrong/a) +add_preload_test(config "_invalid_via_valid" $ -DTEST_PATH=mount_point/./../mount_point_wrong/a) set_tests_properties("preload_config_invalid_via_valid" PROPERTIES PASS_REGULAR_EXPRESSION "EIO") -add_test_generic(config "_outer_via_valid" $ -DTEST_PATH=mount_point/../a) +add_preload_test(config "_outer_via_valid" $ -DTEST_PATH=mount_point/../a) set_tests_properties("preload_config_outer_via_valid" PROPERTIES PASS_REGULAR_EXPRESSION "no error") -add_test_generic(config "_outer_via_invalid" $ -DTEST_PATH=mount_point_wrong/../a) +add_preload_test(config "_outer_via_invalid" $ -DTEST_PATH=mount_point_wrong/../a) set_tests_properties("preload_config_outer_via_invalid" PROPERTIES PASS_REGULAR_EXPRESSION "EIO") -add_test_generic_ps(unix "" $) +add_preload_test_ps(unix "" $) if(XATTR_AVAILABLE_IN_TEST_DIR) add_executable(preload_xattr xattr/xattr.c) add_cstyle(tests-preload-xattr ${CMAKE_CURRENT_SOURCE_DIR}/xattr/xattr.c) add_check_whitespace(tests-preload-xattr ${CMAKE_CURRENT_SOURCE_DIR}/xattr/xattr.c) - add_test_generic_ps(xattr "" $) + add_preload_test_ps(xattr "" $) +endif() + +function(add_fuse_test name main_executable) + add_test_generic(fuse_ ${name} "" ${main_executable} -DUSE_FUSE=1 -DFUSERMOUNT=${FUSERMOUNT} -DPMEMFILE_FUSE=$ ${ARGN}) +endfunction() + +if(BUILD_PMEMFILE_FUSE) + add_fuse_test(basic $) + add_fuse_test(dup $) + add_fuse_test(basic_commands none) + add_fuse_test(nested_dirs none) + add_fuse_test(pool_locking $) + if (SQLITE3) + add_fuse_test(sqlite none) + endif() + add_fuse_test(unix $) + if(XATTR_AVAILABLE_IN_TEST_DIR) + add_fuse_test(xattr $) + endif() endif() diff --git a/tests/preload/basic/basic.cmake b/tests/preload/basic/basic.cmake index e0d741a2f..5bd83998d 100644 --- a/tests/preload/basic/basic.cmake +++ b/tests/preload/basic/basic.cmake @@ -31,30 +31,28 @@ include(${SRC_DIR}/../preload-helpers.cmake) -setup() +setup(128m) -mkfs(${DIR}/fs 128m) - -execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/mount_point) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/some_dir) execute_process(COMMAND ln -s ../mount_point ${DIR}/some_dir/some_link) -set(ENV{LD_PRELOAD} ${PRELOAD_LIB}) -set(ENV{PMEMFILE_POOLS} ${DIR}/mount_point:${DIR}/fs) -set(ENV{PMEMFILE_PRELOAD_LOG} ${BIN_DIR}/pmemfile_preload.log) -set(ENV{INTERCEPT_LOG} ${BIN_DIR}/intercept.log) -set(ENV{PMEMFILE_EXIT_ON_NOT_SUPPORTED} 1) +if (NOT USE_FUSE) + set(ENV{PMEMFILE_EXIT_ON_NOT_SUPPORTED} 1) +endif() execute_process(COMMAND ${MAIN_EXECUTABLE} ${DIR}/some_dir/some_link/a ${DIR} mount_point/b mount_point b OUTPUT_FILE ${DIR}/root_dir.log RESULT_VARIABLE res) if(res) - message(FATAL_ERROR "Test1 command failed: ${res}") + message(FATAL_ERROR "Test1 command failed: ${res}") endif() -unset(ENV{LD_PRELOAD}) - -pf_cat(${DIR}/fs /a ${DIR}/a.dump) +if(USE_FUSE) + execute_with_output(${DIR}/a.dump cat ${DIR}/mount_point/a) +else() + unset(ENV{LD_PRELOAD}) + pf_cat(${DIR}/fs /a ${DIR}/a.dump) +endif() cmp(${DIR}/a.dump ${SRC_DIR}/a.expected_dump) diff --git a/tests/preload/basic_commands/basic_commands.cmake b/tests/preload/basic_commands/basic_commands.cmake index 2083adfb1..cc8380a0f 100644 --- a/tests/preload/basic_commands/basic_commands.cmake +++ b/tests/preload/basic_commands/basic_commands.cmake @@ -31,20 +31,11 @@ include(${SRC_DIR}/../preload-helpers.cmake) -setup() +setup(128m) -mkfs(${DIR}/fs 128m) - -execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/mount_point) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/some_dir) execute_process(COMMAND ln -s ../mount_point ${DIR}/some_dir/some_link) -set(ENV{LD_PRELOAD} ${PRELOAD_LIB}) -set(ENV{PMEMFILE_POOLS} ${DIR}/mount_point:${DIR}/fs) -set(ENV{PMEMFILE_PRELOAD_LOG} ${BIN_DIR}/pmemfile_preload.log) -set(ENV{INTERCEPT_LOG} ${BIN_DIR}/intercept.log) -#set(ENV{PMEMFILE_EXIT_ON_NOT_SUPPORTED} 1) - execute(cp ${SRC_DIR}/repo_dummy_file_a ${DIR}/dummy_file_a) execute(chmod 644 ${DIR}/dummy_file_a) execute(cp ${SRC_DIR}/repo_dummy_file_b ${DIR}/dummy_file_b) @@ -84,18 +75,26 @@ list_files(ls_with_dir.log ${DIR}/mount_point) rmdir(${DIR}/mount_point/dummy_dir_a) list_files(ls_without_dir.log ${DIR}/mount_point) -set(ENV{PMEMFILE_CD} ${DIR}/mount_point) -mkdir(dir_inside) -unset(ENV{PMEMFILE_CD}) +if (USE_FUSE) + mkdir(${DIR}/mount_point/dir_inside) +else() + set(ENV{PMEMFILE_CD} ${DIR}/mount_point) + mkdir(dir_inside) + unset(ENV{PMEMFILE_CD}) +endif() execute(stat ${DIR}/mount_point/dir_inside) mkdir(${DIR}/mount_point/../test) execute(ls -lR ${DIR}) execute(stat ${DIR}/test) -set(ENV{PMEMFILE_CD} ${DIR}/mount_point/dir_inside) -mkdir(../../dir_outside) -unset(ENV{PMEMFILE_CD}) +if (USE_FUSE) + mkdir(${DIR}/mount_point/dir_inside/../../dir_outside) +else() + set(ENV{PMEMFILE_CD} ${DIR}/mount_point/dir_inside) + mkdir(../../dir_outside) + unset(ENV{PMEMFILE_CD}) +endif() execute(ls -lR ${DIR}) execute(stat ${DIR}/dir_outside) @@ -126,9 +125,13 @@ execute_expect_failure(cp ${SRC_DIR}/repo_dummy_file_a ${DIR}/mount_point/file_b execute(ln -s symlink_to_itself ${DIR}/mount_point/symlink_to_itself) execute_expect_failure(cat ${DIR}/mount_point/symlink_to_itself) -set(ENV{PMEMFILE_CD} ${DIR}/mount_point) -execute(stat ../dummy_file_a) -unset(ENV{PMEMFILE_CD}) +if (USE_FUSE) + execute(stat ${DIR}/mount_point/../dummy_file_a) +else() + set(ENV{PMEMFILE_CD} ${DIR}/mount_point) + execute(stat ../dummy_file_a) + unset(ENV{PMEMFILE_CD}) +endif() # test syscalls for paths outside of pmemfile mount point execute(touch ${DIR}/out_file) diff --git a/tests/preload/basic_commands/ls.log.match b/tests/preload/basic_commands/ls.log.match index 8c5df1565..0a33ec069 100644 --- a/tests/preload/basic_commands/ls.log.match +++ b/tests/preload/basic_commands/ls.log.match @@ -1,5 +1,7 @@ total $(N) drwxrwxrwx 2 $(N) . -drwxrwxrwx 2 $(N) .. +$(OPT)drwxrwxrwx 2 $(N) .. +$(OPX)drwxr-xr-x 4 $(N) .. +$(OPT) XXX there shouldn't be any difference between libpmemfile and pmemfile-fuse! -rw-r--r-- 1 391 file_a -rw-r--r-- 1 4401 file_b diff --git a/tests/preload/basic_commands/ls_with_dir.log.match b/tests/preload/basic_commands/ls_with_dir.log.match index 1a1da13a0..1890f9139 100644 --- a/tests/preload/basic_commands/ls_with_dir.log.match +++ b/tests/preload/basic_commands/ls_with_dir.log.match @@ -1,6 +1,8 @@ total $(N) drwxrwxrwx 3 $(N) . -drwxrwxrwx 3 $(N) .. +$(OPT)drwxrwxrwx 3 $(N) .. +$(OPX)drwxr-xr-x 4 $(N) .. +$(OPT) XXX there shouldn't be any difference between libpmemfile and pmemfile-fuse! drwxr-xr-x 2 $(N) dummy_dir_a -rw-r--r-- 1 391 file_a -rw-r--r-- 1 4401 file_b diff --git a/tests/preload/basic_commands/ls_without_dir.log.match b/tests/preload/basic_commands/ls_without_dir.log.match index 8c5df1565..0a33ec069 100644 --- a/tests/preload/basic_commands/ls_without_dir.log.match +++ b/tests/preload/basic_commands/ls_without_dir.log.match @@ -1,5 +1,7 @@ total $(N) drwxrwxrwx 2 $(N) . -drwxrwxrwx 2 $(N) .. +$(OPT)drwxrwxrwx 2 $(N) .. +$(OPX)drwxr-xr-x 4 $(N) .. +$(OPT) XXX there shouldn't be any difference between libpmemfile and pmemfile-fuse! -rw-r--r-- 1 391 file_a -rw-r--r-- 1 4401 file_b diff --git a/tests/preload/config/config.cmake b/tests/preload/config/config.cmake index e91f99628..9a2bc16f8 100644 --- a/tests/preload/config/config.cmake +++ b/tests/preload/config/config.cmake @@ -31,19 +31,13 @@ include(${SRC_DIR}/../preload-helpers.cmake) -setup() +setup(128m) -mkfs(${DIR}/fs 128m) - -execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/mount_point) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/mount_point_wrong) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/some_dir) execute_process(COMMAND ln -s ../mount_point ${DIR}/some_dir/some_link) -set(ENV{LD_PRELOAD} ${PRELOAD_LIB}) set(ENV{PMEMFILE_POOLS} "${DIR}/mount_point:${DIR}/fs;${DIR}/mount_point_wrong:${DIR}/invalid") -set(ENV{PMEMFILE_PRELOAD_LOG} ${BIN_DIR}/pmemfile_preload.log) -set(ENV{INTERCEPT_LOG} ${BIN_DIR}/intercept.log) execute(${MAIN_EXECUTABLE} ${DIR}/${TEST_PATH}) diff --git a/tests/preload/dup/dup.cmake b/tests/preload/dup/dup.cmake index fa47aae32..638e26a9c 100644 --- a/tests/preload/dup/dup.cmake +++ b/tests/preload/dup/dup.cmake @@ -31,18 +31,13 @@ include(${SRC_DIR}/../preload-helpers.cmake) -setup() +setup(128m) -mkfs(${DIR}/fs 16m) - -execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/mount_point) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/some_dir) -set(ENV{LD_PRELOAD} ${PRELOAD_LIB}) -set(ENV{PMEMFILE_POOLS} ${DIR}/mount_point:${DIR}/fs) -set(ENV{PMEMFILE_PRELOAD_LOG} ${BIN_DIR}/pmemfile_preload.log) -set(ENV{INTERCEPT_LOG} ${BIN_DIR}/intercept.log) -set(ENV{PMEMFILE_EXIT_ON_NOT_SUPPORTED} 1) +if (NOT USE_FUSE) + set(ENV{PMEMFILE_EXIT_ON_NOT_SUPPORTED} 1) +endif() execute_process(COMMAND ${MAIN_EXECUTABLE} ${DIR}/some_dir/filename ${DIR}/mount_point/filename OUTPUT_FILE ${DIR}/root_dir.log @@ -51,6 +46,4 @@ if(res) message(FATAL_ERROR "command failed: ${res}") endif() -unset(ENV{LD_PRELOAD}) - cleanup() diff --git a/tests/preload/nested_dirs/nested_dirs.cmake b/tests/preload/nested_dirs/nested_dirs.cmake index b1476093a..5b7cd0ecb 100644 --- a/tests/preload/nested_dirs/nested_dirs.cmake +++ b/tests/preload/nested_dirs/nested_dirs.cmake @@ -31,19 +31,11 @@ include(${SRC_DIR}/../preload-helpers.cmake) -setup() +setup(128m) -mkfs(${DIR}/fs 128m) - -execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/mount_point) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/some_dir) execute_process(COMMAND ln -s ../mount_point ${DIR}/some_dir/some_link) -set(ENV{LD_PRELOAD} ${PRELOAD_LIB}) -set(ENV{PMEMFILE_POOLS} ${DIR}/mount_point:${DIR}/fs) -set(ENV{PMEMFILE_PRELOAD_LOG} ${BIN_DIR}/pmemfile_preload.log) -set(ENV{INTERCEPT_LOG} ${BIN_DIR}/intercept.log) - mkdir_expect_failure(${DIR}/mount_point/nonexistent/dummy_dir_a) mkdir(${DIR}/mount_point/test_dir) mkdir(${DIR}/mount_point/test_dir_other) diff --git a/tests/preload/pool_locking/pool_locking.cmake b/tests/preload/pool_locking/pool_locking.cmake index 4f11c713e..5286b3f93 100644 --- a/tests/preload/pool_locking/pool_locking.cmake +++ b/tests/preload/pool_locking/pool_locking.cmake @@ -31,18 +31,11 @@ include(${SRC_DIR}/../preload-helpers.cmake) -setup() +setup(128m) -mkfs(${DIR}/fs 128m) - -execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/mount_point) - -set(ENV{LD_PRELOAD} ${PRELOAD_LIB}) -set(ENV{PMEMFILE_POOLS} ${DIR}/mount_point:${DIR}/fs) - -if (NOT TEST_PROCESS_SWITCHING) - set(ENV{PMEMFILE_PRELOAD_LOG} ${BIN_DIR}/pmemfile_preload.log) - set(ENV{INTERCEPT_LOG} ${BIN_DIR}/intercept.log) +if (TEST_PROCESS_SWITCHING) + unset(ENV{PMEMFILE_PRELOAD_LOG}) + unset(ENV{INTERCEPT_LOG}) endif() execute(${MAIN_EXECUTABLE} ${DIR}/mount_point/file) diff --git a/tests/preload/preload-helpers.cmake b/tests/preload/preload-helpers.cmake index dce4f12ef..7dc36c80b 100644 --- a/tests/preload/preload-helpers.cmake +++ b/tests/preload/preload-helpers.cmake @@ -31,7 +31,14 @@ include(${SRC_DIR}/../../helpers.cmake) -function(setup) +function(setup size) + if (USE_FUSE) + # Cleanup after previous failure. We have to do it before + # common_setup, because unlinking directory with a mount point + # fails with EBUSY. + execute_process(COMMAND ${FUSERMOUNT} -u ${DIR}/mount_point) + endif() + common_setup() if (TEST_PROCESS_SWITCHING) @@ -41,10 +48,27 @@ function(setup) if(TESTS_USE_FORCED_PMEM) set(ENV{PMEM_IS_PMEM_FORCE} 1) endif() + + mkfs(${DIR}/fs ${size}) + + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/mount_point) + + if (USE_FUSE) + execute(${PMEMFILE_FUSE} -b ${DIR}/fs ${DIR}/mount_point) + else() + set(ENV{LD_PRELOAD} ${PRELOAD_LIB}) + set(ENV{PMEMFILE_POOLS} ${DIR}/mount_point:${DIR}/fs) + set(ENV{PMEMFILE_PRELOAD_LOG} ${BIN_DIR}/pmemfile_preload.log) + set(ENV{INTERCEPT_LOG} ${BIN_DIR}/intercept.log) + endif() endfunction() function(cleanup) - unset(ENV{LD_PRELOAD}) + if (USE_FUSE) + execute(${FUSERMOUNT} -z -u ${DIR}/mount_point) + else() + unset(ENV{LD_PRELOAD}) + endif() if(TESTS_USE_FORCED_PMEM) unset(ENV{PMEM_IS_PMEM_FORCE}) diff --git a/tests/preload/sqlite/sqlite.cmake b/tests/preload/sqlite/sqlite.cmake index 61de31763..a25ccf9c6 100644 --- a/tests/preload/sqlite/sqlite.cmake +++ b/tests/preload/sqlite/sqlite.cmake @@ -31,23 +31,16 @@ include(${SRC_DIR}/../preload-helpers.cmake) -setup() +setup(128m) -mkfs(${DIR}/fs 128m) - -execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/mount_point) - -set(ENV{PMEMFILE_POOLS} ${DIR}/mount_point:${DIR}/fs) -set(ENV{PMEMFILE_PRELOAD_LOG} ${BIN_DIR}/pmemfile_preload.log) -set(ENV{LIBC_HOOK_CMDLINE_FILTER} sqlite3) -set(ENV{INTERCEPT_LOG} ${BIN_DIR}/intercept.log) -set(ENV{PMEMFILE_EXIT_ON_NOT_SUPPORTED} 1) +if (NOT USE_FUSE) + set(ENV{LIBC_HOOK_CMDLINE_FILTER} sqlite3) + set(ENV{PMEMFILE_EXIT_ON_NOT_SUPPORTED} 1) +endif() -set(ENV{LD_PRELOAD} ${PRELOAD_LIB}) execute_process(COMMAND sqlite3 ${DIR}/mount_point/sqlitedb INPUT_FILE ${SRC_DIR}/ins0.sql RESULT_VARIABLE sql_ins_res) -unset(ENV{LD_PRELOAD}) if (sql_ins_res) if (sql_ins_res EQUAL 95) @@ -57,14 +50,11 @@ if (sql_ins_res) endif() endif() -set(ENV{LD_PRELOAD} ${PRELOAD_LIB}) execute_process(COMMAND sqlite3 ${DIR}/mount_point/sqlitedb INPUT_FILE ${SRC_DIR}/sel0.sql OUTPUT_FILE ${BIN_DIR}/out0.log RESULT_VARIABLE sql_sel_res) -unset(ENV{LD_PRELOAD}) - if (sql_sel_res) if (sql_sel_res EQUAL 95) message(WARNING "Select crashed because of unsupported feature") diff --git a/tests/preload/unix/unix.cmake b/tests/preload/unix/unix.cmake index 19cbe7c39..8dea01182 100644 --- a/tests/preload/unix/unix.cmake +++ b/tests/preload/unix/unix.cmake @@ -31,19 +31,8 @@ include(${SRC_DIR}/../preload-helpers.cmake) -setup() - -mkfs(${DIR}/fs 128m) - -execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/mount_point) - -set(ENV{LD_PRELOAD} ${PRELOAD_LIB}) -set(ENV{PMEMFILE_POOLS} ${DIR}/mount_point:${DIR}/fs) -set(ENV{PMEMFILE_PRELOAD_LOG} ${BIN_DIR}/pmemfile_preload.log) -set(ENV{INTERCEPT_LOG} ${BIN_DIR}/intercept.log) +setup(128m) execute(${MAIN_EXECUTABLE} ${DIR}) -unset(ENV{LD_PRELOAD}) - cleanup() diff --git a/tests/preload/xattr/xattr.cmake b/tests/preload/xattr/xattr.cmake index 19cbe7c39..8dea01182 100644 --- a/tests/preload/xattr/xattr.cmake +++ b/tests/preload/xattr/xattr.cmake @@ -31,19 +31,8 @@ include(${SRC_DIR}/../preload-helpers.cmake) -setup() - -mkfs(${DIR}/fs 128m) - -execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${DIR}/mount_point) - -set(ENV{LD_PRELOAD} ${PRELOAD_LIB}) -set(ENV{PMEMFILE_POOLS} ${DIR}/mount_point:${DIR}/fs) -set(ENV{PMEMFILE_PRELOAD_LOG} ${BIN_DIR}/pmemfile_preload.log) -set(ENV{INTERCEPT_LOG} ${BIN_DIR}/intercept.log) +setup(128m) execute(${MAIN_EXECUTABLE} ${DIR}) -unset(ENV{LD_PRELOAD}) - cleanup() diff --git a/utils/docker/images/Dockerfile.fedora-23 b/utils/docker/images/Dockerfile.fedora-23 index a3867f7cd..b35f743ba 100644 --- a/utils/docker/images/Dockerfile.fedora-23 +++ b/utils/docker/images/Dockerfile.fedora-23 @@ -48,6 +48,7 @@ RUN dnf install -y \ clang \ cmake \ doxygen \ + fuse \ fuse-devel \ gcc \ gdb \ @@ -124,7 +125,6 @@ RUN dnf remove -y \ automake \ doxygen \ passwd \ - which \ whois RUN dnf autoremove -y diff --git a/utils/docker/images/Dockerfile.fedora-24 b/utils/docker/images/Dockerfile.fedora-24 index 5d33fa584..8996a443f 100644 --- a/utils/docker/images/Dockerfile.fedora-24 +++ b/utils/docker/images/Dockerfile.fedora-24 @@ -48,6 +48,7 @@ RUN dnf install -y \ clang \ cmake \ doxygen \ + fuse \ fuse-devel \ gcc \ gdb \ @@ -124,7 +125,6 @@ RUN dnf remove -y \ automake \ doxygen \ passwd \ - which \ whois RUN dnf autoremove -y diff --git a/utils/docker/images/Dockerfile.fedora-25 b/utils/docker/images/Dockerfile.fedora-25 index 4cb8b63ce..afdfd4707 100644 --- a/utils/docker/images/Dockerfile.fedora-25 +++ b/utils/docker/images/Dockerfile.fedora-25 @@ -48,6 +48,7 @@ RUN dnf install -y \ clang \ cmake \ doxygen \ + fuse \ fuse-devel \ gcc \ gdb \ @@ -124,7 +125,6 @@ RUN dnf remove -y \ automake \ doxygen \ passwd \ - which \ whois RUN dnf autoremove -y diff --git a/utils/docker/images/Dockerfile.ubuntu-16.04 b/utils/docker/images/Dockerfile.ubuntu-16.04 index 4da364a51..4811944aa 100644 --- a/utils/docker/images/Dockerfile.ubuntu-16.04 +++ b/utils/docker/images/Dockerfile.ubuntu-16.04 @@ -52,6 +52,7 @@ RUN apt-get install -y \ debhelper \ devscripts \ doxygen \ + fuse \ git \ libacl1-dev \ libaio-dev \ diff --git a/utils/docker/images/Dockerfile.ubuntu-16.10 b/utils/docker/images/Dockerfile.ubuntu-16.10 index bd7fe9686..ebba4bd3e 100644 --- a/utils/docker/images/Dockerfile.ubuntu-16.10 +++ b/utils/docker/images/Dockerfile.ubuntu-16.10 @@ -52,6 +52,7 @@ RUN apt-get install -y \ debhelper \ devscripts \ doxygen \ + fuse \ git \ libacl1-dev \ libaio-dev \ diff --git a/utils/docker/images/Dockerfile.ubuntu-17.04 b/utils/docker/images/Dockerfile.ubuntu-17.04 index 0bcd0e415..73c55bd09 100644 --- a/utils/docker/images/Dockerfile.ubuntu-17.04 +++ b/utils/docker/images/Dockerfile.ubuntu-17.04 @@ -52,6 +52,7 @@ RUN apt-get install -y \ debhelper \ devscripts \ doxygen \ + fuse \ git \ libacl1-dev \ libaio-dev \ diff --git a/utils/docker/run-coverage.sh b/utils/docker/run-coverage.sh index 073c4aed8..5c910d607 100755 --- a/utils/docker/run-coverage.sh +++ b/utils/docker/run-coverage.sh @@ -69,18 +69,23 @@ bash <(curl -s https://codecov.io/bash) -c -F tests_antool cleanup -ctest -E "_memcheck|_drd|_helgrind|_pmemcheck|antool|preload|mt" --output-on-failure +ctest -E "_memcheck|_drd|_helgrind|_pmemcheck|antool|preload|mt|fuse" --output-on-failure bash <(curl -s https://codecov.io/bash) -c -F tests_posix_single_threaded cleanup -ctest -E "_memcheck|_drd|_helgrind|_pmemcheck|antool" -R mt --output-on-failure +ctest -E "_memcheck|_drd|_helgrind|_pmemcheck|antool|fuse" -R mt --output-on-failure bash <(curl -s https://codecov.io/bash) -c -F tests_posix_multi_threaded cleanup -ctest -E "_memcheck|_drd|_helgrind|_pmemcheck|antool" -R preload --output-on-failure +ctest -E "_memcheck|_drd|_helgrind|_pmemcheck|antool|fuse" -R preload --output-on-failure bash <(curl -s https://codecov.io/bash) -c -F tests_preload +cleanup + +ctest -R fuse --output-on-failure +bash <(curl -s https://codecov.io/bash) -c -F tests_fuse + cd .. rm -r build