1 import ./make-test-python.nix ({ pkgs, ...} : {
3 meta = with pkgs.lib.maintainers; {
4 maintainers = [ mguentner ];
7 nodes.machine = { ... }: {
10 # Also will add a unix domain socket socket API address, see module.
11 startWhenNeeded = true;
12 settings.Addresses.API = "/ip4/127.0.0.1/tcp/2324";
13 dataDir = "/mnt/ipfs";
17 nodes.fuse = { ... }: {
20 settings.Addresses.API = "/ip4/127.0.0.1/tcp/2324";
30 machine.succeed("ipfs --api /ip4/127.0.0.1/tcp/2324 id")
31 ipfs_hash = machine.succeed(
32 "echo fnord | ipfs --api /ip4/127.0.0.1/tcp/2324 add | awk '{ print $2 }'"
35 machine.succeed(f"ipfs cat /ipfs/{ipfs_hash.strip()} | grep fnord")
37 # Unix domain socket activation
39 machine.stop_job("ipfs")
41 ipfs_hash = machine.succeed(
42 "echo fnord2 | ipfs --api /unix/run/ipfs.sock add | awk '{ print $2 }'"
45 f"ipfs --api /unix/run/ipfs.sock cat /ipfs/{ipfs_hash.strip()} | grep fnord2"
48 # Test if setting dataDir works properly with the hardened systemd unit
49 machine.succeed("test -e /mnt/ipfs/config")
50 machine.succeed("test ! -e /var/lib/ipfs/")
52 # Test FUSE mountpoint
53 ipfs_hash = fuse.succeed(
54 "echo fnord3 | ipfs --api /ip4/127.0.0.1/tcp/2324 add --quieter"
57 # The FUSE mount functionality is broken as of v0.13.0.
58 # See https://github.com/ipfs/kubo/issues/9044.
59 # fuse.succeed(f"cat /ipfs/{ipfs_hash.strip()} | grep fnord3")