1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00

nixos/snmpd: add nixos test

This commit is contained in:
Elian Doran 2023-12-02 16:05:57 +02:00
parent 2b0bf78df6
commit afdbb7a9c0
2 changed files with 24 additions and 0 deletions

View file

@ -765,6 +765,7 @@ in {
sing-box = handleTest ./sing-box.nix {};
slimserver = handleTest ./slimserver.nix {};
slurm = handleTest ./slurm.nix {};
snmpd = handleTest ./snmpd.nix {};
smokeping = handleTest ./smokeping.nix {};
snapcast = handleTest ./snapcast.nix {};
snapper = handleTest ./snapper.nix {};

23
nixos/tests/snmpd.nix Normal file
View file

@ -0,0 +1,23 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "snmpd";
nodes.snmpd = {
environment.systemPackages = with pkgs; [
net-snmp
];
services.snmpd = {
enable = true;
configText = ''
rocommunity public
'';
};
};
testScript = ''
start_all();
machine.wait_for_unit("snmpd.service")
machine.succeed("snmpwalk -v 2c -c public localhost | grep SNMPv2-MIB::sysName.0");
'';
})