mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
nixosTests.realm: init
This commit is contained in:
parent
86ce0733d2
commit
76b5481df7
@ -811,6 +811,7 @@ in {
|
|||||||
ragnarwm = handleTest ./ragnarwm.nix {};
|
ragnarwm = handleTest ./ragnarwm.nix {};
|
||||||
rasdaemon = handleTest ./rasdaemon.nix {};
|
rasdaemon = handleTest ./rasdaemon.nix {};
|
||||||
readarr = handleTest ./readarr.nix {};
|
readarr = handleTest ./readarr.nix {};
|
||||||
|
realm = handleTest ./realm.nix {};
|
||||||
redis = handleTest ./redis.nix {};
|
redis = handleTest ./redis.nix {};
|
||||||
redlib = handleTest ./redlib.nix {};
|
redlib = handleTest ./redlib.nix {};
|
||||||
redmine = handleTest ./redmine.nix {};
|
redmine = handleTest ./redmine.nix {};
|
||||||
|
39
nixos/tests/realm.nix
Normal file
39
nixos/tests/realm.nix
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||||
|
name = "realm";
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
maintainers = with lib.maintainers; [ ocfox ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.machine = { pkgs, ... }: {
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
statusPage = true;
|
||||||
|
};
|
||||||
|
# realm need DNS resolv server to run or use config.dns.nameserver
|
||||||
|
services.resolved.enable = true;
|
||||||
|
|
||||||
|
services.realm = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
endpoints = [
|
||||||
|
{
|
||||||
|
listen = "0.0.0.0:1000";
|
||||||
|
remote = "127.0.0.1:80";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
machine.wait_for_unit("nginx.service")
|
||||||
|
machine.wait_for_unit("realm.service")
|
||||||
|
|
||||||
|
machine.wait_for_open_port(80)
|
||||||
|
machine.wait_for_open_port(1000)
|
||||||
|
|
||||||
|
machine.succeed("curl --fail http://localhost:1000/")
|
||||||
|
'';
|
||||||
|
|
||||||
|
})
|
@ -3,6 +3,8 @@
|
|||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, stdenv
|
, stdenv
|
||||||
, darwin
|
, darwin
|
||||||
|
, nix-update-script
|
||||||
|
, nixosTests
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
@ -24,6 +26,12 @@ rustPlatform.buildRustPackage rec {
|
|||||||
|
|
||||||
env.RUSTC_BOOTSTRAP = 1;
|
env.RUSTC_BOOTSTRAP = 1;
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
updateScript = nix-update-script { };
|
||||||
|
tests = { inherit (nixosTests) realm; };
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "A simple, high performance relay server written in rust";
|
description = "A simple, high performance relay server written in rust";
|
||||||
homepage = "https://github.com/zhboner/realm";
|
homepage = "https://github.com/zhboner/realm";
|
||||||
|
Loading…
Reference in New Issue
Block a user