nixos/tests/dictd: init (#452862)

This commit is contained in:
Sandro
2025-10-29 12:01:52 +00:00
committed by GitHub
3 changed files with 33 additions and 0 deletions

View File

@@ -452,6 +452,7 @@ in
devpi-server = runTest ./devpi-server.nix;
dex-oidc = runTest ./dex-oidc.nix;
dhparams = runTest ./dhparams.nix;
dictd = runTest ./dictd.nix;
disable-installer-tools = runTest ./disable-installer-tools.nix;
discourse = runTest {
imports = [ ./discourse.nix ];

29
nixos/tests/dictd.nix Normal file
View File

@@ -0,0 +1,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 ")
'';
}

View File

@@ -8,6 +8,7 @@
libmaa,
zlib,
libtool,
nixosTests,
}:
stdenv.mkDerivation rec {
@@ -47,6 +48,8 @@ stdenv.mkDerivation rec {
install -Dm444 -t $out/share/doc/${pname} NEWS README
'';
passthru.tests.nixos = nixosTests.dictd;
meta = {
description = "Dict protocol server and client";
homepage = "http://www.dict.org";