Files
nixpkgs/nixos/tests/netdata.nix
Raito Bezarius 6a63a4ad8b pkgs/*: drop maintenanceship of various packages
I have effectively renounced on maintaining all these packages and I do
not plan to return them except if I'm forced to.

I am also fine with most of these packages being dropped for next
releases if no maintainer shows up.

Change-Id: I8d167c8029b6991181bd7a094af21c3313af2b51
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2026-06-24 20:34:45 +02:00

55 lines
1.3 KiB
Nix

# This test runs netdata and checks for data via apps.plugin
{ pkgs, ... }:
{
name = "netdata";
meta = with pkgs.lib.maintainers; {
maintainers = [
cransom
];
};
nodes = {
netdata =
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
curl
jq
netdata
];
services.netdata = {
enable = true;
package = pkgs.netdataCloud;
python.recommendedPythonPackages = true;
configDir."apps_groups.conf" = pkgs.writeText "apps_groups.conf" ''
netdata_test: netdata
'';
};
};
};
testScript = ''
start_all()
netdata.wait_for_unit("netdata.service")
# wait for the service to listen before sending a request
netdata.wait_for_open_port(19999)
# check if the netdata main page loads.
netdata.succeed("curl --fail http://127.0.0.1:19999")
netdata.succeed("sleep 4")
# check if netdata api shows correct os
url = "http://127.0.0.1:19999/api/v3/info"
filter = '.agents[0].application.os.os | . == "NixOS"'
cmd = f"curl -s {url} | jq -e '{filter}'"
netdata.wait_until_succeeds(cmd)
# check if the control socket is available
netdata.succeed("sudo netdatacli ping")
'';
}