mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-27 08:04:14 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
67 lines
1.8 KiB
Nix
67 lines
1.8 KiB
Nix
import ./make-test-python.nix (
|
|
{ lib, pkgs, ... }:
|
|
let
|
|
inherit (import ./ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey;
|
|
in
|
|
{
|
|
name = "locate";
|
|
meta.maintainers = with pkgs.lib.maintainers; [ chkno ];
|
|
|
|
nodes = rec {
|
|
a = {
|
|
environment.systemPackages = with pkgs; [ sshfs ];
|
|
virtualisation.fileSystems = {
|
|
"/ssh" = {
|
|
device = "alice@b:/";
|
|
fsType = "fuse.sshfs";
|
|
options = [
|
|
"allow_other"
|
|
"IdentityFile=/privkey"
|
|
"noauto"
|
|
"StrictHostKeyChecking=no"
|
|
"UserKnownHostsFile=/dev/null"
|
|
];
|
|
};
|
|
};
|
|
services.locate = {
|
|
enable = true;
|
|
interval = "*:*:0/5";
|
|
};
|
|
};
|
|
b = {
|
|
services.openssh.enable = true;
|
|
users.users.alice = {
|
|
isNormalUser = true;
|
|
openssh.authorizedKeys.keys = [ snakeOilPublicKey ];
|
|
};
|
|
};
|
|
};
|
|
|
|
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.wait_for_file("/var/cache/locatedb")
|
|
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")
|
|
'';
|
|
}
|
|
)
|