nixos/engelsystem: Add test
This commit is contained in:
parent
fc4d6f4215
commit
1e343d1638
|
@ -86,6 +86,7 @@ in
|
|||
ecryptfs = handleTest ./ecryptfs.nix {};
|
||||
ejabberd = handleTest ./xmpp/ejabberd.nix {};
|
||||
elk = handleTestOn ["x86_64-linux"] ./elk.nix {};
|
||||
engelsystem = handleTest ./engelsystem.nix {};
|
||||
enlightenment = handleTest ./enlightenment.nix {};
|
||||
env = handleTest ./env.nix {};
|
||||
etcd = handleTestOn ["x86_64-linux"] ./etcd.nix {};
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
import ./make-test-python.nix (
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
name = "engelsystem";
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
maintainers = [ talyz ];
|
||||
};
|
||||
|
||||
nodes.engelsystem =
|
||||
{ ... }:
|
||||
{
|
||||
services.engelsystem = {
|
||||
enable = true;
|
||||
domain = "engelsystem";
|
||||
createDatabase = true;
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
environment.systemPackages = with pkgs; [
|
||||
xmlstarlet
|
||||
libxml2
|
||||
];
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
engelsystem.start()
|
||||
engelsystem.wait_for_unit("phpfpm-engelsystem.service")
|
||||
engelsystem.wait_until_succeeds("curl engelsystem/login -sS -f")
|
||||
engelsystem.succeed(
|
||||
"curl engelsystem/login -sS -f -c cookie | xmllint -html -xmlout - >login"
|
||||
)
|
||||
engelsystem.succeed(
|
||||
"xml sel -T -t -m \"html/head/meta[@name='csrf-token']\" -v @content login >token"
|
||||
)
|
||||
engelsystem.succeed(
|
||||
"curl engelsystem/login -sS -f -b cookie -F 'login=admin' -F 'password=asdfasdf' -F '_token=<token' -L | xmllint -html -xmlout - >news"
|
||||
)
|
||||
engelsystem.succeed(
|
||||
"test 'News - Engelsystem' = \"$(xml sel -T -t -c html/head/title news)\""
|
||||
)
|
||||
'';
|
||||
})
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, fetchzip, php, writeText }:
|
||||
{ stdenv, fetchzip, php, writeText, nixosTests }:
|
||||
|
||||
let
|
||||
phpExt = php.withExtensions
|
||||
|
@ -39,6 +39,8 @@ in stdenv.mkDerivation rec {
|
|||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.tests = nixosTests.engelsystem;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description =
|
||||
"Coordinate your helpers in teams, assign them to work shifts or let them decide for themselves when and where they want to help with what";
|
||||
|
|
Loading…
Reference in New Issue