mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 04:19:00 +02:00
nixosTests.consul-template: init
This commit is contained in:
parent
524fe7ff51
commit
3e7069bb47
|
@ -146,6 +146,7 @@ in {
|
||||||
collectd = handleTest ./collectd.nix {};
|
collectd = handleTest ./collectd.nix {};
|
||||||
connman = handleTest ./connman.nix {};
|
connman = handleTest ./connman.nix {};
|
||||||
consul = handleTest ./consul.nix {};
|
consul = handleTest ./consul.nix {};
|
||||||
|
consul-template = handleTest ./consul-template.nix {};
|
||||||
containers-bridge = handleTest ./containers-bridge.nix {};
|
containers-bridge = handleTest ./containers-bridge.nix {};
|
||||||
containers-custom-pkgs.nix = handleTest ./containers-custom-pkgs.nix {};
|
containers-custom-pkgs.nix = handleTest ./containers-custom-pkgs.nix {};
|
||||||
containers-ephemeral = handleTest ./containers-ephemeral.nix {};
|
containers-ephemeral = handleTest ./containers-ephemeral.nix {};
|
||||||
|
|
36
nixos/tests/consul-template.nix
Normal file
36
nixos/tests/consul-template.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
import ./make-test-python.nix ({ ... }: {
|
||||||
|
name = "consul-template";
|
||||||
|
|
||||||
|
nodes.machine = { ... }: {
|
||||||
|
services.consul-template.instances.example.settings = {
|
||||||
|
template = [{
|
||||||
|
contents = ''
|
||||||
|
{{ key "example" }}
|
||||||
|
'';
|
||||||
|
perms = "0600";
|
||||||
|
destination = "/example";
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.consul = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = {
|
||||||
|
server = true;
|
||||||
|
bootstrap_expect = 1;
|
||||||
|
bind_addr = "127.0.0.1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
machine.wait_for_unit("consul.service")
|
||||||
|
machine.wait_for_open_port(8500)
|
||||||
|
|
||||||
|
machine.wait_for_unit("consul-template-example.service")
|
||||||
|
|
||||||
|
machine.wait_until_succeeds('consul kv put example example')
|
||||||
|
|
||||||
|
machine.wait_for_file("/example")
|
||||||
|
machine.succeed('grep "example" /example')
|
||||||
|
'';
|
||||||
|
})
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, buildGoModule, fetchFromGitHub }:
|
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
||||||
|
|
||||||
buildGoModule rec {
|
buildGoModule rec {
|
||||||
pname = "consul-template";
|
pname = "consul-template";
|
||||||
|
@ -17,6 +17,10 @@ buildGoModule rec {
|
||||||
# execute tests so we skip them here
|
# execute tests so we skip them here
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
passthru.tests = {
|
||||||
|
inherit (nixosTests) consul-template;
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/hashicorp/consul-template/";
|
homepage = "https://github.com/hashicorp/consul-template/";
|
||||||
description = "Generic template rendering and notifications with Consul";
|
description = "Generic template rendering and notifications with Consul";
|
||||||
|
|
Loading…
Reference in a new issue