2016-08-25 05:41:47 -07:00
|
|
|
# This test runs simple etcd node
|
2014-11-15 07:27:27 -08:00
|
|
|
|
2016-08-25 05:41:47 -07:00
|
|
|
import ./make-test.nix ({ pkgs, ... } : {
|
2016-08-24 11:11:39 -07:00
|
|
|
name = "etcd";
|
2014-11-15 07:27:27 -08:00
|
|
|
|
2016-08-24 11:11:39 -07:00
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
|
|
maintainers = [ offline ];
|
|
|
|
};
|
2014-11-15 07:27:27 -08:00
|
|
|
|
2016-08-24 11:11:39 -07:00
|
|
|
nodes = {
|
2016-08-25 05:41:47 -07:00
|
|
|
node = { config, pkgs, nodes, ... }: {
|
|
|
|
services.etcd.enable = true;
|
2014-11-15 07:27:27 -08:00
|
|
|
};
|
2016-08-24 11:11:39 -07:00
|
|
|
};
|
2014-11-15 07:27:27 -08:00
|
|
|
|
2016-08-24 11:11:39 -07:00
|
|
|
testScript = ''
|
2016-08-25 05:41:47 -07:00
|
|
|
subtest "should start etcd node", sub {
|
|
|
|
$node->start();
|
|
|
|
$node->waitForUnit("etcd.service");
|
2016-08-24 11:11:39 -07:00
|
|
|
};
|
2014-11-15 07:27:27 -08:00
|
|
|
|
2016-08-25 05:41:47 -07:00
|
|
|
subtest "should write and read some values to etcd", sub {
|
|
|
|
$node->succeed("etcdctl set /foo/bar 'Hello world'");
|
|
|
|
$node->succeed("etcdctl get /foo/bar | grep 'Hello world'");
|
|
|
|
}
|
2014-11-15 07:27:27 -08:00
|
|
|
'';
|
2015-07-12 03:09:40 -07:00
|
|
|
})
|