nixos/test: init omnom

This commit is contained in:
eljamm 2025-05-20 21:03:22 +02:00 committed by Valentin Gagarin
parent 19c1b4250c
commit 56c4e8b5b5
3 changed files with 46 additions and 0 deletions

View File

@ -1008,6 +1008,7 @@ in
ollama-cuda = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./ollama-cuda.nix;
ollama-rocm = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./ollama-rocm.nix;
ombi = runTest ./ombi.nix;
omnom = runTest ./omnom.nix;
openarena = runTest ./openarena.nix;
openbao = runTest ./openbao.nix;
opencloud = runTest ./opencloud.nix;

42
nixos/tests/omnom.nix Normal file
View File

@ -0,0 +1,42 @@
{ lib, ... }:
let
servicePort = 9090;
in
{
name = "Basic Omnom Test";
meta = {
maintainers = lib.teams.ngi.members;
};
nodes = {
server =
{ config, lib, ... }:
{
services.omnom = {
enable = true;
openFirewall = true;
port = servicePort;
settings = {
app = {
disable_signup = false; # restrict CLI user-creation
results_per_page = 50;
};
server.address = "0.0.0.0:${toString servicePort}";
};
};
};
};
# TODO: take a snapshot
testScript =
{ nodes, ... }:
# python
''
server.start()
server.wait_for_unit("omnom.service")
server.wait_for_open_port(${toString servicePort})
server.succeed("curl -sf http://localhost:${toString servicePort}")
'';
}

View File

@ -4,6 +4,7 @@
fetchFromGitHub,
nix-update-script,
makeWrapper,
nixosTests,
# for addons
buildNpmPackage,
@ -77,6 +78,8 @@ buildGoModule (finalAttrs: {
cp config.yml_sample $out/share/examples/config.yml
'';
passthru.tests = nixosTests.omnom;
meta = {
description = "Webpage bookmarking and snapshotting service";
homepage = "https://github.com/asciimoo/omnom";