about summary refs log tree commit diff
path: root/nixos/tests/snmpd.nix
diff options
context:
space:
mode:
authorElian Doran <contact@eliandoran.me>2023-12-02 16:05:57 +0200
committerElian Doran <contact@eliandoran.me>2023-12-19 18:54:34 +0200
commitafdbb7a9c0c6f9ec2013c4729bc4fad318b2702c (patch)
treeb2718256b285980a59fa43d5bac915f67591ba4a /nixos/tests/snmpd.nix
parent2b0bf78df61b2b05feb05f364fad1ab519645713 (diff)
nixos/snmpd: add nixos test
Diffstat (limited to 'nixos/tests/snmpd.nix')
-rw-r--r--nixos/tests/snmpd.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/nixos/tests/snmpd.nix b/nixos/tests/snmpd.nix
new file mode 100644
index 0000000000000..9248a6b390101
--- /dev/null
+++ b/nixos/tests/snmpd.nix
@@ -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");
+  '';
+
+})