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