2020-04-24 23:36:52 +00:00
|
|
|
# This test runs simple etcd node
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
import ../make-test-python.nix ({ pkgs, ... } : {
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "etcd";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ offline ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes = {
|
|
|
|
node = { ... }: {
|
|
|
|
services.etcd.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
with subtest("should start etcd node"):
|
|
|
|
node.start()
|
|
|
|
node.wait_for_unit("etcd.service")
|
|
|
|
|
|
|
|
with subtest("should write and read some values to etcd"):
|
2023-07-15 17:15:38 +00:00
|
|
|
node.succeed("etcdctl put /foo/bar 'Hello world'")
|
2020-04-24 23:36:52 +00:00
|
|
|
node.succeed("etcdctl get /foo/bar | grep 'Hello world'")
|
|
|
|
'';
|
|
|
|
})
|