Merge pull request #203733 from nagy/freenet-nixos-test

nixosTests.freenet: init
This commit is contained in:
Mario Rodas 2022-11-30 21:18:55 -05:00 committed by GitHub
commit 4a057b08c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View File

@ -213,6 +213,7 @@ in {
fluentd = handleTest ./fluentd.nix {};
fluidd = handleTest ./fluidd.nix {};
fontconfig-default-fonts = handleTest ./fontconfig-default-fonts.nix {};
freenet = handleTest ./freenet.nix {};
freeswitch = handleTest ./freeswitch.nix {};
freshrss = handleTest ./freshrss.nix {};
frr = handleTest ./frr.nix {};

19
nixos/tests/freenet.nix Normal file
View File

@ -0,0 +1,19 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "freenet";
meta = with pkgs.lib.maintainers; {
maintainers = [ nagy ];
};
nodes = {
machine = { ... }: {
services.freenet.enable = true;
};
};
testScript = ''
machine.wait_for_unit("freenet.service")
machine.wait_for_open_port(8888)
machine.wait_until_succeeds("curl -sfL http://localhost:8888/ | grep Freenet")
machine.succeed("systemctl stop freenet")
'';
})

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, jdk, bash, coreutils, substituteAll }:
{ lib, stdenv, fetchurl, jdk, bash, coreutils, substituteAll, nixosTests }:
let
version = "build01494";
@ -56,6 +56,8 @@ in stdenv.mkDerivation {
dontUnpack = true;
passthru.tests = { inherit (nixosTests) freenet; };
installPhase = ''
mkdir -p $out/bin
install -Dm555 $src $out/bin/freenet