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