diff options
author | Silvan Mosberger <contact@infinisil.com> | 2019-08-28 18:39:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-28 18:39:21 +0200 |
commit | 6233291d951ff635a76f70f03df4cb870d2bd20c (patch) | |
tree | d6a846806bb6b01a171d7211fc3915b4fd4cfbd5 /nixos/tests | |
parent | fb7611a4968d7b4e5bf451be2d2097096ce4405f (diff) | |
parent | ea40c66bf5aa739d02f483921082fc3b8e3a0d1b (diff) | |
download | nixlib-6233291d951ff635a76f70f03df4cb870d2bd20c.tar nixlib-6233291d951ff635a76f70f03df4cb870d2bd20c.tar.gz nixlib-6233291d951ff635a76f70f03df4cb870d2bd20c.tar.bz2 nixlib-6233291d951ff635a76f70f03df4cb870d2bd20c.tar.lz nixlib-6233291d951ff635a76f70f03df4cb870d2bd20c.tar.xz nixlib-6233291d951ff635a76f70f03df4cb870d2bd20c.tar.zst nixlib-6233291d951ff635a76f70f03df4cb870d2bd20c.zip |
Merge pull request #64738 from rnhmjoj/magnetico
magnetico: init package and service
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/magnetico.nix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/nixos/tests/magnetico.nix b/nixos/tests/magnetico.nix new file mode 100644 index 000000000000..bc7aef653ee5 --- /dev/null +++ b/nixos/tests/magnetico.nix @@ -0,0 +1,28 @@ +import ./make-test.nix ({ pkgs, ...} : { + name = "magnetico"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ rnhmjoj ]; + }; + + machine = { ... }: { + imports = [ ../modules/profiles/minimal.nix ]; + + networking.firewall.allowedTCPPorts = [ 9000 ]; + + services.magnetico = { + enable = true; + crawler.port = 9000; + web.credentials.user = "$2y$12$P88ZF6soFthiiAeXnz64aOWDsY3Dw7Yw8fZ6GtiqFNjknD70zDmNe"; + }; + }; + + testScript = + '' + startAll; + $machine->waitForUnit("magneticod"); + $machine->waitForUnit("magneticow"); + $machine->succeed("${pkgs.curl}/bin/curl -u user:password http://localhost:8080"); + $machine->succeed("${pkgs.curl}/bin/curl -u user:wrongpwd http://localhost:8080") =~ "Unauthorised." or die; + $machine->shutdown(); + ''; +}) |