1 import ./make-test-python.nix ({ lib, pkgs, ... }:
2 let inherit (import ./ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey;
5 meta.maintainers = with pkgs.lib.maintainers; [ chkno ];
9 environment.systemPackages = with pkgs; [ sshfs ];
10 virtualisation.fileSystems = {
13 fsType = "fuse.sshfs";
16 "IdentityFile=/privkey"
18 "StrictHostKeyChecking=no"
19 "UserKnownHostsFile=/dev/null"
29 services.openssh.enable = true;
32 openssh.authorizedKeys.keys = [ snakeOilPublicKey ];
42 "(umask 077; cat ${snakeOilPrivateKey} > /privkey)"
44 b.succeed("touch /file-on-b-machine")
45 b.wait_for_open_port(22)
46 a.succeed("mkdir /ssh")
47 a.succeed("mount /ssh")
49 # Core locatedb functionality
50 a.succeed("touch /file-on-a-machine-1")
51 a.wait_for_file("/var/cache/locatedb")
52 a.wait_until_succeeds("locate file-on-a-machine-1")
54 # Wait for a second update to make sure we're using a locatedb from a run
55 # that began after the sshfs mount
56 a.succeed("touch /file-on-a-machine-2")
57 a.wait_until_succeeds("locate file-on-a-machine-2")
59 # We shouldn't be able to see files on the other machine
60 a.fail("locate file-on-b-machine")