aboutsummaryrefslogtreecommitdiffstats
path: root/tests/by-name/ru/rust-motd/test.nix
blob: 43a905de5e9683f3ff433ac52abb83c26686a8d1 (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
32
33
34
35
36
37
38
{
  extraModules,
  vhack,
  ...
}:
vhack.runTest {
  name = "rust-motd";

  nodes = {
    server = {config, ...}: {
      imports =
        extraModules
        ++ [
          ../../../../modules
        ];

      vhack = {
        rust-motd.enable = true;
      };
    };
  };

  services = [
    {
      server = "rust-motd.service";
      start = true;
    }
  ];

  testScript = {nodes, ...}:
  # Python
  ''
    with subtest("Motd generated"):
      server.succeed("cat /var/lib/rust-motd/motd | tee /dev/stderr | grep --invert-match --ignore-case Error")

    server.copy_from_vm("/var/lib/rust-motd/motd")
  '';
}