nixos/tests/prometheus.exporters.smartctl: init

Starts the exporter, checks it answers via HTTP, checks that it can't
detect the device type of the virtual disk.
This commit is contained in:
Martin Weinelt 2021-11-23 11:29:11 +01:00
parent 386a1e79eb
commit 02316a4565
No known key found for this signature in database
GPG key ID: 87C1E9888F856759

View file

@ -1015,6 +1015,25 @@ let
'';
};
smartctl = {
exporterConfig = {
enable = true;
devices = [
"/dev/vda"
];
};
exporterTest = ''
wait_for_unit("prometheus-smartctl-exporter.service")
wait_for_open_port("9633")
wait_until_succeeds(
"curl -sSf 'localhost:9633/metrics'"
)
wait_until_succeeds(
'journalctl -eu prometheus-smartctl-exporter.service -o cat | grep "/dev/vda: Unable to detect device type"'
)
'';
};
smokeping = {
exporterConfig = {
enable = true;