2016-08-25 12:41:47 +00:00
|
|
|
# This test runs simple etcd node
|
2024-12-10 19:26:33 +00:00
|
|
|
import ../make-test-python.nix (
|
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
|
|
|
name = "etcd";
|
|
|
|
meta = with pkgs.lib.maintainers; {
|
|
|
|
maintainers = [ offline ];
|
|
|
|
};
|
2014-11-15 15:27:27 +00:00
|
|
|
|
2024-12-10 19:26:33 +00:00
|
|
|
nodes = {
|
|
|
|
node =
|
|
|
|
{ ... }:
|
|
|
|
{
|
|
|
|
services.etcd.enable = true;
|
|
|
|
};
|
2014-11-15 15:27:27 +00:00
|
|
|
};
|
|
|
|
|
2024-12-10 19:26:33 +00:00
|
|
|
testScript = ''
|
|
|
|
with subtest("should start etcd node"):
|
|
|
|
node.start()
|
|
|
|
node.wait_for_unit("etcd.service")
|
|
|
|
# Add additional wait for actual readiness
|
|
|
|
node.wait_until_succeeds("etcdctl endpoint health")
|
2014-11-15 15:27:27 +00:00
|
|
|
|
2024-12-10 19:26:33 +00:00
|
|
|
with subtest("should write and read some values to etcd"):
|
|
|
|
node.succeed("etcdctl put /foo/bar 'Hello world'")
|
|
|
|
node.succeed("etcdctl get /foo/bar | grep 'Hello world'")
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
)
|