+-- Getting started --
Dependencies:
uuid-dev zlib1g-dev valgrind
Then, just make && make install
+
+
+-- Experimental features --
+
+Experimental fuse support is currently disabled by default. Fuse support is at
+an early stage and may corrupt your filesystem, so it should only be used for
+testing. To enable, you'll also need to add:
+
+* libfuse3
+
+On debian:
+ apt install -y libfuse3-dev
+
+Then, make using the BCACHEFS_FUSE environment variable:
+
+BCACHEFS_FUSE=1 make &&
+
+
+-- Tests --
+
+Some tests are available to validate the "bcachefs" binary. The tests depend
+on python3 pytest.
+
+On debian:
+ apt install -u python3-pytest
+
+Then, you can run the tests via:
+
+ make check
CFLAGS+=-DCONFIG_BCACHEFS_DEBUG=y
endif
-PKGCONFIG_LIBS="blkid uuid liburcu libsodium zlib liblz4 libzstd fuse3"
+PKGCONFIG_LIBS="blkid uuid liburcu libsodium zlib liblz4 libzstd"
+ifdef BCACHEFS_FUSE
+ PKGCONFIG_LIBS+="fuse3"
+ CFLAGS+=-DBCACHEFS_FUSE
+endif
PKGCONFIG_CFLAGS:=$(shell $(PKG_CONFIG) --cflags $(PKGCONFIG_LIBS))
ifeq (,$(PKGCONFIG_CFLAGS))
if (!strcmp(cmd, "setattr"))
return cmd_setattr(argc, argv);
+#ifdef BCACHEFS_FUSE
if (!strcmp(cmd, "fusemount"))
return cmd_fusemount(argc, argv);
+#endif
if (!strcmp(cmd, "--help")) {
usage();
+#ifdef BCACHEFS_FUSE
+
#include <errno.h>
#include <float.h>
#include <getopt.h>
return ret ? 1 : 0;
}
+
+#endif /* BCACHEFS_FUSE */
#
# Tests of the fuse mount functionality.
+import pytest
import os
import util
+pytestmark = pytest.mark.skipif(
+ not util.have_fuse(), reason="bcachefs not built with fuse support.")
+
def test_mount(bfuse):
bfuse.mount()
bfuse.unmount()
import pytest
import re
import subprocess
+import sys
import tempfile
import threading
import time
assert self.returncode == 0
assert len(self.stdout) > 0
assert len(self.stderr) == 0
+
+def have_fuse():
+ res = run(BCH_PATH, 'fusemount', valgrind=False)
+ return "Please supply a mountpoint." in res.stdout