forked from mirrors/nixpkgs
nixos/agate: add nixos test
This commit is contained in:
parent
0a6d22c6c3
commit
354b240782
|
@ -32,6 +32,7 @@ in
|
|||
acme = handleTest ./acme.nix {};
|
||||
adguardhome = handleTest ./adguardhome.nix {};
|
||||
aesmd = handleTest ./aesmd.nix {};
|
||||
agate = handleTest ./web-servers/agate.nix {};
|
||||
agda = handleTest ./agda.nix {};
|
||||
airsonic = handleTest ./airsonic.nix {};
|
||||
amazon-init-shell = handleTest ./amazon-init-shell.nix {};
|
||||
|
|
29
nixos/tests/web-servers/agate.nix
Normal file
29
nixos/tests/web-servers/agate.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
import ../make-test-python.nix (
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
name = "agate";
|
||||
meta = with lib.maintainers; { maintainers = [ jk ]; };
|
||||
|
||||
nodes = {
|
||||
geminiserver = { pkgs, ... }: {
|
||||
services.agate = {
|
||||
enable = true;
|
||||
hostnames = [ "localhost" ];
|
||||
contentDir = pkgs.writeTextDir "index.gmi" ''
|
||||
# Hello NixOS!
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = { nodes, ... }: ''
|
||||
geminiserver.wait_for_unit("agate")
|
||||
geminiserver.wait_for_open_port(1965)
|
||||
|
||||
with subtest("check is serving over gemini"):
|
||||
response = geminiserver.succeed("${pkgs.gmni}/bin/gmni -j once -i -N gemini://localhost:1965")
|
||||
print(response)
|
||||
assert "Hello NixOS!" in response
|
||||
'';
|
||||
}
|
||||
)
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, stdenv, fetchFromGitHub, rustPlatform, libiconv, Security }:
|
||||
{ lib, stdenv, nixosTests, fetchFromGitHub, rustPlatform, libiconv, Security }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "agate";
|
||||
|
@ -23,6 +23,8 @@ rustPlatform.buildRustPackage rec {
|
|||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
passthru.tests = { inherit (nixosTests) agate; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/mbrubeck/agate";
|
||||
changelog = "https://github.com/mbrubeck/agate/blob/master/CHANGELOG.md";
|
||||
|
|
Loading…
Reference in a new issue