summaryrefslogtreecommitdiffstats
path: root/nixos/tests/dictd.nix
blob: 83faf870711f5e74e62ab38b980084198df2bc73 (plain)
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
{ lib, pkgs, ... }:
{
  name = "dictd";
  meta.maintainers = with lib.maintainers; [
    h7x4
  ];

  nodes.machine =
    { pkgs, ... }:
    {
      services.dictd = {
        enable = true;
        DBs = with pkgs.dictdDBs; [
          jpn2eng
          eng2jpn
        ];
      };
    };

  testScript = ''
    machine.wait_for_unit("dictd.service")
    machine.wait_for_open_port(2628)

    machine.succeed("dict --serverinfo | grep 'On machine: up'")
    machine.succeed("dict --dbs | grep '${pkgs.dictdDBs.jpn2eng.name}'")
    machine.succeed("dict -d '${pkgs.dictdDBs.jpn2eng.name}' 例え | grep example")
    machine.succeed("dict -d '${pkgs.dictdDBs.eng2jpn.name}' example | grep 例え")
  '';
}