nixos/locate: Exclude fuse.sshfs
The "fuse" and "sshfs" entries already present are not keeping this find invocation out of sshfs mounts, which present as fstype "fuse.sshfs"
This commit is contained in:
parent
e0e08a186d
commit
86f0dc221f
@ -98,6 +98,7 @@ in {
|
|||||||
"ftpfs"
|
"ftpfs"
|
||||||
"fuse"
|
"fuse"
|
||||||
"fusectl"
|
"fusectl"
|
||||||
|
"fuse.sshfs"
|
||||||
"gfs"
|
"gfs"
|
||||||
"gfs2"
|
"gfs2"
|
||||||
"hostfs"
|
"hostfs"
|
||||||
|
@ -6,16 +6,57 @@ import ./make-test-python.nix ({ lib, pkgs, ... }:
|
|||||||
|
|
||||||
nodes = rec {
|
nodes = rec {
|
||||||
a = {
|
a = {
|
||||||
|
environment.systemPackages = with pkgs; [ sshfs ];
|
||||||
|
fileSystems = lib.mkVMOverride {
|
||||||
|
"/ssh" = {
|
||||||
|
device = "alice@b:/";
|
||||||
|
fsType = "fuse.sshfs";
|
||||||
|
options = [
|
||||||
|
"allow_other"
|
||||||
|
"IdentityFile=/privkey"
|
||||||
|
"noauto"
|
||||||
|
"StrictHostKeyChecking=no"
|
||||||
|
"UserKnownHostsFile=/dev/null"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
services.locate = {
|
services.locate = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interval = "*:*:0/5";
|
interval = "*:*:0/5";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
b = {
|
||||||
|
services.openssh.enable = true;
|
||||||
|
users.users.alice = {
|
||||||
|
isNormalUser = true;
|
||||||
|
openssh.authorizedKeys.keys = [ snakeOilPublicKey ];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
|
start_all()
|
||||||
|
|
||||||
|
# Set up sshfs mount
|
||||||
|
a.succeed(
|
||||||
|
"(umask 077; cat ${snakeOilPrivateKey} > /privkey)"
|
||||||
|
)
|
||||||
|
b.succeed("touch /file-on-b-machine")
|
||||||
|
b.wait_for_open_port(22)
|
||||||
|
a.succeed("mkdir /ssh")
|
||||||
|
a.succeed("mount /ssh")
|
||||||
|
|
||||||
|
# Core locatedb functionality
|
||||||
a.succeed("touch /file-on-a-machine-1")
|
a.succeed("touch /file-on-a-machine-1")
|
||||||
a.wait_for_file("/var/cache/locatedb")
|
a.wait_for_file("/var/cache/locatedb")
|
||||||
a.wait_until_succeeds("locate file-on-a-machine-1")
|
a.wait_until_succeeds("locate file-on-a-machine-1")
|
||||||
|
|
||||||
|
# Wait for a second update to make sure we're using a locatedb from a run
|
||||||
|
# that began after the sshfs mount
|
||||||
|
a.succeed("touch /file-on-a-machine-2")
|
||||||
|
a.wait_until_succeeds("locate file-on-a-machine-2")
|
||||||
|
|
||||||
|
# We shouldn't be able to see files on the other machine
|
||||||
|
a.fail("locate file-on-b-machine")
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user