nixpkgs/nixos/tests/go-camo.nix

37 lines
792 B
Nix
Raw Permalink Normal View History

{
system ? builtins.currentSystem,
config ? { },
pkgs ? import ../.. { inherit system config; },
}:
2022-06-26 01:20:59 +10:00
with import ../lib/testing-python.nix { inherit system pkgs; };
{
gocamo_file_key =
let
2022-06-26 01:20:59 +10:00
key_val = "12345678";
in
makeTest {
name = "go-camo-file-key";
meta = {
maintainers = [ pkgs.lib.maintainers.viraptor ];
2022-06-26 01:20:59 +10:00
};
nodes.machine =
{ config, pkgs, ... }:
{
services.go-camo = {
enable = true;
keyFile = pkgs.writeText "foo" key_val;
};
};
# go-camo responds to http requests
testScript = ''
machine.wait_for_unit("go-camo.service")
machine.wait_for_open_port(8080)
machine.succeed("curl http://localhost:8080")
'';
};
2022-06-26 01:20:59 +10:00
}