nixpkgs-suyu/nixos/tests/etcd.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
583 B
Nix
Raw Normal View History

# This test runs simple etcd node
2014-11-15 16:27:27 +01:00
2019-11-24 01:38:24 +01:00
import ./make-test-python.nix ({ pkgs, ... } : {
name = "etcd";
2014-11-15 16:27:27 +01:00
meta = with pkgs.lib.maintainers; {
maintainers = [ offline ];
};
2014-11-15 16:27:27 +01:00
nodes = {
node = { ... }: {
services.etcd.enable = true;
2014-11-15 16:27:27 +01:00
};
};
2014-11-15 16:27:27 +01:00
testScript = ''
2019-11-24 01:38:24 +01:00
with subtest("should start etcd node"):
node.start()
node.wait_for_unit("etcd.service")
2014-11-15 16:27:27 +01:00
2019-11-24 01:38:24 +01:00
with subtest("should write and read some values to etcd"):
2023-05-23 22:54:43 +02:00
node.succeed("etcdctl put /foo/bar 'Hello world'")
2019-11-24 01:38:24 +01:00
node.succeed("etcdctl get /foo/bar | grep 'Hello world'")
2014-11-15 16:27:27 +01:00
'';
})