mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-11 07:15:54 +03:00
nixos/pyload: init test
This commit is contained in:
parent
70d0a6e547
commit
60518d6a52
@ -387,6 +387,7 @@ in {
|
||||
installed-tests = pkgs.recurseIntoAttrs (handleTest ./installed-tests {});
|
||||
invidious = handleTest ./invidious.nix {};
|
||||
livebook-service = handleTest ./livebook-service.nix {};
|
||||
pyload = handleTest ./pyload.nix {};
|
||||
oci-containers = handleTestOn ["aarch64-linux" "x86_64-linux"] ./oci-containers.nix {};
|
||||
odoo = handleTest ./odoo.nix {};
|
||||
odoo15 = handleTest ./odoo.nix { package = pkgs.odoo15; };
|
||||
|
33
nixos/tests/pyload.nix
Normal file
33
nixos/tests/pyload.nix
Normal file
@ -0,0 +1,33 @@
|
||||
import ./make-test-python.nix ({ lib, ... }: {
|
||||
name = "pyload";
|
||||
meta.maintainers = with lib.maintainers; [ ambroisie ];
|
||||
|
||||
nodes = {
|
||||
machine = { ... }: {
|
||||
services.pyload = {
|
||||
enable = true;
|
||||
|
||||
listenAddress = "0.0.0.0";
|
||||
port = 9876;
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 9876 ];
|
||||
};
|
||||
|
||||
client = { };
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
machine.wait_for_unit("pyload.service")
|
||||
|
||||
with subtest("Web interface accessible locally"):
|
||||
machine.wait_until_succeeds("curl -fs localhost:9876")
|
||||
|
||||
client.wait_for_unit("network.target")
|
||||
|
||||
with subtest("Web interface accessible from a different machine"):
|
||||
client.wait_until_succeeds("curl -fs machine:9876")
|
||||
'';
|
||||
})
|
@ -1,4 +1,4 @@
|
||||
{ lib, fetchPypi, python3 }:
|
||||
{ lib, fetchPypi, nixosTests, python3 }:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
version = "0.5.0b3.dev75";
|
||||
@ -43,7 +43,8 @@ python3.pkgs.buildPythonApplication rec {
|
||||
setuptools
|
||||
];
|
||||
|
||||
passthru.optional-dependencies = {
|
||||
passthru = {
|
||||
optional-dependencies = {
|
||||
plugins = with python3.pkgs; [
|
||||
beautifulsoup4 # for some plugins
|
||||
colorlog # colorful console logging
|
||||
@ -53,6 +54,11 @@ python3.pkgs.buildPythonApplication rec {
|
||||
];
|
||||
};
|
||||
|
||||
tests = {
|
||||
inherit (nixosTests) pyload;
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Free and open-source download manager with support for 1-click-hosting sites";
|
||||
homepage = "https://github.com/pyload/pyload";
|
||||
|
Loading…
Reference in New Issue
Block a user