mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
nixos/tests: add redlib test using the libreddit module
This commit is contained in:
parent
161bec7296
commit
bc54360b99
20
nixos/tests/redlib.nix
Normal file
20
nixos/tests/redlib.nix
Normal file
@ -0,0 +1,20 @@
|
||||
import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||
name = "redlib";
|
||||
meta.maintainers = with lib.maintainers; [ soispha ];
|
||||
|
||||
nodes.machine = {
|
||||
services.libreddit = {
|
||||
package = pkgs.redlib;
|
||||
enable = true;
|
||||
# Test CAP_NET_BIND_SERVICE
|
||||
port = 80;
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
machine.wait_for_unit("libreddit.service")
|
||||
machine.wait_for_open_port(80)
|
||||
# Query a page that does not require Internet access
|
||||
machine.succeed("curl --fail http://localhost:80/settings")
|
||||
'';
|
||||
})
|
Loading…
Reference in New Issue
Block a user