1# This test runs simple etcd node
2{ lib, ... }:
3{
4 name = "etcd";
5 meta.maintainers = with lib.maintainers; [ offline ];
6
7 nodes.node = {
8 services.etcd.enable = true;
9 };
10
11 testScript = ''
12 with subtest("should start etcd node"):
13 node.start()
14 node.wait_for_unit("etcd.service")
15 # Add additional wait for actual readiness
16 node.wait_until_succeeds("etcdctl endpoint health")
17
18 with subtest("should write and read some values to etcd"):
19 node.succeed("etcdctl put /foo/bar 'Hello world'")
20 node.succeed("etcdctl get /foo/bar | grep 'Hello world'")
21 '';
22}