slipshow: init nixos test

Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
This commit is contained in:
Ethan Carter Edwards
2025-08-17 05:22:35 -04:00
parent 69f83234ac
commit d306a6025e
3 changed files with 41 additions and 1 deletions

View File

@@ -1348,6 +1348,7 @@ in
simple = runTest ./simple.nix; simple = runTest ./simple.nix;
sing-box = runTest ./sing-box.nix; sing-box = runTest ./sing-box.nix;
slimserver = runTest ./slimserver.nix; slimserver = runTest ./slimserver.nix;
slipshow = runTest ./slipshow.nix;
slurm = runTest ./slurm.nix; slurm = runTest ./slurm.nix;
snmpd = runTest ./snmpd.nix; snmpd = runTest ./snmpd.nix;
smokeping = runTest ./smokeping.nix; smokeping = runTest ./smokeping.nix;

35
nixos/tests/slipshow.nix Normal file
View File

@@ -0,0 +1,35 @@
{
lib,
pkgs,
...
}:
{
name = "slipshow presentation test";
meta.maintainers = with lib.maintainers; [ ethancedwards8 ];
nodes.machine = {
environment.systemPackages = with pkgs; [ slipshow ];
environment.etc."slipshow".source = pkgs.fetchFromGitHub {
owner = "meithecatte";
repo = "bbslides";
rev = "ce1c08cafa71ae36dda8cc581956548b8386ae16";
hash = "sha256-sOydmvtDeMhNejDkwlsXdrbwtqN6lcNnzTnGzBVRFxA=";
};
};
testScript =
{ nodes, ... }:
''
start_all()
# it may take around a minute to compile the file and serve it
machine.succeed("slipshow serve /etc/slipshow/bbslides.md &>/dev/null &")
# slipshow serves defaultly on :8080 and unfortunately cannot
# be changed currently
machine.wait_for_open_port(8080)
machine.succeed("curl -i 0.0.0.0:8080")
'';
}

View File

@@ -3,6 +3,7 @@
ocamlPackages, ocamlPackages,
fetchFromGitHub, fetchFromGitHub,
versionCheckHook, versionCheckHook,
nixosTests,
nix-update-script, nix-update-script,
}: }:
@@ -49,7 +50,10 @@ ocamlPackages.buildDunePackage rec {
versionCheckProgramArg = "--version"; versionCheckProgramArg = "--version";
doInstallCheck = true; doInstallCheck = true;
passthru.updateScript = nix-update-script { }; passthru = {
tests = { inherit (nixosTests) slipshow; };
updateScript = nix-update-script { };
};
meta = { meta = {
description = "Engine for displaying slips, the next-gen version of slides"; description = "Engine for displaying slips, the next-gen version of slides";