about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/soju.nix
blob: 23da36f7b3aba0ca60713d41000ce68fc782bfaa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import ./make-test-python.nix ({ pkgs, lib, ... }:
let
  certs = import ./common/acme/server/snakeoil-certs.nix;
  domain = certs.domain;

  user = "testuser";
  pass = "hunter2";
in
{
  name = "soju";
  meta.maintainers = with lib.maintainers; [ Benjamin-L ];

  nodes.machine = { ... }: {
    services.soju = {
      enable = true;
      adminSocket.enable = true;
      hostName = domain;
      tlsCertificate = certs.${domain}.cert;
      tlsCertificateKey = certs.${domain}.key;
    };
  };

  testScript = ''
    start_all()

    machine.wait_for_unit("soju")
    machine.wait_for_file("/run/soju/admin")

    machine.succeed("sojuctl user create -username ${user} -password ${pass}")
  '';
})