2019-11-04 23:35:20 +00:00
|
|
|
import ./make-test-python.nix ({ lib, ... }: with lib;
|
2018-06-18 18:59:19 +01:00
|
|
|
|
|
|
|
rec {
|
|
|
|
name = "tor";
|
|
|
|
meta.maintainers = with maintainers; [ joachifm ];
|
|
|
|
|
|
|
|
common =
|
2018-07-20 21:56:59 +01:00
|
|
|
{ ... }:
|
2018-06-18 18:59:19 +01:00
|
|
|
{ boot.kernelParams = [ "audit=0" "apparmor=0" "quiet" ];
|
|
|
|
networking.firewall.enable = false;
|
|
|
|
networking.useDHCP = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes.client =
|
2018-07-20 21:56:59 +01:00
|
|
|
{ pkgs, ... }:
|
2018-06-18 18:59:19 +01:00
|
|
|
{ imports = [ common ];
|
|
|
|
environment.systemPackages = with pkgs; [ netcat ];
|
|
|
|
services.tor.enable = true;
|
|
|
|
services.tor.client.enable = true;
|
2020-09-11 06:46:59 +01:00
|
|
|
services.tor.settings.ControlPort = 9051;
|
2018-06-18 18:59:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-11-04 23:35:20 +00:00
|
|
|
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"
|
|
|
|
)
|
2018-06-18 18:59:19 +01:00
|
|
|
'';
|
|
|
|
})
|