diff options
author | Guillaume Girol <symphorien+git@xlumurb.eu> | 2022-02-20 12:00:00 +0000 |
---|---|---|
committer | Guillaume Girol <symphorien+git@xlumurb.eu> | 2022-04-03 17:25:26 +0200 |
commit | 44a3d91e5fb706202f33e2d4180c99dd4a288203 (patch) | |
tree | 1360c50869dc4c65928d20a6f2fa6d35bd0f90e9 /nixos/tests/collectd.nix | |
parent | f9fe536c8f60d7bb98c728c72b3d47a0691ba76c (diff) |
nixos/collectd: put extraconfig before plugins
this is necessary to override the global option Interval. If set after the plugins, it has no effect.
Diffstat (limited to 'nixos/tests/collectd.nix')
-rw-r--r-- | nixos/tests/collectd.nix | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nixos/tests/collectd.nix b/nixos/tests/collectd.nix index 8c9361087661f..2480bdb5f917e 100644 --- a/nixos/tests/collectd.nix +++ b/nixos/tests/collectd.nix @@ -3,11 +3,14 @@ import ./make-test-python.nix ({ pkgs, ... }: { meta = { }; nodes.machine = - { pkgs, ... }: + { pkgs, lib, ... }: { services.collectd = { enable = true; + extraConfig = lib.mkBefore '' + Interval 30 + ''; plugins = { rrdtool = '' DataDir "/var/lib/collectd/rrd" @@ -26,6 +29,8 @@ import ./make-test-python.nix ({ pkgs, ... }: { machine.succeed(f"rrdinfo {file} | logger") # check that this file contains a shortterm metric machine.succeed(f"rrdinfo {file} | grep -F 'ds[shortterm].min = '") + # check that interval was set before the plugins + machine.succeed(f"rrdinfo {file} | grep -F 'step = 30'") # check that there are frequent updates machine.succeed(f"cp {file} before") machine.wait_until_fails(f"cmp before {file}") |