2016-08-25 13:41:47 +01:00
|
|
|
# This test runs simple etcd node
|
2014-11-15 15:27:27 +00:00
|
|
|
|
2019-11-24 00:38:24 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... } : {
|
2016-08-24 19:11:39 +01:00
|
|
|
name = "etcd";
|
2014-11-15 15:27:27 +00:00
|
|
|
|
2016-08-24 19:11:39 +01:00
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
|
|
maintainers = [ offline ];
|
|
|
|
};
|
2014-11-15 15:27:27 +00:00
|
|
|
|
2016-08-24 19:11:39 +01:00
|
|
|
nodes = {
|
2018-07-20 21:56:59 +01:00
|
|
|
node = { ... }: {
|
2016-08-25 13:41:47 +01:00
|
|
|
services.etcd.enable = true;
|
2014-11-15 15:27:27 +00:00
|
|
|
};
|
2016-08-24 19:11:39 +01:00
|
|
|
};
|
2014-11-15 15:27:27 +00:00
|
|
|
|
2016-08-24 19:11:39 +01:00
|
|
|
testScript = ''
|
2019-11-24 00:38:24 +00:00
|
|
|
with subtest("should start etcd node"):
|
|
|
|
node.start()
|
|
|
|
node.wait_for_unit("etcd.service")
|
2014-11-15 15:27:27 +00:00
|
|
|
|
2019-11-24 00:38:24 +00:00
|
|
|
with subtest("should write and read some values to etcd"):
|
|
|
|
node.succeed("etcdctl set /foo/bar 'Hello world'")
|
|
|
|
node.succeed("etcdctl get /foo/bar | grep 'Hello world'")
|
2014-11-15 15:27:27 +00:00
|
|
|
'';
|
2015-07-12 11:09:40 +01:00
|
|
|
})
|