geoserver: add nixos test

This commit is contained in:
Ivan Mincik 2023-11-17 23:29:45 +01:00
parent 3d84496c93
commit a08880000d
3 changed files with 38 additions and 1 deletions

View File

@ -320,6 +320,7 @@ in {
mimir = handleTest ./mimir.nix {};
garage = handleTest ./garage {};
gemstash = handleTest ./gemstash.nix {};
geoserver = runTest ./geoserver.nix;
gerrit = handleTest ./gerrit.nix {};
geth = handleTest ./geth.nix {};
ghostunnel = handleTest ./ghostunnel.nix {};

24
nixos/tests/geoserver.nix Normal file
View File

@ -0,0 +1,24 @@
{ pkgs, lib, ... }: {
name = "geoserver";
meta = {
maintainers = with lib; [ teams.geospatial.members ];
};
nodes = {
machine = { pkgs, ... }: {
virtualisation.diskSize = 2 * 1024;
environment.systemPackages = [ pkgs.geoserver ];
};
};
testScript = ''
start_all()
machine.execute("${pkgs.geoserver}/bin/geoserver-startup > /dev/null 2>&1 &")
machine.wait_until_succeeds("curl --fail --connect-timeout 2 http://localhost:8080/geoserver", timeout=60)
machine.succeed("curl --fail --connect-timeout 2 http://localhost:8080/geoserver/ows?service=WMS&version=1.3.0&request=GetCapabilities")
'';
}

View File

@ -1,4 +1,12 @@
{ lib, stdenv, fetchurl, unzip, jre, makeWrapper }:
{ lib
, fetchurl
, makeWrapper
, nixosTests
, stdenv
, jre
, unzip
}:
stdenv.mkDerivation rec {
pname = "geoserver";
@ -32,6 +40,10 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
passthru = {
tests.geoserver = nixosTests.geoserver;
};
meta = with lib; {
description = "Open source server for sharing geospatial data";
homepage = "https://geoserver.org/";