nixpkgs/nixos/tests/tor.nix
Jörg Thalheim c2fca99f97
Revert "Merge branch 'master' into staging-next"
This reverts commit f19b7b03a0, reversing
changes made to 572a864d02.

Sorry. I pushed the wrong staging-next (the one that had my master
merged in). This was not intended.
2020-12-31 08:50:36 +01:00

31 lines
767 B
Nix

import ./make-test-python.nix ({ lib, ... }: with lib;
rec {
name = "tor";
meta.maintainers = with maintainers; [ joachifm ];
common =
{ ... }:
{ boot.kernelParams = [ "audit=0" "apparmor=0" "quiet" ];
networking.firewall.enable = false;
networking.useDHCP = false;
};
nodes.client =
{ pkgs, ... }:
{ imports = [ common ];
environment.systemPackages = with pkgs; [ netcat ];
services.tor.enable = true;
services.tor.client.enable = true;
services.tor.controlPort = 9051;
};
testScript = ''
client.wait_for_unit("tor.service")
client.wait_for_open_port(9051)
assert "514 Authentication required." in client.succeed(
"echo GETINFO version | nc 127.0.0.1 9051"
)
'';
})