depot/third_party/nixpkgs/nixos/tests/tor.nix
Default email 8a45d4525b Project import generated by Copybara.
GitOrigin-RevId: 710fed5a2483f945b14f4a58af2cd3676b42d8c8
2022-03-30 11:31:56 +02:00

25 lines
695 B
Nix

import ./make-test-python.nix ({ lib, ... }: with lib;
{
name = "tor";
meta.maintainers = with maintainers; [ joachifm ];
nodes.client = { pkgs, ... }: {
boot.kernelParams = [ "audit=0" "apparmor=0" "quiet" ];
networking.firewall.enable = false;
networking.useDHCP = false;
environment.systemPackages = with pkgs; [ netcat ];
services.tor.enable = true;
services.tor.client.enable = true;
services.tor.settings.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"
)
'';
})