3 # This is a smoke test of bcachefs-tools.
5 # It builds the source with multiple options (debug, release, valgrind, FUSE)
6 # and runs the test suite.
8 # Returns 0 on success, nonzero on any failure.
12 # valgrind, python3-pytest, python3-pytest-xdist
14 # On debian/ubuntu based systems, install with:
16 # apt install valgrind python3-pytest python3-pytest-xdist
18 # You also currently need fuse 3.7 or later. Fuse 3.7 unfortunately requires
19 # debian sid or bullseye at this time, so you may need to install from source.
23 PYTEST="${PYTEST:-pytest-3}"
25 unset BCACHEFS_FUSE BCACHEFS_TEST_USE_VALGRIND BCACHEFS_DEBUG
27 trap "set +x; cat ${spam}; rm -f ${spam} ; echo; echo FAILED." EXIT
29 echo -- Verify dependencies --
30 pkg-config --atleast-version 3.7.0 fuse3
31 python3 -c "import pytest"
32 python3 -c "import xdist"
33 which valgrind > /dev/null
39 make -j ${JOBS} clean > ${spam} 2>&1
40 make -j ${JOBS} tests bcachefs > ${spam} 2>&1
53 echo Running tests with valgrind.
55 export BCACHEFS_TEST_USE_VALGRIND=yes
62 echo -- Test: default --
66 echo -- Test: debug --
67 export BCACHEFS_DEBUG=1
71 echo -- Test: debug with valgrind --
74 echo -- Test: fuse debug --
75 export BCACHEFS_FUSE=1
79 echo -- Test: fuse debug with valgrind --
83 trap "set +x; echo; echo SUCCESS." EXIT