about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorPeder Bergebakken Sundt <pbsds@hotmail.com>2024-01-09 21:32:27 +0100
committerGitHub <noreply@github.com>2024-01-09 21:32:27 +0100
commit3bf05ba941afee19a90898ae742421705e91fab0 (patch)
tree8abf1542a31c5e919bba4a4f2ed592343719025f /nixos/tests
parent9be143188c5f4ca69b5dc14114378f9a200931e3 (diff)
parentafdbb7a9c0c6f9ec2013c4729bc4fad318b2702c (diff)
downloadnixlib-3bf05ba941afee19a90898ae742421705e91fab0.tar
nixlib-3bf05ba941afee19a90898ae742421705e91fab0.tar.gz
nixlib-3bf05ba941afee19a90898ae742421705e91fab0.tar.bz2
nixlib-3bf05ba941afee19a90898ae742421705e91fab0.tar.lz
nixlib-3bf05ba941afee19a90898ae742421705e91fab0.tar.xz
nixlib-3bf05ba941afee19a90898ae742421705e91fab0.tar.zst
nixlib-3bf05ba941afee19a90898ae742421705e91fab0.zip
Merge pull request #271481 from eliandoran/feature/snmpd
nixos/snmpd: init
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/snmpd.nix23
2 files changed, 24 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index eed43d7a080e..462df297e70f 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -773,6 +773,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 {};
diff --git a/nixos/tests/snmpd.nix b/nixos/tests/snmpd.nix
new file mode 100644
index 000000000000..9248a6b39010
--- /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");
+  '';
+
+})