bcachefs-tools/tests/conftest.py
Justin Husted c3f09963af Implement basic fuse mount tests.
The purpose of these tests is to verify that bcachefs fuse support works
as expected, including gathering valgrind errors from the bcachefs
executable.

To do this, bcachefs is executed from a helper thread in the new
util.BFuse class, which goes about setting up and validating the
valgrind data as well as making sure the mount has completed
sufficiently before the test starts executing.

This also includes some basic functionality smoke tests which cover file
creation, timestamps, etc.

Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-09 19:00:56 -08:00

20 lines
358 B
Python

#!/usr/bin/python3
#
# pytest fixture definitions.
import pytest
import util
@pytest.fixture
def bfuse(tmpdir):
'''A test requesting a "bfuse" is given one via this fixture.'''
dev = util.format_1g(tmpdir)
mnt = util.mountpoint(tmpdir)
bf = util.BFuse(dev, mnt)
yield bf
if bf.returncode is None:
bf.unmount(timeout=5.0)