Merge pull request #166340 from max-privatevoid/patch-6

This commit is contained in:
Artturi 2022-06-28 19:55:10 +03:00 committed by GitHub
commit 3cff3f75b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -283,7 +283,7 @@ in
User = cfg.user;
Group = cfg.group;
StateDirectory = "";
ReadWritePaths = [ "" cfg.dataDir ];
ReadWritePaths = optionals (!cfg.autoMount) [ "" cfg.dataDir ];
} // optionalAttrs (cfg.serviceFdlimit != null) { LimitNOFILE = cfg.serviceFdlimit; };
} // optionalAttrs (!cfg.startWhenNeeded) {
wantedBy = [ "default.target" ];

View file

@ -14,6 +14,14 @@ import ./make-test-python.nix ({ pkgs, ...} : {
};
};
nodes.fuse = { ... }: {
services.ipfs = {
enable = true;
apiAddress = "/ip4/127.0.0.1/tcp/2324";
autoMount = true;
};
};
testScript = ''
start_all()
@ -40,5 +48,12 @@ import ./make-test-python.nix ({ pkgs, ...} : {
# Test if setting dataDir works properly with the hardened systemd unit
machine.succeed("test -e /mnt/ipfs/config")
machine.succeed("test ! -e /var/lib/ipfs/")
# Test FUSE mountpoint
ipfs_hash = fuse.succeed(
"echo fnord3 | ipfs --api /ip4/127.0.0.1/tcp/2324 add --quieter"
)
fuse.succeed(f"cat /ipfs/{ipfs_hash.strip()} | grep fnord3")
'';
})