3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/tests/libreddit.nix
Alexandre Iooss f04ef2a25b nixos/libreddit: do not test an error
The current test needs Reddit access, which we do not have in testing
environment. This commit tests the settings page of libreddit which does
not require network access. It also test if the service can run on port
80 with the CAP_NET_BIND_SERVICE capability.
2021-12-28 12:14:07 +01:00

22 lines
492 B
Nix

import ./make-test-python.nix ({ lib, ... }:
with lib;
{
name = "libreddit";
meta.maintainers = with maintainers; [ fab ];
nodes.machine = {
services.libreddit.enable = true;
# Test CAP_NET_BIND_SERVICE
services.libreddit.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")
'';
})